================================================
FILE: client/app/config/main.config.js
================================================
import angular from 'angular';
import 'angular-ui-router';
import {errorsRouteModule} from 'app/routes/errors/errors.route';
export var mainConfigModule = angular.module('mainConfigModule', [
'ui.router',
errorsRouteModule.name,
]).config([
'$locationProvider', '$urlRouterProvider', '$httpProvider', '$compileProvider',
'$controllerProvider', '$rootScopeProvider',
function ($locationProvider, $urlRouterProvider, $httpProvider, $compileProvider,
$controllerProvider, $rootScopeProvider) {
$locationProvider.html5Mode(true);
$httpProvider.useApplyAsync(true);
$compileProvider.debugInfoEnabled(false);
$rootScopeProvider.digestTtl(8);
$urlRouterProvider.rule(function($injector, $location) {
var path = $location.path();
// Remove trailing slashes from path
if (path !== '/' && path.slice(-1) === '/') {
$location.replace().path(path.slice(0, -1));
}
});
$urlRouterProvider.otherwise('/404');
}
]).run([
'$rootScope',
function($rootScope) {
$rootScope.$on('$stateChangeError', function $stateChangeError(event, toState,
toParams, fromState, fromParams, error) {
console.group();
console.error('$stateChangeError', error);
console.error(error.stack);
console.info('event', event);
console.info('toState', toState);
console.info('toParams', toParams);
console.info('fromState', fromState);
console.info('fromParams', fromParams);
console.groupEnd();
});
}
]);
================================================
FILE: client/app/main.js
================================================
import angular from 'angular';
import 'angular-touch';
import 'angular-animate';
import 'angular-aria';
import 'angular-messages';
import 'angular-i18n-en-gb';
import {mainConfigModule} from 'app/config/main.config';
import {homeRouteModule} from 'app/routes/home/home.route';
export var mainModule = angular.module('mainModule', [
// ngTouch has to be BEFORE ngAria, else ng-clicks happen twice
'ngTouch',
'ngAnimate',
'ngAria',
'ngMessages',
mainConfigModule.name,
homeRouteModule.name
]).run();
================================================
FILE: client/app/routes/auth-required.route.js
================================================
import angular from 'angular';
import 'angular-ui-router';
import {currentUserModule} from 'app/services/current-user/current-user';
import {siteHeaderComponentModule} from 'app/components/site-header/site-header.directive';
import {authRequiredComponentModule} from 'app/components/auth-required/auth-required.directive';
export var authRequiredRouteModule = angular.module('authRequiredRouteModule', [
'ui.router',
currentUserModule.name,
siteHeaderComponentModule.name,
authRequiredComponentModule.name,
]).config([
'$stateProvider',
function authRequiredRoute($stateProvider) {
$stateProvider.state('authRequired', {
abstract: true,
views: {
'': {
template: ''
},
'site-header': {
template: '',
controllerAs: 'ctrl',
controller: [
'currentUser',
function authRequiredSiteHeaderController(currentUser) {
var ctrl = this;
ctrl.currentUser = currentUser;
}
]
}
},
resolve: {
currentUser: [
'CurrentUser',
function currentUserResolver(CurrentUser) {
return CurrentUser.get();
}
]
}
});
}
]);
================================================
FILE: client/app/routes/errors/404/errors-404.route.js
================================================
import angular from 'angular';
import 'angular-ui-router';
import template from './errors-404.template.html!text';
export var errors404RouteModule = angular.module('errors404RouteModule', [
'ui.router'
]).config([
'$stateProvider',
function usersLoginRoute($stateProvider) {
$stateProvider.state('errors.404', {
url: '/404',
template: template
});
}
]);
================================================
FILE: client/app/routes/errors/404/errors-404.template.html
================================================
Oops! This link appears broken.
The page may have moved, or perhaps
you mis-typed the address.
================================================
FILE: client/app/routes/errors/errors.route.js
================================================
import angular from 'angular';
import 'angular-ui-router';
import {errors404RouteModule} from './404/errors-404.route';
export var errorsRouteModule = angular.module('errorsRouteModule', [
'ui.router',
errors404RouteModule.name
]).config([
'$stateProvider',
function errorsRoute($stateProvider) {
$stateProvider.state('errors', {
abstract: true,
template: ''
});
}
]);
================================================
FILE: client/app/routes/home/home.route.js
================================================
import angular from 'angular';
import 'angular-ui-router';
import {homeIndexRouteModule} from './index/home-index.route';
import {authRequiredRouteModule} from 'app/routes/auth-required.route';
export var homeRouteModule = angular.module('homeRouteModule', [
'ui.router',
authRequiredRouteModule.name,
homeIndexRouteModule.name
]).config([
'$stateProvider',
function homeRoute($stateProvider) {
$stateProvider.state('authRequired.home', {
abstract: true,
template: ''
});
}
]);
================================================
FILE: client/app/routes/home/index/home-index.e2e.js
================================================
describe('home index', function() {
it('has heading', function() {
browser.get('/');
expect(element(by.css('h2')).getText()).toEqual('Example');
});
});
================================================
FILE: client/app/routes/home/index/home-index.route.js
================================================
import angular from 'angular';
import 'angular-ui-router';
import {authRequiredRouteModule} from 'app/routes/auth-required.route';
import template from './home-index.template.html!text';
export var homeIndexRouteModule = angular.module('homeIndexRouteModule', [
'ui.router',
authRequiredRouteModule.name
]).config([
'$stateProvider',
function homeRoute($stateProvider) {
$stateProvider.state('authRequired.home.index', {
url: '/',
template: template
});
}
]);
================================================
FILE: client/app/routes/home/index/home-index.template.html
================================================
Example
================================================
FILE: client/app/services/current-user/current-user.js
================================================
import angular from 'angular';
export var currentUserModule = angular.module('currentUserModule', [
]).factory('CurrentUser', [
'$q',
function CurrentUser($q) {
function get() {
var deferred = $q.defer();
deferred.resolve({
name: 'GoCardless'
});
return deferred.promise;
}
return {
get: get
};
}
]);
================================================
FILE: client/app/services/current-user/current-user.spec.js
================================================
import angular from 'angular';
import 'angular-mock';
import {currentUserModule} from './current-user';
describe('CurrentUser', function() {
beforeEach(angular.mock.module(currentUserModule.name));
var CurrentUser, scope;
beforeEach(inject(function($injector) {
CurrentUser = $injector.get('CurrentUser');
scope = $injector.get('$rootScope');
}));
describe('.get', function() {
it('has a user', function() {
var user;
CurrentUser.get().then(function(data) {
user = data;
});
scope.$digest();
expect(user).toEqual({ name: 'GoCardless' });
});
});
});
================================================
FILE: client/assets/stylesheets/main.css
================================================
@import 'variables.css';
@import '../../components/normalize-css/normalize.css';
@import 'shared/base.css';
================================================
FILE: client/assets/stylesheets/shared/base.css
================================================
/* ==========================================================================
Base
========================================================================== */
/**
* A thin layer on top of normalize.css that provides a starting point more
* suitable for web applications. Removes the default spacing and border for
* appropriate elements.
*/
*, *:before, *:after {
box-sizing: border-box;
}
html,
body {
height: 100%;
}
html {
background: inherit;
font-size: var(--font-size-s);
}
html,
button,
input,
select,
textarea {
color: var(--color-gray-vdark);
font-family: var(--font-family-base);
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
body {
line-height: var(--base-line-height);
}
a {
color: var(--color-primary);
text-decoration: none;
}
a:focus
a:hover,
a:active {
color: var(--color-primary);
}
a:hover,
a:active {
text-decoration: underline;
}
a:focus {
text-decoration: none;
}
:focus {
outline: 1px dotted var(--color-gray);
}
blockquote,
dl,
dd,
h1,
h2,
h3,
h4,
h5,
h6,
figure,
p,
pre {
margin: 0;
}
button {
background: transparent;
border: 0;
padding: 0;
}
fieldset {
border: 0;
margin: 0;
padding: 0;
}
iframe {
border: 0;
}
ol,
ul {
margin: 0;
list-style: none;
padding: 0;
}
/**
* Suppress the focus outline on links that cannot be accessed via keyboard.
* This prevents an unwanted focus outline from appearing around elements that
* might still respond to pointer events.
*/
[tabindex="-1"]:focus {
outline: none !important;
}
/*
* A better looking default horizontal rule
*/
hr {
box-sizing: border-box;
display: block;
height: 1px;
margin: 1.626 0;
padding: 0;
border: 0;
border-top: 1px solid var(--color-gray-vlight);
}
/*
* Remove the gap between images and the bottom of their containers: h5bp.com/i/440
*/
img {
vertical-align: middle;
max-width: 100%;
}
/* Override normalize */
input[type="search"] {
box-sizing: border-box;
}
/*
* Allow only vertical resizing of textareas.
* Reset height since textareas have rows
*/
textarea {
height: auto;
resize: vertical;
}
/* Make multiple select elements height not fixed */
select[multiple],
select[size] {
height: auto;
}
input[type='number']::-webkit-outer-spin-button,
input[type='number']::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
/* FF < 19 */
input:-moz-placeholder,
textarea:-moz-placeholder {
color: var(--color-gray);
}
/* FF >= 19 */
input::-moz-placeholder,
textarea::-moz-placeholder {
color: var(--color-gray);
}
/* IE 10 */
input:-ms-input-placeholder,
textarea:-ms-input-placeholder {
color: var(--color-gray);
}
input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {
color: var(--color-gray);
}
/**
* Hide when Angular is not yet loaded and initialized
*/
[ng-cloak] {
display: none;
}
================================================
FILE: client/assets/stylesheets/variables.css
================================================
:root {
--font-family-base: sans-serif;
--font-family-monospace: monospace;
--font-size-xxxl: 24px;
--font-size-xxl: 20px;
--font-size-xl: 18px;
--font-size-l: 16px;
--font-size-m: 15px;
--font-size-s: 14px;
--font-size-xs: 13px;
--font-size-xxs: 12px;
--font-size-xxxs: 11px;
--base-line-height: 1.625;
--color-gray-vdark: #555;
--color-gray: #A5A5A5;
--color-gray-vlight: #EEE;
--color-primary: #5092DA;
}
================================================
FILE: client/components/angular/.bower.json
================================================
{
"name": "angular",
"version": "1.3.5",
"main": "./angular.js",
"ignore": [],
"dependencies": {},
"homepage": "https://github.com/angular/bower-angular",
"_release": "1.3.5",
"_resolution": {
"type": "version",
"tag": "v1.3.5",
"commit": "9acb014af4fd7b0ab001c64fa7bcac454ab4050b"
},
"_source": "git://github.com/angular/bower-angular.git",
"_target": "1.3.5",
"_originalSource": "angular"
}
================================================
FILE: client/components/angular/README.md
================================================
# packaged angular
This repo is for distribution on `npm` and `bower`. The source for this module is in the
[main AngularJS repo](https://github.com/angular/angular.js).
Please file issues and pull requests against that repo.
## Install
You can install this package either with `npm` or with `bower`.
### npm
```shell
npm install angular
```
Then add a `
```
Note that this package is not in CommonJS format, so doing `require('angular')` will return `undefined`.
If you're using [Browserify](https://github.com/substack/node-browserify), you can use
[exposify](https://github.com/thlorenz/exposify) to have `require('angular')` return the `angular`
global.
### bower
```shell
bower install angular
```
Then add a `
```
## Documentation
Documentation is available on the
[AngularJS docs site](http://docs.angularjs.org/).
## License
The MIT License
Copyright (c) 2010-2012 Google, Inc. http://angularjs.org
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.
================================================
FILE: client/components/angular/angular-csp.css
================================================
/* Include this file in your html if you are using the CSP mode. */
@charset "UTF-8";
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak],
.ng-cloak, .x-ng-cloak,
.ng-hide:not(.ng-hide-animate) {
display: none !important;
}
ng\:form {
display: block;
}
================================================
FILE: client/components/angular/angular.js
================================================
/**
* @license AngularJS v1.3.5
* (c) 2010-2014 Google, Inc. http://angularjs.org
* License: MIT
*/
(function(window, document, undefined) {'use strict';
/**
* @description
*
* This object provides a utility for producing rich Error messages within
* Angular. It can be called as follows:
*
* var exampleMinErr = minErr('example');
* throw exampleMinErr('one', 'This {0} is {1}', foo, bar);
*
* The above creates an instance of minErr in the example namespace. The
* resulting error will have a namespaced error code of example.one. The
* resulting error will replace {0} with the value of foo, and {1} with the
* value of bar. The object is not restricted in the number of arguments it can
* take.
*
* If fewer arguments are specified than necessary for interpolation, the extra
* interpolation markers will be preserved in the final string.
*
* Since data will be parsed statically during a build step, some restrictions
* are applied with respect to how minErr instances are created and called.
* Instances should have names of the form namespaceMinErr for a minErr created
* using minErr('namespace') . Error codes, namespaces and template strings
* should all be static strings, not variables or general expressions.
*
* @param {string} module The namespace to use for the new minErr instance.
* @param {function} ErrorConstructor Custom error constructor to be instantiated when returning
* error from returned function, for cases when a particular type of error is useful.
* @returns {function(code:string, template:string, ...templateArgs): Error} minErr instance
*/
function minErr(module, ErrorConstructor) {
ErrorConstructor = ErrorConstructor || Error;
return function() {
var code = arguments[0],
prefix = '[' + (module ? module + ':' : '') + code + '] ',
template = arguments[1],
templateArgs = arguments,
message, i;
message = prefix + template.replace(/\{\d+\}/g, function(match) {
var index = +match.slice(1, -1), arg;
if (index + 2 < templateArgs.length) {
return toDebugString(templateArgs[index + 2]);
}
return match;
});
message = message + '\nhttp://errors.angularjs.org/1.3.5/' +
(module ? module + '/' : '') + code;
for (i = 2; i < arguments.length; i++) {
message = message + (i == 2 ? '?' : '&') + 'p' + (i - 2) + '=' +
encodeURIComponent(toDebugString(arguments[i]));
}
return new ErrorConstructor(message);
};
}
/* We need to tell jshint what variables are being exported */
/* global angular: true,
msie: true,
jqLite: true,
jQuery: true,
slice: true,
splice: true,
push: true,
toString: true,
ngMinErr: true,
angularModule: true,
uid: true,
REGEX_STRING_REGEXP: true,
VALIDITY_STATE_PROPERTY: true,
lowercase: true,
uppercase: true,
manualLowercase: true,
manualUppercase: true,
nodeName_: true,
isArrayLike: true,
forEach: true,
sortedKeys: true,
forEachSorted: true,
reverseParams: true,
nextUid: true,
setHashKey: true,
extend: true,
int: true,
inherit: true,
noop: true,
identity: true,
valueFn: true,
isUndefined: true,
isDefined: true,
isObject: true,
isString: true,
isNumber: true,
isDate: true,
isArray: true,
isFunction: true,
isRegExp: true,
isWindow: true,
isScope: true,
isFile: true,
isBlob: true,
isBoolean: true,
isPromiseLike: true,
trim: true,
escapeForRegexp: true,
isElement: true,
makeMap: true,
includes: true,
arrayRemove: true,
copy: true,
shallowCopy: true,
equals: true,
csp: true,
concat: true,
sliceArgs: true,
bind: true,
toJsonReplacer: true,
toJson: true,
fromJson: true,
startingTag: true,
tryDecodeURIComponent: true,
parseKeyValue: true,
toKeyValue: true,
encodeUriSegment: true,
encodeUriQuery: true,
angularInit: true,
bootstrap: true,
getTestability: true,
snake_case: true,
bindJQuery: true,
assertArg: true,
assertArgFn: true,
assertNotHasOwnProperty: true,
getter: true,
getBlockNodes: true,
hasOwnProperty: true,
createMap: true,
NODE_TYPE_ELEMENT: true,
NODE_TYPE_TEXT: true,
NODE_TYPE_COMMENT: true,
NODE_TYPE_DOCUMENT: true,
NODE_TYPE_DOCUMENT_FRAGMENT: true,
*/
////////////////////////////////////
/**
* @ngdoc module
* @name ng
* @module ng
* @description
*
* # ng (core module)
* The ng module is loaded by default when an AngularJS application is started. The module itself
* contains the essential components for an AngularJS application to function. The table below
* lists a high level breakdown of each of the services/factories, filters, directives and testing
* components available within this core module.
*
*
*/
var REGEX_STRING_REGEXP = /^\/(.+)\/([a-z]*)$/;
// The name of a form control's ValidityState property.
// This is used so that it's possible for internal tests to create mock ValidityStates.
var VALIDITY_STATE_PROPERTY = 'validity';
/**
* @ngdoc function
* @name angular.lowercase
* @module ng
* @kind function
*
* @description Converts the specified string to lowercase.
* @param {string} string String to be converted to lowercase.
* @returns {string} Lowercased string.
*/
var lowercase = function(string) {return isString(string) ? string.toLowerCase() : string;};
var hasOwnProperty = Object.prototype.hasOwnProperty;
/**
* @ngdoc function
* @name angular.uppercase
* @module ng
* @kind function
*
* @description Converts the specified string to uppercase.
* @param {string} string String to be converted to uppercase.
* @returns {string} Uppercased string.
*/
var uppercase = function(string) {return isString(string) ? string.toUpperCase() : string;};
var manualLowercase = function(s) {
/* jshint bitwise: false */
return isString(s)
? s.replace(/[A-Z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) | 32);})
: s;
};
var manualUppercase = function(s) {
/* jshint bitwise: false */
return isString(s)
? s.replace(/[a-z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) & ~32);})
: s;
};
// String#toLowerCase and String#toUpperCase don't produce correct results in browsers with Turkish
// locale, for this reason we need to detect this case and redefine lowercase/uppercase methods
// with correct but slower alternatives.
if ('i' !== 'I'.toLowerCase()) {
lowercase = manualLowercase;
uppercase = manualUppercase;
}
var
msie, // holds major version number for IE, or NaN if UA is not IE.
jqLite, // delay binding since jQuery could be loaded after us.
jQuery, // delay binding
slice = [].slice,
splice = [].splice,
push = [].push,
toString = Object.prototype.toString,
ngMinErr = minErr('ng'),
/** @name angular */
angular = window.angular || (window.angular = {}),
angularModule,
uid = 0;
/**
* documentMode is an IE-only property
* http://msdn.microsoft.com/en-us/library/ie/cc196988(v=vs.85).aspx
*/
msie = document.documentMode;
/**
* @private
* @param {*} obj
* @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments,
* String ...)
*/
function isArrayLike(obj) {
if (obj == null || isWindow(obj)) {
return false;
}
var length = obj.length;
if (obj.nodeType === NODE_TYPE_ELEMENT && length) {
return true;
}
return isString(obj) || isArray(obj) || length === 0 ||
typeof length === 'number' && length > 0 && (length - 1) in obj;
}
/**
* @ngdoc function
* @name angular.forEach
* @module ng
* @kind function
*
* @description
* Invokes the `iterator` function once for each item in `obj` collection, which can be either an
* object or an array. The `iterator` function is invoked with `iterator(value, key, obj)`, where `value`
* is the value of an object property or an array element, `key` is the object property key or
* array element index and obj is the `obj` itself. Specifying a `context` for the function is optional.
*
* It is worth noting that `.forEach` does not iterate over inherited properties because it filters
* using the `hasOwnProperty` method.
*
* Unlike ES262's
* [Array.prototype.forEach](http://www.ecma-international.org/ecma-262/5.1/#sec-15.4.4.18),
* Providing 'undefined' or 'null' values for `obj` will not throw a TypeError, but rather just
* return the value provided.
*
```js
var values = {name: 'misko', gender: 'male'};
var log = [];
angular.forEach(values, function(value, key) {
this.push(key + ': ' + value);
}, log);
expect(log).toEqual(['name: misko', 'gender: male']);
```
*
* @param {Object|Array} obj Object to iterate over.
* @param {Function} iterator Iterator function.
* @param {Object=} context Object to become context (`this`) for the iterator function.
* @returns {Object|Array} Reference to `obj`.
*/
function forEach(obj, iterator, context) {
var key, length;
if (obj) {
if (isFunction(obj)) {
for (key in obj) {
// Need to check if hasOwnProperty exists,
// as on IE8 the result of querySelectorAll is an object without a hasOwnProperty function
if (key != 'prototype' && key != 'length' && key != 'name' && (!obj.hasOwnProperty || obj.hasOwnProperty(key))) {
iterator.call(context, obj[key], key, obj);
}
}
} else if (isArray(obj) || isArrayLike(obj)) {
var isPrimitive = typeof obj !== 'object';
for (key = 0, length = obj.length; key < length; key++) {
if (isPrimitive || key in obj) {
iterator.call(context, obj[key], key, obj);
}
}
} else if (obj.forEach && obj.forEach !== forEach) {
obj.forEach(iterator, context, obj);
} else {
for (key in obj) {
if (obj.hasOwnProperty(key)) {
iterator.call(context, obj[key], key, obj);
}
}
}
}
return obj;
}
function sortedKeys(obj) {
return Object.keys(obj).sort();
}
function forEachSorted(obj, iterator, context) {
var keys = sortedKeys(obj);
for (var i = 0; i < keys.length; i++) {
iterator.call(context, obj[keys[i]], keys[i]);
}
return keys;
}
/**
* when using forEach the params are value, key, but it is often useful to have key, value.
* @param {function(string, *)} iteratorFn
* @returns {function(*, string)}
*/
function reverseParams(iteratorFn) {
return function(value, key) { iteratorFn(key, value); };
}
/**
* A consistent way of creating unique IDs in angular.
*
* Using simple numbers allows us to generate 28.6 million unique ids per second for 10 years before
* we hit number precision issues in JavaScript.
*
* Math.pow(2,53) / 60 / 60 / 24 / 365 / 10 = 28.6M
*
* @returns {number} an unique alpha-numeric string
*/
function nextUid() {
return ++uid;
}
/**
* Set or clear the hashkey for an object.
* @param obj object
* @param h the hashkey (!truthy to delete the hashkey)
*/
function setHashKey(obj, h) {
if (h) {
obj.$$hashKey = h;
}
else {
delete obj.$$hashKey;
}
}
/**
* @ngdoc function
* @name angular.extend
* @module ng
* @kind function
*
* @description
* Extends the destination object `dst` by copying own enumerable properties from the `src` object(s)
* to `dst`. You can specify multiple `src` objects. If you want to preserve original objects, you can do so
* by passing an empty object as the target: `var object = angular.extend({}, object1, object2)`.
* Note: Keep in mind that `angular.extend` does not support recursive merge (deep copy).
*
* @param {Object} dst Destination object.
* @param {...Object} src Source object(s).
* @returns {Object} Reference to `dst`.
*/
function extend(dst) {
var h = dst.$$hashKey;
for (var i = 1, ii = arguments.length; i < ii; i++) {
var obj = arguments[i];
if (obj) {
var keys = Object.keys(obj);
for (var j = 0, jj = keys.length; j < jj; j++) {
var key = keys[j];
dst[key] = obj[key];
}
}
}
setHashKey(dst, h);
return dst;
}
function int(str) {
return parseInt(str, 10);
}
function inherit(parent, extra) {
return extend(Object.create(parent), extra);
}
/**
* @ngdoc function
* @name angular.noop
* @module ng
* @kind function
*
* @description
* A function that performs no operations. This function can be useful when writing code in the
* functional style.
```js
function foo(callback) {
var result = calculateResult();
(callback || angular.noop)(result);
}
```
*/
function noop() {}
noop.$inject = [];
/**
* @ngdoc function
* @name angular.identity
* @module ng
* @kind function
*
* @description
* A function that returns its first argument. This function is useful when writing code in the
* functional style.
*
```js
function transformer(transformationFn, value) {
return (transformationFn || angular.identity)(value);
};
```
*/
function identity($) {return $;}
identity.$inject = [];
function valueFn(value) {return function() {return value;};}
/**
* @ngdoc function
* @name angular.isUndefined
* @module ng
* @kind function
*
* @description
* Determines if a reference is undefined.
*
* @param {*} value Reference to check.
* @returns {boolean} True if `value` is undefined.
*/
function isUndefined(value) {return typeof value === 'undefined';}
/**
* @ngdoc function
* @name angular.isDefined
* @module ng
* @kind function
*
* @description
* Determines if a reference is defined.
*
* @param {*} value Reference to check.
* @returns {boolean} True if `value` is defined.
*/
function isDefined(value) {return typeof value !== 'undefined';}
/**
* @ngdoc function
* @name angular.isObject
* @module ng
* @kind function
*
* @description
* Determines if a reference is an `Object`. Unlike `typeof` in JavaScript, `null`s are not
* considered to be objects. Note that JavaScript arrays are objects.
*
* @param {*} value Reference to check.
* @returns {boolean} True if `value` is an `Object` but not `null`.
*/
function isObject(value) {
// http://jsperf.com/isobject4
return value !== null && typeof value === 'object';
}
/**
* @ngdoc function
* @name angular.isString
* @module ng
* @kind function
*
* @description
* Determines if a reference is a `String`.
*
* @param {*} value Reference to check.
* @returns {boolean} True if `value` is a `String`.
*/
function isString(value) {return typeof value === 'string';}
/**
* @ngdoc function
* @name angular.isNumber
* @module ng
* @kind function
*
* @description
* Determines if a reference is a `Number`.
*
* @param {*} value Reference to check.
* @returns {boolean} True if `value` is a `Number`.
*/
function isNumber(value) {return typeof value === 'number';}
/**
* @ngdoc function
* @name angular.isDate
* @module ng
* @kind function
*
* @description
* Determines if a value is a date.
*
* @param {*} value Reference to check.
* @returns {boolean} True if `value` is a `Date`.
*/
function isDate(value) {
return toString.call(value) === '[object Date]';
}
/**
* @ngdoc function
* @name angular.isArray
* @module ng
* @kind function
*
* @description
* Determines if a reference is an `Array`.
*
* @param {*} value Reference to check.
* @returns {boolean} True if `value` is an `Array`.
*/
var isArray = Array.isArray;
/**
* @ngdoc function
* @name angular.isFunction
* @module ng
* @kind function
*
* @description
* Determines if a reference is a `Function`.
*
* @param {*} value Reference to check.
* @returns {boolean} True if `value` is a `Function`.
*/
function isFunction(value) {return typeof value === 'function';}
/**
* Determines if a value is a regular expression object.
*
* @private
* @param {*} value Reference to check.
* @returns {boolean} True if `value` is a `RegExp`.
*/
function isRegExp(value) {
return toString.call(value) === '[object RegExp]';
}
/**
* Checks if `obj` is a window object.
*
* @private
* @param {*} obj Object to check
* @returns {boolean} True if `obj` is a window obj.
*/
function isWindow(obj) {
return obj && obj.window === obj;
}
function isScope(obj) {
return obj && obj.$evalAsync && obj.$watch;
}
function isFile(obj) {
return toString.call(obj) === '[object File]';
}
function isBlob(obj) {
return toString.call(obj) === '[object Blob]';
}
function isBoolean(value) {
return typeof value === 'boolean';
}
function isPromiseLike(obj) {
return obj && isFunction(obj.then);
}
var trim = function(value) {
return isString(value) ? value.trim() : value;
};
// Copied from:
// http://docs.closure-library.googlecode.com/git/local_closure_goog_string_string.js.source.html#line1021
// Prereq: s is a string.
var escapeForRegexp = function(s) {
return s.replace(/([-()\[\]{}+?*.$\^|,:#= 0)
array.splice(index, 1);
return value;
}
/**
* @ngdoc function
* @name angular.copy
* @module ng
* @kind function
*
* @description
* Creates a deep copy of `source`, which should be an object or an array.
*
* * If no destination is supplied, a copy of the object or array is created.
* * If a destination is provided, all of its elements (for array) or properties (for objects)
* are deleted and then all elements/properties from the source are copied to it.
* * If `source` is not an object or array (inc. `null` and `undefined`), `source` is returned.
* * If `source` is identical to 'destination' an exception will be thrown.
*
* @param {*} source The source that will be used to make a copy.
* Can be any type, including primitives, `null`, and `undefined`.
* @param {(Object|Array)=} destination Destination into which the source is copied. If
* provided, must be of the same type as `source`.
* @returns {*} The copy or updated `destination`, if `destination` was specified.
*
* @example
form = {{user | json}}
master = {{master | json}}
*/
function copy(source, destination, stackSource, stackDest) {
if (isWindow(source) || isScope(source)) {
throw ngMinErr('cpws',
"Can't copy! Making copies of Window or Scope instances is not supported.");
}
if (!destination) {
destination = source;
if (source) {
if (isArray(source)) {
destination = copy(source, [], stackSource, stackDest);
} else if (isDate(source)) {
destination = new Date(source.getTime());
} else if (isRegExp(source)) {
destination = new RegExp(source.source, source.toString().match(/[^\/]*$/)[0]);
destination.lastIndex = source.lastIndex;
} else if (isObject(source)) {
var emptyObject = Object.create(Object.getPrototypeOf(source));
destination = copy(source, emptyObject, stackSource, stackDest);
}
}
} else {
if (source === destination) throw ngMinErr('cpi',
"Can't copy! Source and destination are identical.");
stackSource = stackSource || [];
stackDest = stackDest || [];
if (isObject(source)) {
var index = stackSource.indexOf(source);
if (index !== -1) return stackDest[index];
stackSource.push(source);
stackDest.push(destination);
}
var result;
if (isArray(source)) {
destination.length = 0;
for (var i = 0; i < source.length; i++) {
result = copy(source[i], null, stackSource, stackDest);
if (isObject(source[i])) {
stackSource.push(source[i]);
stackDest.push(result);
}
destination.push(result);
}
} else {
var h = destination.$$hashKey;
if (isArray(destination)) {
destination.length = 0;
} else {
forEach(destination, function(value, key) {
delete destination[key];
});
}
for (var key in source) {
if (source.hasOwnProperty(key)) {
result = copy(source[key], null, stackSource, stackDest);
if (isObject(source[key])) {
stackSource.push(source[key]);
stackDest.push(result);
}
destination[key] = result;
}
}
setHashKey(destination,h);
}
}
return destination;
}
/**
* Creates a shallow copy of an object, an array or a primitive.
*
* Assumes that there are no proto properties for objects.
*/
function shallowCopy(src, dst) {
if (isArray(src)) {
dst = dst || [];
for (var i = 0, ii = src.length; i < ii; i++) {
dst[i] = src[i];
}
} else if (isObject(src)) {
dst = dst || {};
for (var key in src) {
if (!(key.charAt(0) === '$' && key.charAt(1) === '$')) {
dst[key] = src[key];
}
}
}
return dst || src;
}
/**
* @ngdoc function
* @name angular.equals
* @module ng
* @kind function
*
* @description
* Determines if two objects or two values are equivalent. Supports value types, regular
* expressions, arrays and objects.
*
* Two objects or values are considered equivalent if at least one of the following is true:
*
* * Both objects or values pass `===` comparison.
* * Both objects or values are of the same type and all of their properties are equal by
* comparing them with `angular.equals`.
* * Both values are NaN. (In JavaScript, NaN == NaN => false. But we consider two NaN as equal)
* * Both values represent the same regular expression (In JavaScript,
* /abc/ == /abc/ => false. But we consider two regular expressions as equal when their textual
* representation matches).
*
* During a property comparison, properties of `function` type and properties with names
* that begin with `$` are ignored.
*
* Scope and DOMWindow objects are being compared only by identify (`===`).
*
* @param {*} o1 Object or value to compare.
* @param {*} o2 Object or value to compare.
* @returns {boolean} True if arguments are equal.
*/
function equals(o1, o2) {
if (o1 === o2) return true;
if (o1 === null || o2 === null) return false;
if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN
var t1 = typeof o1, t2 = typeof o2, length, key, keySet;
if (t1 == t2) {
if (t1 == 'object') {
if (isArray(o1)) {
if (!isArray(o2)) return false;
if ((length = o1.length) == o2.length) {
for (key = 0; key < length; key++) {
if (!equals(o1[key], o2[key])) return false;
}
return true;
}
} else if (isDate(o1)) {
if (!isDate(o2)) return false;
return equals(o1.getTime(), o2.getTime());
} else if (isRegExp(o1) && isRegExp(o2)) {
return o1.toString() == o2.toString();
} else {
if (isScope(o1) || isScope(o2) || isWindow(o1) || isWindow(o2) || isArray(o2)) return false;
keySet = {};
for (key in o1) {
if (key.charAt(0) === '$' || isFunction(o1[key])) continue;
if (!equals(o1[key], o2[key])) return false;
keySet[key] = true;
}
for (key in o2) {
if (!keySet.hasOwnProperty(key) &&
key.charAt(0) !== '$' &&
o2[key] !== undefined &&
!isFunction(o2[key])) return false;
}
return true;
}
}
}
return false;
}
var csp = function() {
if (isDefined(csp.isActive_)) return csp.isActive_;
var active = !!(document.querySelector('[ng-csp]') ||
document.querySelector('[data-ng-csp]'));
if (!active) {
try {
/* jshint -W031, -W054 */
new Function('');
/* jshint +W031, +W054 */
} catch (e) {
active = true;
}
}
return (csp.isActive_ = active);
};
function concat(array1, array2, index) {
return array1.concat(slice.call(array2, index));
}
function sliceArgs(args, startIndex) {
return slice.call(args, startIndex || 0);
}
/* jshint -W101 */
/**
* @ngdoc function
* @name angular.bind
* @module ng
* @kind function
*
* @description
* Returns a function which calls function `fn` bound to `self` (`self` becomes the `this` for
* `fn`). You can supply optional `args` that are prebound to the function. This feature is also
* known as [partial application](http://en.wikipedia.org/wiki/Partial_application), as
* distinguished from [function currying](http://en.wikipedia.org/wiki/Currying#Contrast_with_partial_function_application).
*
* @param {Object} self Context which `fn` should be evaluated in.
* @param {function()} fn Function to be bound.
* @param {...*} args Optional arguments to be prebound to the `fn` function call.
* @returns {function()} Function that wraps the `fn` with all the specified bindings.
*/
/* jshint +W101 */
function bind(self, fn) {
var curryArgs = arguments.length > 2 ? sliceArgs(arguments, 2) : [];
if (isFunction(fn) && !(fn instanceof RegExp)) {
return curryArgs.length
? function() {
return arguments.length
? fn.apply(self, concat(curryArgs, arguments, 0))
: fn.apply(self, curryArgs);
}
: function() {
return arguments.length
? fn.apply(self, arguments)
: fn.call(self);
};
} else {
// in IE, native methods are not functions so they cannot be bound (note: they don't need to be)
return fn;
}
}
function toJsonReplacer(key, value) {
var val = value;
if (typeof key === 'string' && key.charAt(0) === '$' && key.charAt(1) === '$') {
val = undefined;
} else if (isWindow(value)) {
val = '$WINDOW';
} else if (value && document === value) {
val = '$DOCUMENT';
} else if (isScope(value)) {
val = '$SCOPE';
}
return val;
}
/**
* @ngdoc function
* @name angular.toJson
* @module ng
* @kind function
*
* @description
* Serializes input into a JSON-formatted string. Properties with leading $$ characters will be
* stripped since angular uses this notation internally.
*
* @param {Object|Array|Date|string|number} obj Input to be serialized into JSON.
* @param {boolean=} pretty If set to true, the JSON output will contain newlines and whitespace.
* @returns {string|undefined} JSON-ified string representing `obj`.
*/
function toJson(obj, pretty) {
if (typeof obj === 'undefined') return undefined;
return JSON.stringify(obj, toJsonReplacer, pretty ? ' ' : null);
}
/**
* @ngdoc function
* @name angular.fromJson
* @module ng
* @kind function
*
* @description
* Deserializes a JSON string.
*
* @param {string} json JSON string to deserialize.
* @returns {Object|Array|string|number} Deserialized thingy.
*/
function fromJson(json) {
return isString(json)
? JSON.parse(json)
: json;
}
/**
* @returns {string} Returns the string representation of the element.
*/
function startingTag(element) {
element = jqLite(element).clone();
try {
// turns out IE does not let you set .html() on elements which
// are not allowed to have children. So we just ignore it.
element.empty();
} catch (e) {}
var elemHtml = jqLite('
').append(element).html();
try {
return element[0].nodeType === NODE_TYPE_TEXT ? lowercase(elemHtml) :
elemHtml.
match(/^(<[^>]+>)/)[1].
replace(/^<([\w\-]+)/, function(match, nodeName) { return '<' + lowercase(nodeName); });
} catch (e) {
return lowercase(elemHtml);
}
}
/////////////////////////////////////////////////
/**
* Tries to decode the URI component without throwing an exception.
*
* @private
* @param str value potential URI component to check.
* @returns {boolean} True if `value` can be decoded
* with the decodeURIComponent function.
*/
function tryDecodeURIComponent(value) {
try {
return decodeURIComponent(value);
} catch (e) {
// Ignore any invalid uri component
}
}
/**
* Parses an escaped url query string into key-value pairs.
* @returns {Object.}
*/
function parseKeyValue(/**string*/keyValue) {
var obj = {}, key_value, key;
forEach((keyValue || "").split('&'), function(keyValue) {
if (keyValue) {
key_value = keyValue.replace(/\+/g,'%20').split('=');
key = tryDecodeURIComponent(key_value[0]);
if (isDefined(key)) {
var val = isDefined(key_value[1]) ? tryDecodeURIComponent(key_value[1]) : true;
if (!hasOwnProperty.call(obj, key)) {
obj[key] = val;
} else if (isArray(obj[key])) {
obj[key].push(val);
} else {
obj[key] = [obj[key],val];
}
}
}
});
return obj;
}
function toKeyValue(obj) {
var parts = [];
forEach(obj, function(value, key) {
if (isArray(value)) {
forEach(value, function(arrayValue) {
parts.push(encodeUriQuery(key, true) +
(arrayValue === true ? '' : '=' + encodeUriQuery(arrayValue, true)));
});
} else {
parts.push(encodeUriQuery(key, true) +
(value === true ? '' : '=' + encodeUriQuery(value, true)));
}
});
return parts.length ? parts.join('&') : '';
}
/**
* We need our custom method because encodeURIComponent is too aggressive and doesn't follow
* http://www.ietf.org/rfc/rfc3986.txt with regards to the character set (pchar) allowed in path
* segments:
* segment = *pchar
* pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
* pct-encoded = "%" HEXDIG HEXDIG
* unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
* sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
* / "*" / "+" / "," / ";" / "="
*/
function encodeUriSegment(val) {
return encodeUriQuery(val, true).
replace(/%26/gi, '&').
replace(/%3D/gi, '=').
replace(/%2B/gi, '+');
}
/**
* This method is intended for encoding *key* or *value* parts of query component. We need a custom
* method because encodeURIComponent is too aggressive and encodes stuff that doesn't have to be
* encoded per http://tools.ietf.org/html/rfc3986:
* query = *( pchar / "/" / "?" )
* pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
* unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
* pct-encoded = "%" HEXDIG HEXDIG
* sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
* / "*" / "+" / "," / ";" / "="
*/
function encodeUriQuery(val, pctEncodeSpaces) {
return encodeURIComponent(val).
replace(/%40/gi, '@').
replace(/%3A/gi, ':').
replace(/%24/g, '$').
replace(/%2C/gi, ',').
replace(/%3B/gi, ';').
replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));
}
var ngAttrPrefixes = ['ng-', 'data-ng-', 'ng:', 'x-ng-'];
function getNgAttribute(element, ngAttr) {
var attr, i, ii = ngAttrPrefixes.length;
element = jqLite(element);
for (i = 0; i < ii; ++i) {
attr = ngAttrPrefixes[i] + ngAttr;
if (isString(attr = element.attr(attr))) {
return attr;
}
}
return null;
}
/**
* @ngdoc directive
* @name ngApp
* @module ng
*
* @element ANY
* @param {angular.Module} ngApp an optional application
* {@link angular.module module} name to load.
* @param {boolean=} ngStrictDi if this attribute is present on the app element, the injector will be
* created in "strict-di" mode. This means that the application will fail to invoke functions which
* do not use explicit function annotation (and are thus unsuitable for minification), as described
* in {@link guide/di the Dependency Injection guide}, and useful debugging info will assist in
* tracking down the root of these bugs.
*
* @description
*
* Use this directive to **auto-bootstrap** an AngularJS application. The `ngApp` directive
* designates the **root element** of the application and is typically placed near the root element
* of the page - e.g. on the `` or `` tags.
*
* Only one AngularJS application can be auto-bootstrapped per HTML document. The first `ngApp`
* found in the document will be used to define the root element to auto-bootstrap as an
* application. To run multiple applications in an HTML document you must manually bootstrap them using
* {@link angular.bootstrap} instead. AngularJS applications cannot be nested within each other.
*
* You can specify an **AngularJS module** to be used as the root module for the application. This
* module will be loaded into the {@link auto.$injector} when the application is bootstrapped and
* should contain the application code needed or have dependencies on other modules that will
* contain the code. See {@link angular.module} for more information.
*
* In the example below if the `ngApp` directive were not placed on the `html` element then the
* document would not be compiled, the `AppController` would not be instantiated and the `{{ a+b }}`
* would not be resolved to `3`.
*
* `ngApp` is the easiest, and most common, way to bootstrap an application.
*
I can add: {{a}} + {{b}} = {{ a+b }}
angular.module('ngAppDemo', []).controller('ngAppDemoController', function($scope) {
$scope.a = 1;
$scope.b = 2;
});
*
* Using `ngStrictDi`, you would see something like this:
*
I can add: {{a}} + {{b}} = {{ a+b }}
This renders because the controller does not fail to
instantiate, by using explicit annotation style (see
script.js for details)
Name:
Hello, {{name}}!
This renders because the controller does not fail to
instantiate, by using explicit annotation style
(see script.js for details)
I can add: {{a}} + {{b}} = {{ a+b }}
The controller could not be instantiated, due to relying
on automatic function annotations (which are disabled in
strict mode). As such, the content of this section is not
interpolated, and there should be an error in your web console.
angular.module('ngAppStrictDemo', [])
// BadController will fail to instantiate, due to relying on automatic function annotation,
// rather than an explicit annotation
.controller('BadController', function($scope) {
$scope.a = 1;
$scope.b = 2;
})
// Unlike BadController, GoodController1 and GoodController2 will not fail to be instantiated,
// due to using explicit annotations using the array style and $inject property, respectively.
.controller('GoodController1', ['$scope', function($scope) {
$scope.a = 1;
$scope.b = 2;
}])
.controller('GoodController2', GoodController2);
function GoodController2($scope) {
$scope.name = "World";
}
GoodController2.$inject = ['$scope'];
div[ng-controller] {
margin-bottom: 1em;
-webkit-border-radius: 4px;
border-radius: 4px;
border: 1px solid;
padding: .5em;
}
div[ng-controller^=Good] {
border-color: #d6e9c6;
background-color: #dff0d8;
color: #3c763d;
}
div[ng-controller^=Bad] {
border-color: #ebccd1;
background-color: #f2dede;
color: #a94442;
margin-bottom: 0;
}
*/
function angularInit(element, bootstrap) {
var appElement,
module,
config = {};
// The element `element` has priority over any other element
forEach(ngAttrPrefixes, function(prefix) {
var name = prefix + 'app';
if (!appElement && element.hasAttribute && element.hasAttribute(name)) {
appElement = element;
module = element.getAttribute(name);
}
});
forEach(ngAttrPrefixes, function(prefix) {
var name = prefix + 'app';
var candidate;
if (!appElement && (candidate = element.querySelector('[' + name.replace(':', '\\:') + ']'))) {
appElement = candidate;
module = candidate.getAttribute(name);
}
});
if (appElement) {
config.strictDi = getNgAttribute(appElement, "strict-di") !== null;
bootstrap(appElement, module ? [module] : [], config);
}
}
/**
* @ngdoc function
* @name angular.bootstrap
* @module ng
* @description
* Use this function to manually start up angular application.
*
* See: {@link guide/bootstrap Bootstrap}
*
* Note that Protractor based end-to-end tests cannot use this function to bootstrap manually.
* They must use {@link ng.directive:ngApp ngApp}.
*
* Angular will detect if it has been loaded into the browser more than once and only allow the
* first loaded script to be bootstrapped and will report a warning to the browser console for
* each of the subsequent scripts. This prevents strange results in applications, where otherwise
* multiple instances of Angular try to work on the DOM.
*
* ```html
*
*
*
*
* {{greeting}}
*
*
*
*
*
*
* ```
*
* @param {DOMElement} element DOM element which is the root of angular application.
* @param {Array=} modules an array of modules to load into the application.
* Each item in the array should be the name of a predefined module or a (DI annotated)
* function that will be invoked by the injector as a run block.
* See: {@link angular.module modules}
* @param {Object=} config an object for defining configuration options for the application. The
* following keys are supported:
*
* * `strictDi` - disable automatic function annotation for the application. This is meant to
* assist in finding bugs which break minified code. Defaults to `false`.
*
* @returns {auto.$injector} Returns the newly created injector for this app.
*/
function bootstrap(element, modules, config) {
if (!isObject(config)) config = {};
var defaultConfig = {
strictDi: false
};
config = extend(defaultConfig, config);
var doBootstrap = function() {
element = jqLite(element);
if (element.injector()) {
var tag = (element[0] === document) ? 'document' : startingTag(element);
//Encode angle brackets to prevent input from being sanitized to empty string #8683
throw ngMinErr(
'btstrpd',
"App Already Bootstrapped with this Element '{0}'",
tag.replace(/,'<').replace(/>/,'>'));
}
modules = modules || [];
modules.unshift(['$provide', function($provide) {
$provide.value('$rootElement', element);
}]);
if (config.debugInfoEnabled) {
// Pushing so that this overrides `debugInfoEnabled` setting defined in user's `modules`.
modules.push(['$compileProvider', function($compileProvider) {
$compileProvider.debugInfoEnabled(true);
}]);
}
modules.unshift('ng');
var injector = createInjector(modules, config.strictDi);
injector.invoke(['$rootScope', '$rootElement', '$compile', '$injector',
function bootstrapApply(scope, element, compile, injector) {
scope.$apply(function() {
element.data('$injector', injector);
compile(element)(scope);
});
}]
);
return injector;
};
var NG_ENABLE_DEBUG_INFO = /^NG_ENABLE_DEBUG_INFO!/;
var NG_DEFER_BOOTSTRAP = /^NG_DEFER_BOOTSTRAP!/;
if (window && NG_ENABLE_DEBUG_INFO.test(window.name)) {
config.debugInfoEnabled = true;
window.name = window.name.replace(NG_ENABLE_DEBUG_INFO, '');
}
if (window && !NG_DEFER_BOOTSTRAP.test(window.name)) {
return doBootstrap();
}
window.name = window.name.replace(NG_DEFER_BOOTSTRAP, '');
angular.resumeBootstrap = function(extraModules) {
forEach(extraModules, function(module) {
modules.push(module);
});
doBootstrap();
};
}
/**
* @ngdoc function
* @name angular.reloadWithDebugInfo
* @module ng
* @description
* Use this function to reload the current application with debug information turned on.
* This takes precedence over a call to `$compileProvider.debugInfoEnabled(false)`.
*
* See {@link ng.$compileProvider#debugInfoEnabled} for more.
*/
function reloadWithDebugInfo() {
window.name = 'NG_ENABLE_DEBUG_INFO!' + window.name;
window.location.reload();
}
/**
* @name angular.getTestability
* @module ng
* @description
* Get the testability service for the instance of Angular on the given
* element.
* @param {DOMElement} element DOM element which is the root of angular application.
*/
function getTestability(rootElement) {
return angular.element(rootElement).injector().get('$$testability');
}
var SNAKE_CASE_REGEXP = /[A-Z]/g;
function snake_case(name, separator) {
separator = separator || '_';
return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {
return (pos ? separator : '') + letter.toLowerCase();
});
}
var bindJQueryFired = false;
var skipDestroyOnNextJQueryCleanData;
function bindJQuery() {
var originalCleanData;
if (bindJQueryFired) {
return;
}
// bind to jQuery if present;
jQuery = window.jQuery;
// Use jQuery if it exists with proper functionality, otherwise default to us.
// Angular 1.2+ requires jQuery 1.7+ for on()/off() support.
// Angular 1.3+ technically requires at least jQuery 2.1+ but it may work with older
// versions. It will not work for sure with jQuery <1.7, though.
if (jQuery && jQuery.fn.on) {
jqLite = jQuery;
extend(jQuery.fn, {
scope: JQLitePrototype.scope,
isolateScope: JQLitePrototype.isolateScope,
controller: JQLitePrototype.controller,
injector: JQLitePrototype.injector,
inheritedData: JQLitePrototype.inheritedData
});
// All nodes removed from the DOM via various jQuery APIs like .remove()
// are passed through jQuery.cleanData. Monkey-patch this method to fire
// the $destroy event on all removed nodes.
originalCleanData = jQuery.cleanData;
jQuery.cleanData = function(elems) {
var events;
if (!skipDestroyOnNextJQueryCleanData) {
for (var i = 0, elem; (elem = elems[i]) != null; i++) {
events = jQuery._data(elem, "events");
if (events && events.$destroy) {
jQuery(elem).triggerHandler('$destroy');
}
}
} else {
skipDestroyOnNextJQueryCleanData = false;
}
originalCleanData(elems);
};
} else {
jqLite = JQLite;
}
angular.element = jqLite;
// Prevent double-proxying.
bindJQueryFired = true;
}
/**
* throw error if the argument is falsy.
*/
function assertArg(arg, name, reason) {
if (!arg) {
throw ngMinErr('areq', "Argument '{0}' is {1}", (name || '?'), (reason || "required"));
}
return arg;
}
function assertArgFn(arg, name, acceptArrayAnnotation) {
if (acceptArrayAnnotation && isArray(arg)) {
arg = arg[arg.length - 1];
}
assertArg(isFunction(arg), name, 'not a function, got ' +
(arg && typeof arg === 'object' ? arg.constructor.name || 'Object' : typeof arg));
return arg;
}
/**
* throw error if the name given is hasOwnProperty
* @param {String} name the name to test
* @param {String} context the context in which the name is used, such as module or directive
*/
function assertNotHasOwnProperty(name, context) {
if (name === 'hasOwnProperty') {
throw ngMinErr('badname', "hasOwnProperty is not a valid {0} name", context);
}
}
/**
* Return the value accessible from the object by path. Any undefined traversals are ignored
* @param {Object} obj starting object
* @param {String} path path to traverse
* @param {boolean} [bindFnToScope=true]
* @returns {Object} value as accessible by path
*/
//TODO(misko): this function needs to be removed
function getter(obj, path, bindFnToScope) {
if (!path) return obj;
var keys = path.split('.');
var key;
var lastInstance = obj;
var len = keys.length;
for (var i = 0; i < len; i++) {
key = keys[i];
if (obj) {
obj = (lastInstance = obj)[key];
}
}
if (!bindFnToScope && isFunction(obj)) {
return bind(lastInstance, obj);
}
return obj;
}
/**
* Return the DOM siblings between the first and last node in the given array.
* @param {Array} array like object
* @returns {jqLite} jqLite collection containing the nodes
*/
function getBlockNodes(nodes) {
// TODO(perf): just check if all items in `nodes` are siblings and if they are return the original
// collection, otherwise update the original collection.
var node = nodes[0];
var endNode = nodes[nodes.length - 1];
var blockNodes = [node];
do {
node = node.nextSibling;
if (!node) break;
blockNodes.push(node);
} while (node !== endNode);
return jqLite(blockNodes);
}
/**
* Creates a new object without a prototype. This object is useful for lookup without having to
* guard against prototypically inherited properties via hasOwnProperty.
*
* Related micro-benchmarks:
* - http://jsperf.com/object-create2
* - http://jsperf.com/proto-map-lookup/2
* - http://jsperf.com/for-in-vs-object-keys2
*
* @returns {Object}
*/
function createMap() {
return Object.create(null);
}
var NODE_TYPE_ELEMENT = 1;
var NODE_TYPE_TEXT = 3;
var NODE_TYPE_COMMENT = 8;
var NODE_TYPE_DOCUMENT = 9;
var NODE_TYPE_DOCUMENT_FRAGMENT = 11;
/**
* @ngdoc type
* @name angular.Module
* @module ng
* @description
*
* Interface for configuring angular {@link angular.module modules}.
*/
function setupModuleLoader(window) {
var $injectorMinErr = minErr('$injector');
var ngMinErr = minErr('ng');
function ensure(obj, name, factory) {
return obj[name] || (obj[name] = factory());
}
var angular = ensure(window, 'angular', Object);
// We need to expose `angular.$$minErr` to modules such as `ngResource` that reference it during bootstrap
angular.$$minErr = angular.$$minErr || minErr;
return ensure(angular, 'module', function() {
/** @type {Object.} */
var modules = {};
/**
* @ngdoc function
* @name angular.module
* @module ng
* @description
*
* The `angular.module` is a global place for creating, registering and retrieving Angular
* modules.
* All modules (angular core or 3rd party) that should be available to an application must be
* registered using this mechanism.
*
* When passed two or more arguments, a new module is created. If passed only one argument, an
* existing module (the name passed as the first argument to `module`) is retrieved.
*
*
* # Module
*
* A module is a collection of services, directives, controllers, filters, and configuration information.
* `angular.module` is used to configure the {@link auto.$injector $injector}.
*
* ```js
* // Create a new module
* var myModule = angular.module('myModule', []);
*
* // register a new service
* myModule.value('appName', 'MyCoolApp');
*
* // configure existing services inside initialization blocks.
* myModule.config(['$locationProvider', function($locationProvider) {
* // Configure existing providers
* $locationProvider.hashPrefix('!');
* }]);
* ```
*
* Then you can create an injector and load your modules like this:
*
* ```js
* var injector = angular.injector(['ng', 'myModule'])
* ```
*
* However it's more likely that you'll just use
* {@link ng.directive:ngApp ngApp} or
* {@link angular.bootstrap} to simplify this process for you.
*
* @param {!string} name The name of the module to create or retrieve.
* @param {!Array.=} requires If specified then new module is being created. If
* unspecified then the module is being retrieved for further configuration.
* @param {Function=} configFn Optional configuration function for the module. Same as
* {@link angular.Module#config Module#config()}.
* @returns {module} new module with the {@link angular.Module} api.
*/
return function module(name, requires, configFn) {
var assertNotHasOwnProperty = function(name, context) {
if (name === 'hasOwnProperty') {
throw ngMinErr('badname', 'hasOwnProperty is not a valid {0} name', context);
}
};
assertNotHasOwnProperty(name, 'module');
if (requires && modules.hasOwnProperty(name)) {
modules[name] = null;
}
return ensure(modules, name, function() {
if (!requires) {
throw $injectorMinErr('nomod', "Module '{0}' is not available! You either misspelled " +
"the module name or forgot to load it. If registering a module ensure that you " +
"specify the dependencies as the second argument.", name);
}
/** @type {!Array.>} */
var invokeQueue = [];
/** @type {!Array.} */
var configBlocks = [];
/** @type {!Array.} */
var runBlocks = [];
var config = invokeLater('$injector', 'invoke', 'push', configBlocks);
/** @type {angular.Module} */
var moduleInstance = {
// Private state
_invokeQueue: invokeQueue,
_configBlocks: configBlocks,
_runBlocks: runBlocks,
/**
* @ngdoc property
* @name angular.Module#requires
* @module ng
*
* @description
* Holds the list of modules which the injector will load before the current module is
* loaded.
*/
requires: requires,
/**
* @ngdoc property
* @name angular.Module#name
* @module ng
*
* @description
* Name of the module.
*/
name: name,
/**
* @ngdoc method
* @name angular.Module#provider
* @module ng
* @param {string} name service name
* @param {Function} providerType Construction function for creating new instance of the
* service.
* @description
* See {@link auto.$provide#provider $provide.provider()}.
*/
provider: invokeLater('$provide', 'provider'),
/**
* @ngdoc method
* @name angular.Module#factory
* @module ng
* @param {string} name service name
* @param {Function} providerFunction Function for creating new instance of the service.
* @description
* See {@link auto.$provide#factory $provide.factory()}.
*/
factory: invokeLater('$provide', 'factory'),
/**
* @ngdoc method
* @name angular.Module#service
* @module ng
* @param {string} name service name
* @param {Function} constructor A constructor function that will be instantiated.
* @description
* See {@link auto.$provide#service $provide.service()}.
*/
service: invokeLater('$provide', 'service'),
/**
* @ngdoc method
* @name angular.Module#value
* @module ng
* @param {string} name service name
* @param {*} object Service instance object.
* @description
* See {@link auto.$provide#value $provide.value()}.
*/
value: invokeLater('$provide', 'value'),
/**
* @ngdoc method
* @name angular.Module#constant
* @module ng
* @param {string} name constant name
* @param {*} object Constant value.
* @description
* Because the constant are fixed, they get applied before other provide methods.
* See {@link auto.$provide#constant $provide.constant()}.
*/
constant: invokeLater('$provide', 'constant', 'unshift'),
/**
* @ngdoc method
* @name angular.Module#animation
* @module ng
* @param {string} name animation name
* @param {Function} animationFactory Factory function for creating new instance of an
* animation.
* @description
*
* **NOTE**: animations take effect only if the **ngAnimate** module is loaded.
*
*
* Defines an animation hook that can be later used with
* {@link ngAnimate.$animate $animate} service and directives that use this service.
*
* ```js
* module.animation('.animation-name', function($inject1, $inject2) {
* return {
* eventName : function(element, done) {
* //code to run the animation
* //once complete, then run done()
* return function cancellationFunction(element) {
* //code to cancel the animation
* }
* }
* }
* })
* ```
*
* See {@link ng.$animateProvider#register $animateProvider.register()} and
* {@link ngAnimate ngAnimate module} for more information.
*/
animation: invokeLater('$animateProvider', 'register'),
/**
* @ngdoc method
* @name angular.Module#filter
* @module ng
* @param {string} name Filter name.
* @param {Function} filterFactory Factory function for creating new instance of filter.
* @description
* See {@link ng.$filterProvider#register $filterProvider.register()}.
*/
filter: invokeLater('$filterProvider', 'register'),
/**
* @ngdoc method
* @name angular.Module#controller
* @module ng
* @param {string|Object} name Controller name, or an object map of controllers where the
* keys are the names and the values are the constructors.
* @param {Function} constructor Controller constructor function.
* @description
* See {@link ng.$controllerProvider#register $controllerProvider.register()}.
*/
controller: invokeLater('$controllerProvider', 'register'),
/**
* @ngdoc method
* @name angular.Module#directive
* @module ng
* @param {string|Object} name Directive name, or an object map of directives where the
* keys are the names and the values are the factories.
* @param {Function} directiveFactory Factory function for creating new instance of
* directives.
* @description
* See {@link ng.$compileProvider#directive $compileProvider.directive()}.
*/
directive: invokeLater('$compileProvider', 'directive'),
/**
* @ngdoc method
* @name angular.Module#config
* @module ng
* @param {Function} configFn Execute this function on module load. Useful for service
* configuration.
* @description
* Use this method to register work which needs to be performed on module loading.
* For more about how to configure services, see
* {@link providers#provider-recipe Provider Recipe}.
*/
config: config,
/**
* @ngdoc method
* @name angular.Module#run
* @module ng
* @param {Function} initializationFn Execute this function after injector creation.
* Useful for application initialization.
* @description
* Use this method to register work which should be performed when the injector is done
* loading all modules.
*/
run: function(block) {
runBlocks.push(block);
return this;
}
};
if (configFn) {
config(configFn);
}
return moduleInstance;
/**
* @param {string} provider
* @param {string} method
* @param {String=} insertMethod
* @returns {angular.Module}
*/
function invokeLater(provider, method, insertMethod, queue) {
if (!queue) queue = invokeQueue;
return function() {
queue[insertMethod || 'push']([provider, method, arguments]);
return moduleInstance;
};
}
});
};
});
}
/* global: toDebugString: true */
function serializeObject(obj) {
var seen = [];
return JSON.stringify(obj, function(key, val) {
val = toJsonReplacer(key, val);
if (isObject(val)) {
if (seen.indexOf(val) >= 0) return '<>';
seen.push(val);
}
return val;
});
}
function toDebugString(obj) {
if (typeof obj === 'function') {
return obj.toString().replace(/ \{[\s\S]*$/, '');
} else if (typeof obj === 'undefined') {
return 'undefined';
} else if (typeof obj !== 'string') {
return serializeObject(obj);
}
return obj;
}
/* global angularModule: true,
version: true,
$LocaleProvider,
$CompileProvider,
htmlAnchorDirective,
inputDirective,
inputDirective,
formDirective,
scriptDirective,
selectDirective,
styleDirective,
optionDirective,
ngBindDirective,
ngBindHtmlDirective,
ngBindTemplateDirective,
ngClassDirective,
ngClassEvenDirective,
ngClassOddDirective,
ngCspDirective,
ngCloakDirective,
ngControllerDirective,
ngFormDirective,
ngHideDirective,
ngIfDirective,
ngIncludeDirective,
ngIncludeFillContentDirective,
ngInitDirective,
ngNonBindableDirective,
ngPluralizeDirective,
ngRepeatDirective,
ngShowDirective,
ngStyleDirective,
ngSwitchDirective,
ngSwitchWhenDirective,
ngSwitchDefaultDirective,
ngOptionsDirective,
ngTranscludeDirective,
ngModelDirective,
ngListDirective,
ngChangeDirective,
patternDirective,
patternDirective,
requiredDirective,
requiredDirective,
minlengthDirective,
minlengthDirective,
maxlengthDirective,
maxlengthDirective,
ngValueDirective,
ngModelOptionsDirective,
ngAttributeAliasDirectives,
ngEventDirectives,
$AnchorScrollProvider,
$AnimateProvider,
$BrowserProvider,
$CacheFactoryProvider,
$ControllerProvider,
$DocumentProvider,
$ExceptionHandlerProvider,
$FilterProvider,
$InterpolateProvider,
$IntervalProvider,
$HttpProvider,
$HttpBackendProvider,
$LocationProvider,
$LogProvider,
$ParseProvider,
$RootScopeProvider,
$QProvider,
$$QProvider,
$$SanitizeUriProvider,
$SceProvider,
$SceDelegateProvider,
$SnifferProvider,
$TemplateCacheProvider,
$TemplateRequestProvider,
$$TestabilityProvider,
$TimeoutProvider,
$$RAFProvider,
$$AsyncCallbackProvider,
$WindowProvider
*/
/**
* @ngdoc object
* @name angular.version
* @module ng
* @description
* An object that contains information about the current AngularJS version. This object has the
* following properties:
*
* - `full` – `{string}` – Full version string, such as "0.9.18".
* - `major` – `{number}` – Major version number, such as "0".
* - `minor` – `{number}` – Minor version number, such as "9".
* - `dot` – `{number}` – Dot version number, such as "18".
* - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat".
*/
var version = {
full: '1.3.5', // all of these placeholder strings will be replaced by grunt's
major: 1, // package task
minor: 3,
dot: 5,
codeName: 'cybernetic-mercantilism'
};
function publishExternalAPI(angular) {
extend(angular, {
'bootstrap': bootstrap,
'copy': copy,
'extend': extend,
'equals': equals,
'element': jqLite,
'forEach': forEach,
'injector': createInjector,
'noop': noop,
'bind': bind,
'toJson': toJson,
'fromJson': fromJson,
'identity': identity,
'isUndefined': isUndefined,
'isDefined': isDefined,
'isString': isString,
'isFunction': isFunction,
'isObject': isObject,
'isNumber': isNumber,
'isElement': isElement,
'isArray': isArray,
'version': version,
'isDate': isDate,
'lowercase': lowercase,
'uppercase': uppercase,
'callbacks': {counter: 0},
'getTestability': getTestability,
'$$minErr': minErr,
'$$csp': csp,
'reloadWithDebugInfo': reloadWithDebugInfo
});
angularModule = setupModuleLoader(window);
try {
angularModule('ngLocale');
} catch (e) {
angularModule('ngLocale', []).provider('$locale', $LocaleProvider);
}
angularModule('ng', ['ngLocale'], ['$provide',
function ngModule($provide) {
// $$sanitizeUriProvider needs to be before $compileProvider as it is used by it.
$provide.provider({
$$sanitizeUri: $$SanitizeUriProvider
});
$provide.provider('$compile', $CompileProvider).
directive({
a: htmlAnchorDirective,
input: inputDirective,
textarea: inputDirective,
form: formDirective,
script: scriptDirective,
select: selectDirective,
style: styleDirective,
option: optionDirective,
ngBind: ngBindDirective,
ngBindHtml: ngBindHtmlDirective,
ngBindTemplate: ngBindTemplateDirective,
ngClass: ngClassDirective,
ngClassEven: ngClassEvenDirective,
ngClassOdd: ngClassOddDirective,
ngCloak: ngCloakDirective,
ngController: ngControllerDirective,
ngForm: ngFormDirective,
ngHide: ngHideDirective,
ngIf: ngIfDirective,
ngInclude: ngIncludeDirective,
ngInit: ngInitDirective,
ngNonBindable: ngNonBindableDirective,
ngPluralize: ngPluralizeDirective,
ngRepeat: ngRepeatDirective,
ngShow: ngShowDirective,
ngStyle: ngStyleDirective,
ngSwitch: ngSwitchDirective,
ngSwitchWhen: ngSwitchWhenDirective,
ngSwitchDefault: ngSwitchDefaultDirective,
ngOptions: ngOptionsDirective,
ngTransclude: ngTranscludeDirective,
ngModel: ngModelDirective,
ngList: ngListDirective,
ngChange: ngChangeDirective,
pattern: patternDirective,
ngPattern: patternDirective,
required: requiredDirective,
ngRequired: requiredDirective,
minlength: minlengthDirective,
ngMinlength: minlengthDirective,
maxlength: maxlengthDirective,
ngMaxlength: maxlengthDirective,
ngValue: ngValueDirective,
ngModelOptions: ngModelOptionsDirective
}).
directive({
ngInclude: ngIncludeFillContentDirective
}).
directive(ngAttributeAliasDirectives).
directive(ngEventDirectives);
$provide.provider({
$anchorScroll: $AnchorScrollProvider,
$animate: $AnimateProvider,
$browser: $BrowserProvider,
$cacheFactory: $CacheFactoryProvider,
$controller: $ControllerProvider,
$document: $DocumentProvider,
$exceptionHandler: $ExceptionHandlerProvider,
$filter: $FilterProvider,
$interpolate: $InterpolateProvider,
$interval: $IntervalProvider,
$http: $HttpProvider,
$httpBackend: $HttpBackendProvider,
$location: $LocationProvider,
$log: $LogProvider,
$parse: $ParseProvider,
$rootScope: $RootScopeProvider,
$q: $QProvider,
$$q: $$QProvider,
$sce: $SceProvider,
$sceDelegate: $SceDelegateProvider,
$sniffer: $SnifferProvider,
$templateCache: $TemplateCacheProvider,
$templateRequest: $TemplateRequestProvider,
$$testability: $$TestabilityProvider,
$timeout: $TimeoutProvider,
$window: $WindowProvider,
$$rAF: $$RAFProvider,
$$asyncCallback: $$AsyncCallbackProvider
});
}
]);
}
/* global JQLitePrototype: true,
addEventListenerFn: true,
removeEventListenerFn: true,
BOOLEAN_ATTR: true,
ALIASED_ATTR: true,
*/
//////////////////////////////////
//JQLite
//////////////////////////////////
/**
* @ngdoc function
* @name angular.element
* @module ng
* @kind function
*
* @description
* Wraps a raw DOM element or HTML string as a [jQuery](http://jquery.com) element.
*
* If jQuery is available, `angular.element` is an alias for the
* [jQuery](http://api.jquery.com/jQuery/) function. If jQuery is not available, `angular.element`
* delegates to Angular's built-in subset of jQuery, called "jQuery lite" or "jqLite."
*
*
jqLite is a tiny, API-compatible subset of jQuery that allows
* Angular to manipulate the DOM in a cross-browser compatible way. **jqLite** implements only the most
* commonly needed functionality with the goal of having a very small footprint.
*
* To use jQuery, simply load it before `DOMContentLoaded` event fired.
*
*
**Note:** all element references in Angular are always wrapped with jQuery or
* jqLite; they are never raw DOM references.
*
* ## Angular's jqLite
* jqLite provides only the following jQuery methods:
*
* - [`addClass()`](http://api.jquery.com/addClass/)
* - [`after()`](http://api.jquery.com/after/)
* - [`append()`](http://api.jquery.com/append/)
* - [`attr()`](http://api.jquery.com/attr/) - Does not support functions as parameters
* - [`bind()`](http://api.jquery.com/bind/) - Does not support namespaces, selectors or eventData
* - [`children()`](http://api.jquery.com/children/) - Does not support selectors
* - [`clone()`](http://api.jquery.com/clone/)
* - [`contents()`](http://api.jquery.com/contents/)
* - [`css()`](http://api.jquery.com/css/) - Only retrieves inline-styles, does not call `getComputedStyle()`
* - [`data()`](http://api.jquery.com/data/)
* - [`detach()`](http://api.jquery.com/detach/)
* - [`empty()`](http://api.jquery.com/empty/)
* - [`eq()`](http://api.jquery.com/eq/)
* - [`find()`](http://api.jquery.com/find/) - Limited to lookups by tag name
* - [`hasClass()`](http://api.jquery.com/hasClass/)
* - [`html()`](http://api.jquery.com/html/)
* - [`next()`](http://api.jquery.com/next/) - Does not support selectors
* - [`on()`](http://api.jquery.com/on/) - Does not support namespaces, selectors or eventData
* - [`off()`](http://api.jquery.com/off/) - Does not support namespaces or selectors
* - [`one()`](http://api.jquery.com/one/) - Does not support namespaces or selectors
* - [`parent()`](http://api.jquery.com/parent/) - Does not support selectors
* - [`prepend()`](http://api.jquery.com/prepend/)
* - [`prop()`](http://api.jquery.com/prop/)
* - [`ready()`](http://api.jquery.com/ready/)
* - [`remove()`](http://api.jquery.com/remove/)
* - [`removeAttr()`](http://api.jquery.com/removeAttr/)
* - [`removeClass()`](http://api.jquery.com/removeClass/)
* - [`removeData()`](http://api.jquery.com/removeData/)
* - [`replaceWith()`](http://api.jquery.com/replaceWith/)
* - [`text()`](http://api.jquery.com/text/)
* - [`toggleClass()`](http://api.jquery.com/toggleClass/)
* - [`triggerHandler()`](http://api.jquery.com/triggerHandler/) - Passes a dummy event object to handlers.
* - [`unbind()`](http://api.jquery.com/unbind/) - Does not support namespaces
* - [`val()`](http://api.jquery.com/val/)
* - [`wrap()`](http://api.jquery.com/wrap/)
*
* ## jQuery/jqLite Extras
* Angular also provides the following additional methods and events to both jQuery and jqLite:
*
* ### Events
* - `$destroy` - AngularJS intercepts all jqLite/jQuery's DOM destruction apis and fires this event
* on all DOM nodes being removed. This can be used to clean up any 3rd party bindings to the DOM
* element before it is removed.
*
* ### Methods
* - `controller(name)` - retrieves the controller of the current element or its parent. By default
* retrieves controller associated with the `ngController` directive. If `name` is provided as
* camelCase directive name, then the controller for this directive will be retrieved (e.g.
* `'ngModel'`).
* - `injector()` - retrieves the injector of the current element or its parent.
* - `scope()` - retrieves the {@link ng.$rootScope.Scope scope} of the current
* element or its parent. Requires {@link guide/production#disabling-debug-data Debug Data} to
* be enabled.
* - `isolateScope()` - retrieves an isolate {@link ng.$rootScope.Scope scope} if one is attached directly to the
* current element. This getter should be used only on elements that contain a directive which starts a new isolate
* scope. Calling `scope()` on this element always returns the original non-isolate scope.
* Requires {@link guide/production#disabling-debug-data Debug Data} to be enabled.
* - `inheritedData()` - same as `data()`, but walks up the DOM until a value is found or the top
* parent element is reached.
*
* @param {string|DOMElement} element HTML string or DOMElement to be wrapped into jQuery.
* @returns {Object} jQuery object.
*/
JQLite.expando = 'ng339';
var jqCache = JQLite.cache = {},
jqId = 1,
addEventListenerFn = function(element, type, fn) {
element.addEventListener(type, fn, false);
},
removeEventListenerFn = function(element, type, fn) {
element.removeEventListener(type, fn, false);
};
/*
* !!! This is an undocumented "private" function !!!
*/
JQLite._data = function(node) {
//jQuery always returns an object on cache miss
return this.cache[node[this.expando]] || {};
};
function jqNextId() { return ++jqId; }
var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
var MOZ_HACK_REGEXP = /^moz([A-Z])/;
var MOUSE_EVENT_MAP= { mouseleave: "mouseout", mouseenter: "mouseover"};
var jqLiteMinErr = minErr('jqLite');
/**
* Converts snake_case to camelCase.
* Also there is special case for Moz prefix starting with upper case letter.
* @param name Name to normalize
*/
function camelCase(name) {
return name.
replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) {
return offset ? letter.toUpperCase() : letter;
}).
replace(MOZ_HACK_REGEXP, 'Moz$1');
}
var SINGLE_TAG_REGEXP = /^<(\w+)\s*\/?>(?:<\/\1>|)$/;
var HTML_REGEXP = /<|?\w+;/;
var TAG_NAME_REGEXP = /<([\w:]+)/;
var XHTML_TAG_REGEXP = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi;
var wrapMap = {
'option': [1, ''],
'thead': [1, '
', '
'],
'col': [2, '
', '
'],
'tr': [2, '
', '
'],
'td': [3, '
', '
'],
'_default': [0, "", ""]
};
wrapMap.optgroup = wrapMap.option;
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
wrapMap.th = wrapMap.td;
function jqLiteIsTextNode(html) {
return !HTML_REGEXP.test(html);
}
function jqLiteAcceptsData(node) {
// The window object can accept data but has no nodeType
// Otherwise we are only interested in elements (1) and documents (9)
var nodeType = node.nodeType;
return nodeType === NODE_TYPE_ELEMENT || !nodeType || nodeType === NODE_TYPE_DOCUMENT;
}
function jqLiteBuildFragment(html, context) {
var tmp, tag, wrap,
fragment = context.createDocumentFragment(),
nodes = [], i;
if (jqLiteIsTextNode(html)) {
// Convert non-html into a text node
nodes.push(context.createTextNode(html));
} else {
// Convert html into DOM nodes
tmp = tmp || fragment.appendChild(context.createElement("div"));
tag = (TAG_NAME_REGEXP.exec(html) || ["", ""])[1].toLowerCase();
wrap = wrapMap[tag] || wrapMap._default;
tmp.innerHTML = wrap[1] + html.replace(XHTML_TAG_REGEXP, "<$1>$2>") + wrap[2];
// Descend through wrappers to the right content
i = wrap[0];
while (i--) {
tmp = tmp.lastChild;
}
nodes = concat(nodes, tmp.childNodes);
tmp = fragment.firstChild;
tmp.textContent = "";
}
// Remove wrapper from fragment
fragment.textContent = "";
fragment.innerHTML = ""; // Clear inner HTML
forEach(nodes, function(node) {
fragment.appendChild(node);
});
return fragment;
}
function jqLiteParseHTML(html, context) {
context = context || document;
var parsed;
if ((parsed = SINGLE_TAG_REGEXP.exec(html))) {
return [context.createElement(parsed[1])];
}
if ((parsed = jqLiteBuildFragment(html, context))) {
return parsed.childNodes;
}
return [];
}
/////////////////////////////////////////////
function JQLite(element) {
if (element instanceof JQLite) {
return element;
}
var argIsString;
if (isString(element)) {
element = trim(element);
argIsString = true;
}
if (!(this instanceof JQLite)) {
if (argIsString && element.charAt(0) != '<') {
throw jqLiteMinErr('nosel', 'Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element');
}
return new JQLite(element);
}
if (argIsString) {
jqLiteAddNodes(this, jqLiteParseHTML(element));
} else {
jqLiteAddNodes(this, element);
}
}
function jqLiteClone(element) {
return element.cloneNode(true);
}
function jqLiteDealoc(element, onlyDescendants) {
if (!onlyDescendants) jqLiteRemoveData(element);
if (element.querySelectorAll) {
var descendants = element.querySelectorAll('*');
for (var i = 0, l = descendants.length; i < l; i++) {
jqLiteRemoveData(descendants[i]);
}
}
}
function jqLiteOff(element, type, fn, unsupported) {
if (isDefined(unsupported)) throw jqLiteMinErr('offargs', 'jqLite#off() does not support the `selector` argument');
var expandoStore = jqLiteExpandoStore(element);
var events = expandoStore && expandoStore.events;
var handle = expandoStore && expandoStore.handle;
if (!handle) return; //no listeners registered
if (!type) {
for (type in events) {
if (type !== '$destroy') {
removeEventListenerFn(element, type, handle);
}
delete events[type];
}
} else {
forEach(type.split(' '), function(type) {
if (isDefined(fn)) {
var listenerFns = events[type];
arrayRemove(listenerFns || [], fn);
if (listenerFns && listenerFns.length > 0) {
return;
}
}
removeEventListenerFn(element, type, handle);
delete events[type];
});
}
}
function jqLiteRemoveData(element, name) {
var expandoId = element.ng339;
var expandoStore = expandoId && jqCache[expandoId];
if (expandoStore) {
if (name) {
delete expandoStore.data[name];
return;
}
if (expandoStore.handle) {
if (expandoStore.events.$destroy) {
expandoStore.handle({}, '$destroy');
}
jqLiteOff(element);
}
delete jqCache[expandoId];
element.ng339 = undefined; // don't delete DOM expandos. IE and Chrome don't like it
}
}
function jqLiteExpandoStore(element, createIfNecessary) {
var expandoId = element.ng339,
expandoStore = expandoId && jqCache[expandoId];
if (createIfNecessary && !expandoStore) {
element.ng339 = expandoId = jqNextId();
expandoStore = jqCache[expandoId] = {events: {}, data: {}, handle: undefined};
}
return expandoStore;
}
function jqLiteData(element, key, value) {
if (jqLiteAcceptsData(element)) {
var isSimpleSetter = isDefined(value);
var isSimpleGetter = !isSimpleSetter && key && !isObject(key);
var massGetter = !key;
var expandoStore = jqLiteExpandoStore(element, !isSimpleGetter);
var data = expandoStore && expandoStore.data;
if (isSimpleSetter) { // data('key', value)
data[key] = value;
} else {
if (massGetter) { // data()
return data;
} else {
if (isSimpleGetter) { // data('key')
// don't force creation of expandoStore if it doesn't exist yet
return data && data[key];
} else { // mass-setter: data({key1: val1, key2: val2})
extend(data, key);
}
}
}
}
}
function jqLiteHasClass(element, selector) {
if (!element.getAttribute) return false;
return ((" " + (element.getAttribute('class') || '') + " ").replace(/[\n\t]/g, " ").
indexOf(" " + selector + " ") > -1);
}
function jqLiteRemoveClass(element, cssClasses) {
if (cssClasses && element.setAttribute) {
forEach(cssClasses.split(' '), function(cssClass) {
element.setAttribute('class', trim(
(" " + (element.getAttribute('class') || '') + " ")
.replace(/[\n\t]/g, " ")
.replace(" " + trim(cssClass) + " ", " "))
);
});
}
}
function jqLiteAddClass(element, cssClasses) {
if (cssClasses && element.setAttribute) {
var existingClasses = (' ' + (element.getAttribute('class') || '') + ' ')
.replace(/[\n\t]/g, " ");
forEach(cssClasses.split(' '), function(cssClass) {
cssClass = trim(cssClass);
if (existingClasses.indexOf(' ' + cssClass + ' ') === -1) {
existingClasses += cssClass + ' ';
}
});
element.setAttribute('class', trim(existingClasses));
}
}
function jqLiteAddNodes(root, elements) {
// THIS CODE IS VERY HOT. Don't make changes without benchmarking.
if (elements) {
// if a Node (the most common case)
if (elements.nodeType) {
root[root.length++] = elements;
} else {
var length = elements.length;
// if an Array or NodeList and not a Window
if (typeof length === 'number' && elements.window !== elements) {
if (length) {
for (var i = 0; i < length; i++) {
root[root.length++] = elements[i];
}
}
} else {
root[root.length++] = elements;
}
}
}
}
function jqLiteController(element, name) {
return jqLiteInheritedData(element, '$' + (name || 'ngController') + 'Controller');
}
function jqLiteInheritedData(element, name, value) {
// if element is the document object work with the html element instead
// this makes $(document).scope() possible
if (element.nodeType == NODE_TYPE_DOCUMENT) {
element = element.documentElement;
}
var names = isArray(name) ? name : [name];
while (element) {
for (var i = 0, ii = names.length; i < ii; i++) {
if ((value = jqLite.data(element, names[i])) !== undefined) return value;
}
// If dealing with a document fragment node with a host element, and no parent, use the host
// element as the parent. This enables directives within a Shadow DOM or polyfilled Shadow DOM
// to lookup parent controllers.
element = element.parentNode || (element.nodeType === NODE_TYPE_DOCUMENT_FRAGMENT && element.host);
}
}
function jqLiteEmpty(element) {
jqLiteDealoc(element, true);
while (element.firstChild) {
element.removeChild(element.firstChild);
}
}
function jqLiteRemove(element, keepData) {
if (!keepData) jqLiteDealoc(element);
var parent = element.parentNode;
if (parent) parent.removeChild(element);
}
function jqLiteDocumentLoaded(action, win) {
win = win || window;
if (win.document.readyState === 'complete') {
// Force the action to be run async for consistent behaviour
// from the action's point of view
// i.e. it will definitely not be in a $apply
win.setTimeout(action);
} else {
// No need to unbind this handler as load is only ever called once
jqLite(win).on('load', action);
}
}
//////////////////////////////////////////
// Functions which are declared directly.
//////////////////////////////////////////
var JQLitePrototype = JQLite.prototype = {
ready: function(fn) {
var fired = false;
function trigger() {
if (fired) return;
fired = true;
fn();
}
// check if document is already loaded
if (document.readyState === 'complete') {
setTimeout(trigger);
} else {
this.on('DOMContentLoaded', trigger); // works for modern browsers and IE9
// we can not use jqLite since we are not done loading and jQuery could be loaded later.
// jshint -W064
JQLite(window).on('load', trigger); // fallback to window.onload for others
// jshint +W064
}
},
toString: function() {
var value = [];
forEach(this, function(e) { value.push('' + e);});
return '[' + value.join(', ') + ']';
},
eq: function(index) {
return (index >= 0) ? jqLite(this[index]) : jqLite(this[this.length + index]);
},
length: 0,
push: push,
sort: [].sort,
splice: [].splice
};
//////////////////////////////////////////
// Functions iterating getter/setters.
// these functions return self on setter and
// value on get.
//////////////////////////////////////////
var BOOLEAN_ATTR = {};
forEach('multiple,selected,checked,disabled,readOnly,required,open'.split(','), function(value) {
BOOLEAN_ATTR[lowercase(value)] = value;
});
var BOOLEAN_ELEMENTS = {};
forEach('input,select,option,textarea,button,form,details'.split(','), function(value) {
BOOLEAN_ELEMENTS[value] = true;
});
var ALIASED_ATTR = {
'ngMinlength': 'minlength',
'ngMaxlength': 'maxlength',
'ngMin': 'min',
'ngMax': 'max',
'ngPattern': 'pattern'
};
function getBooleanAttrName(element, name) {
// check dom last since we will most likely fail on name
var booleanAttr = BOOLEAN_ATTR[name.toLowerCase()];
// booleanAttr is here twice to minimize DOM access
return booleanAttr && BOOLEAN_ELEMENTS[nodeName_(element)] && booleanAttr;
}
function getAliasedAttrName(element, name) {
var nodeName = element.nodeName;
return (nodeName === 'INPUT' || nodeName === 'TEXTAREA') && ALIASED_ATTR[name];
}
forEach({
data: jqLiteData,
removeData: jqLiteRemoveData
}, function(fn, name) {
JQLite[name] = fn;
});
forEach({
data: jqLiteData,
inheritedData: jqLiteInheritedData,
scope: function(element) {
// Can't use jqLiteData here directly so we stay compatible with jQuery!
return jqLite.data(element, '$scope') || jqLiteInheritedData(element.parentNode || element, ['$isolateScope', '$scope']);
},
isolateScope: function(element) {
// Can't use jqLiteData here directly so we stay compatible with jQuery!
return jqLite.data(element, '$isolateScope') || jqLite.data(element, '$isolateScopeNoTemplate');
},
controller: jqLiteController,
injector: function(element) {
return jqLiteInheritedData(element, '$injector');
},
removeAttr: function(element, name) {
element.removeAttribute(name);
},
hasClass: jqLiteHasClass,
css: function(element, name, value) {
name = camelCase(name);
if (isDefined(value)) {
element.style[name] = value;
} else {
return element.style[name];
}
},
attr: function(element, name, value) {
var lowercasedName = lowercase(name);
if (BOOLEAN_ATTR[lowercasedName]) {
if (isDefined(value)) {
if (!!value) {
element[name] = true;
element.setAttribute(name, lowercasedName);
} else {
element[name] = false;
element.removeAttribute(lowercasedName);
}
} else {
return (element[name] ||
(element.attributes.getNamedItem(name) || noop).specified)
? lowercasedName
: undefined;
}
} else if (isDefined(value)) {
element.setAttribute(name, value);
} else if (element.getAttribute) {
// the extra argument "2" is to get the right thing for a.href in IE, see jQuery code
// some elements (e.g. Document) don't have get attribute, so return undefined
var ret = element.getAttribute(name, 2);
// normalize non-existing attributes to undefined (as jQuery)
return ret === null ? undefined : ret;
}
},
prop: function(element, name, value) {
if (isDefined(value)) {
element[name] = value;
} else {
return element[name];
}
},
text: (function() {
getText.$dv = '';
return getText;
function getText(element, value) {
if (isUndefined(value)) {
var nodeType = element.nodeType;
return (nodeType === NODE_TYPE_ELEMENT || nodeType === NODE_TYPE_TEXT) ? element.textContent : '';
}
element.textContent = value;
}
})(),
val: function(element, value) {
if (isUndefined(value)) {
if (element.multiple && nodeName_(element) === 'select') {
var result = [];
forEach(element.options, function(option) {
if (option.selected) {
result.push(option.value || option.text);
}
});
return result.length === 0 ? null : result;
}
return element.value;
}
element.value = value;
},
html: function(element, value) {
if (isUndefined(value)) {
return element.innerHTML;
}
jqLiteDealoc(element, true);
element.innerHTML = value;
},
empty: jqLiteEmpty
}, function(fn, name) {
/**
* Properties: writes return selection, reads return first value
*/
JQLite.prototype[name] = function(arg1, arg2) {
var i, key;
var nodeCount = this.length;
// jqLiteHasClass has only two arguments, but is a getter-only fn, so we need to special-case it
// in a way that survives minification.
// jqLiteEmpty takes no arguments but is a setter.
if (fn !== jqLiteEmpty &&
(((fn.length == 2 && (fn !== jqLiteHasClass && fn !== jqLiteController)) ? arg1 : arg2) === undefined)) {
if (isObject(arg1)) {
// we are a write, but the object properties are the key/values
for (i = 0; i < nodeCount; i++) {
if (fn === jqLiteData) {
// data() takes the whole object in jQuery
fn(this[i], arg1);
} else {
for (key in arg1) {
fn(this[i], key, arg1[key]);
}
}
}
// return self for chaining
return this;
} else {
// we are a read, so read the first child.
// TODO: do we still need this?
var value = fn.$dv;
// Only if we have $dv do we iterate over all, otherwise it is just the first element.
var jj = (value === undefined) ? Math.min(nodeCount, 1) : nodeCount;
for (var j = 0; j < jj; j++) {
var nodeValue = fn(this[j], arg1, arg2);
value = value ? value + nodeValue : nodeValue;
}
return value;
}
} else {
// we are a write, so apply to all children
for (i = 0; i < nodeCount; i++) {
fn(this[i], arg1, arg2);
}
// return self for chaining
return this;
}
};
});
function createEventHandler(element, events) {
var eventHandler = function(event, type) {
// jQuery specific api
event.isDefaultPrevented = function() {
return event.defaultPrevented;
};
var eventFns = events[type || event.type];
var eventFnsLength = eventFns ? eventFns.length : 0;
if (!eventFnsLength) return;
if (isUndefined(event.immediatePropagationStopped)) {
var originalStopImmediatePropagation = event.stopImmediatePropagation;
event.stopImmediatePropagation = function() {
event.immediatePropagationStopped = true;
if (event.stopPropagation) {
event.stopPropagation();
}
if (originalStopImmediatePropagation) {
originalStopImmediatePropagation.call(event);
}
};
}
event.isImmediatePropagationStopped = function() {
return event.immediatePropagationStopped === true;
};
// Copy event handlers in case event handlers array is modified during execution.
if ((eventFnsLength > 1)) {
eventFns = shallowCopy(eventFns);
}
for (var i = 0; i < eventFnsLength; i++) {
if (!event.isImmediatePropagationStopped()) {
eventFns[i].call(element, event);
}
}
};
// TODO: this is a hack for angularMocks/clearDataCache that makes it possible to deregister all
// events on `element`
eventHandler.elem = element;
return eventHandler;
}
//////////////////////////////////////////
// Functions iterating traversal.
// These functions chain results into a single
// selector.
//////////////////////////////////////////
forEach({
removeData: jqLiteRemoveData,
on: function jqLiteOn(element, type, fn, unsupported) {
if (isDefined(unsupported)) throw jqLiteMinErr('onargs', 'jqLite#on() does not support the `selector` or `eventData` parameters');
// Do not add event handlers to non-elements because they will not be cleaned up.
if (!jqLiteAcceptsData(element)) {
return;
}
var expandoStore = jqLiteExpandoStore(element, true);
var events = expandoStore.events;
var handle = expandoStore.handle;
if (!handle) {
handle = expandoStore.handle = createEventHandler(element, events);
}
// http://jsperf.com/string-indexof-vs-split
var types = type.indexOf(' ') >= 0 ? type.split(' ') : [type];
var i = types.length;
while (i--) {
type = types[i];
var eventFns = events[type];
if (!eventFns) {
events[type] = [];
if (type === 'mouseenter' || type === 'mouseleave') {
// Refer to jQuery's implementation of mouseenter & mouseleave
// Read about mouseenter and mouseleave:
// http://www.quirksmode.org/js/events_mouse.html#link8
jqLiteOn(element, MOUSE_EVENT_MAP[type], function(event) {
var target = this, related = event.relatedTarget;
// For mousenter/leave call the handler if related is outside the target.
// NB: No relatedTarget if the mouse left/entered the browser window
if (!related || (related !== target && !target.contains(related))) {
handle(event, type);
}
});
} else {
if (type !== '$destroy') {
addEventListenerFn(element, type, handle);
}
}
eventFns = events[type];
}
eventFns.push(fn);
}
},
off: jqLiteOff,
one: function(element, type, fn) {
element = jqLite(element);
//add the listener twice so that when it is called
//you can remove the original function and still be
//able to call element.off(ev, fn) normally
element.on(type, function onFn() {
element.off(type, fn);
element.off(type, onFn);
});
element.on(type, fn);
},
replaceWith: function(element, replaceNode) {
var index, parent = element.parentNode;
jqLiteDealoc(element);
forEach(new JQLite(replaceNode), function(node) {
if (index) {
parent.insertBefore(node, index.nextSibling);
} else {
parent.replaceChild(node, element);
}
index = node;
});
},
children: function(element) {
var children = [];
forEach(element.childNodes, function(element) {
if (element.nodeType === NODE_TYPE_ELEMENT)
children.push(element);
});
return children;
},
contents: function(element) {
return element.contentDocument || element.childNodes || [];
},
append: function(element, node) {
var nodeType = element.nodeType;
if (nodeType !== NODE_TYPE_ELEMENT && nodeType !== NODE_TYPE_DOCUMENT_FRAGMENT) return;
node = new JQLite(node);
for (var i = 0, ii = node.length; i < ii; i++) {
var child = node[i];
element.appendChild(child);
}
},
prepend: function(element, node) {
if (element.nodeType === NODE_TYPE_ELEMENT) {
var index = element.firstChild;
forEach(new JQLite(node), function(child) {
element.insertBefore(child, index);
});
}
},
wrap: function(element, wrapNode) {
wrapNode = jqLite(wrapNode).eq(0).clone()[0];
var parent = element.parentNode;
if (parent) {
parent.replaceChild(wrapNode, element);
}
wrapNode.appendChild(element);
},
remove: jqLiteRemove,
detach: function(element) {
jqLiteRemove(element, true);
},
after: function(element, newElement) {
var index = element, parent = element.parentNode;
newElement = new JQLite(newElement);
for (var i = 0, ii = newElement.length; i < ii; i++) {
var node = newElement[i];
parent.insertBefore(node, index.nextSibling);
index = node;
}
},
addClass: jqLiteAddClass,
removeClass: jqLiteRemoveClass,
toggleClass: function(element, selector, condition) {
if (selector) {
forEach(selector.split(' '), function(className) {
var classCondition = condition;
if (isUndefined(classCondition)) {
classCondition = !jqLiteHasClass(element, className);
}
(classCondition ? jqLiteAddClass : jqLiteRemoveClass)(element, className);
});
}
},
parent: function(element) {
var parent = element.parentNode;
return parent && parent.nodeType !== NODE_TYPE_DOCUMENT_FRAGMENT ? parent : null;
},
next: function(element) {
return element.nextElementSibling;
},
find: function(element, selector) {
if (element.getElementsByTagName) {
return element.getElementsByTagName(selector);
} else {
return [];
}
},
clone: jqLiteClone,
triggerHandler: function(element, event, extraParameters) {
var dummyEvent, eventFnsCopy, handlerArgs;
var eventName = event.type || event;
var expandoStore = jqLiteExpandoStore(element);
var events = expandoStore && expandoStore.events;
var eventFns = events && events[eventName];
if (eventFns) {
// Create a dummy event to pass to the handlers
dummyEvent = {
preventDefault: function() { this.defaultPrevented = true; },
isDefaultPrevented: function() { return this.defaultPrevented === true; },
stopImmediatePropagation: function() { this.immediatePropagationStopped = true; },
isImmediatePropagationStopped: function() { return this.immediatePropagationStopped === true; },
stopPropagation: noop,
type: eventName,
target: element
};
// If a custom event was provided then extend our dummy event with it
if (event.type) {
dummyEvent = extend(dummyEvent, event);
}
// Copy event handlers in case event handlers array is modified during execution.
eventFnsCopy = shallowCopy(eventFns);
handlerArgs = extraParameters ? [dummyEvent].concat(extraParameters) : [dummyEvent];
forEach(eventFnsCopy, function(fn) {
if (!dummyEvent.isImmediatePropagationStopped()) {
fn.apply(element, handlerArgs);
}
});
}
}
}, function(fn, name) {
/**
* chaining functions
*/
JQLite.prototype[name] = function(arg1, arg2, arg3) {
var value;
for (var i = 0, ii = this.length; i < ii; i++) {
if (isUndefined(value)) {
value = fn(this[i], arg1, arg2, arg3);
if (isDefined(value)) {
// any function which returns a value needs to be wrapped
value = jqLite(value);
}
} else {
jqLiteAddNodes(value, fn(this[i], arg1, arg2, arg3));
}
}
return isDefined(value) ? value : this;
};
// bind legacy bind/unbind to on/off
JQLite.prototype.bind = JQLite.prototype.on;
JQLite.prototype.unbind = JQLite.prototype.off;
});
/**
* Computes a hash of an 'obj'.
* Hash of a:
* string is string
* number is number as string
* object is either result of calling $$hashKey function on the object or uniquely generated id,
* that is also assigned to the $$hashKey property of the object.
*
* @param obj
* @returns {string} hash string such that the same input will have the same hash string.
* The resulting string key is in 'type:hashKey' format.
*/
function hashKey(obj, nextUidFn) {
var key = obj && obj.$$hashKey;
if (key) {
if (typeof key === 'function') {
key = obj.$$hashKey();
}
return key;
}
var objType = typeof obj;
if (objType == 'function' || (objType == 'object' && obj !== null)) {
key = obj.$$hashKey = objType + ':' + (nextUidFn || nextUid)();
} else {
key = objType + ':' + obj;
}
return key;
}
/**
* HashMap which can use objects as keys
*/
function HashMap(array, isolatedUid) {
if (isolatedUid) {
var uid = 0;
this.nextUid = function() {
return ++uid;
};
}
forEach(array, this.put, this);
}
HashMap.prototype = {
/**
* Store key value pair
* @param key key to store can be any type
* @param value value to store can be any type
*/
put: function(key, value) {
this[hashKey(key, this.nextUid)] = value;
},
/**
* @param key
* @returns {Object} the value for the key
*/
get: function(key) {
return this[hashKey(key, this.nextUid)];
},
/**
* Remove the key/value pair
* @param key
*/
remove: function(key) {
var value = this[key = hashKey(key, this.nextUid)];
delete this[key];
return value;
}
};
/**
* @ngdoc function
* @module ng
* @name angular.injector
* @kind function
*
* @description
* Creates an injector object that can be used for retrieving services as well as for
* dependency injection (see {@link guide/di dependency injection}).
*
* @param {Array.} modules A list of module functions or their aliases. See
* {@link angular.module}. The `ng` module must be explicitly added.
* @param {boolean=} [strictDi=false] Whether the injector should be in strict mode, which
* disallows argument name annotation inference.
* @returns {injector} Injector object. See {@link auto.$injector $injector}.
*
* @example
* Typical usage
* ```js
* // create an injector
* var $injector = angular.injector(['ng']);
*
* // use the injector to kick off your application
* // use the type inference to auto inject arguments, or use implicit injection
* $injector.invoke(function($rootScope, $compile, $document) {
* $compile($document)($rootScope);
* $rootScope.$digest();
* });
* ```
*
* Sometimes you want to get access to the injector of a currently running Angular app
* from outside Angular. Perhaps, you want to inject and compile some markup after the
* application has been bootstrapped. You can do this using the extra `injector()` added
* to JQuery/jqLite elements. See {@link angular.element}.
*
* *This is fairly rare but could be the case if a third party library is injecting the
* markup.*
*
* In the following example a new block of HTML containing a `ng-controller`
* directive is added to the end of the document body by JQuery. We then compile and link
* it into the current AngularJS scope.
*
* ```js
* var $div = $('
{{content.label}}
');
* $(document.body).append($div);
*
* angular.element(document).injector().invoke(function($compile) {
* var scope = angular.element($div).scope();
* $compile($div)(scope);
* });
* ```
*/
/**
* @ngdoc module
* @name auto
* @description
*
* Implicit module which gets automatically added to each {@link auto.$injector $injector}.
*/
var FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m;
var FN_ARG_SPLIT = /,/;
var FN_ARG = /^\s*(_?)(\S+?)\1\s*$/;
var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
var $injectorMinErr = minErr('$injector');
function anonFn(fn) {
// For anonymous functions, showing at the very least the function signature can help in
// debugging.
var fnText = fn.toString().replace(STRIP_COMMENTS, ''),
args = fnText.match(FN_ARGS);
if (args) {
return 'function(' + (args[1] || '').replace(/[\s\r\n]+/, ' ') + ')';
}
return 'fn';
}
function annotate(fn, strictDi, name) {
var $inject,
fnText,
argDecl,
last;
if (typeof fn === 'function') {
if (!($inject = fn.$inject)) {
$inject = [];
if (fn.length) {
if (strictDi) {
if (!isString(name) || !name) {
name = fn.name || anonFn(fn);
}
throw $injectorMinErr('strictdi',
'{0} is not using explicit annotation and cannot be invoked in strict mode', name);
}
fnText = fn.toString().replace(STRIP_COMMENTS, '');
argDecl = fnText.match(FN_ARGS);
forEach(argDecl[1].split(FN_ARG_SPLIT), function(arg) {
arg.replace(FN_ARG, function(all, underscore, name) {
$inject.push(name);
});
});
}
fn.$inject = $inject;
}
} else if (isArray(fn)) {
last = fn.length - 1;
assertArgFn(fn[last], 'fn');
$inject = fn.slice(0, last);
} else {
assertArgFn(fn, 'fn', true);
}
return $inject;
}
///////////////////////////////////////
/**
* @ngdoc service
* @name $injector
*
* @description
*
* `$injector` is used to retrieve object instances as defined by
* {@link auto.$provide provider}, instantiate types, invoke methods,
* and load modules.
*
* The following always holds true:
*
* ```js
* var $injector = angular.injector();
* expect($injector.get('$injector')).toBe($injector);
* expect($injector.invoke(function($injector) {
* return $injector;
* })).toBe($injector);
* ```
*
* # Injection Function Annotation
*
* JavaScript does not have annotations, and annotations are needed for dependency injection. The
* following are all valid ways of annotating function with injection arguments and are equivalent.
*
* ```js
* // inferred (only works if code not minified/obfuscated)
* $injector.invoke(function(serviceA){});
*
* // annotated
* function explicit(serviceA) {};
* explicit.$inject = ['serviceA'];
* $injector.invoke(explicit);
*
* // inline
* $injector.invoke(['serviceA', function(serviceA){}]);
* ```
*
* ## Inference
*
* In JavaScript calling `toString()` on a function returns the function definition. The definition
* can then be parsed and the function arguments can be extracted. This method of discovering
* annotations is disallowed when the injector is in strict mode.
* *NOTE:* This does not work with minification, and obfuscation tools since these tools change the
* argument names.
*
* ## `$inject` Annotation
* By adding an `$inject` property onto a function the injection parameters can be specified.
*
* ## Inline
* As an array of injection names, where the last item in the array is the function to call.
*/
/**
* @ngdoc method
* @name $injector#get
*
* @description
* Return an instance of the service.
*
* @param {string} name The name of the instance to retrieve.
* @return {*} The instance.
*/
/**
* @ngdoc method
* @name $injector#invoke
*
* @description
* Invoke the method and supply the method arguments from the `$injector`.
*
* @param {!Function} fn The function to invoke. Function parameters are injected according to the
* {@link guide/di $inject Annotation} rules.
* @param {Object=} self The `this` for the invoked method.
* @param {Object=} locals Optional object. If preset then any argument names are read from this
* object first, before the `$injector` is consulted.
* @returns {*} the value returned by the invoked `fn` function.
*/
/**
* @ngdoc method
* @name $injector#has
*
* @description
* Allows the user to query if the particular service exists.
*
* @param {string} name Name of the service to query.
* @returns {boolean} `true` if injector has given service.
*/
/**
* @ngdoc method
* @name $injector#instantiate
* @description
* Create a new instance of JS type. The method takes a constructor function, invokes the new
* operator, and supplies all of the arguments to the constructor function as specified by the
* constructor annotation.
*
* @param {Function} Type Annotated constructor function.
* @param {Object=} locals Optional object. If preset then any argument names are read from this
* object first, before the `$injector` is consulted.
* @returns {Object} new instance of `Type`.
*/
/**
* @ngdoc method
* @name $injector#annotate
*
* @description
* Returns an array of service names which the function is requesting for injection. This API is
* used by the injector to determine which services need to be injected into the function when the
* function is invoked. There are three ways in which the function can be annotated with the needed
* dependencies.
*
* # Argument names
*
* The simplest form is to extract the dependencies from the arguments of the function. This is done
* by converting the function into a string using `toString()` method and extracting the argument
* names.
* ```js
* // Given
* function MyController($scope, $route) {
* // ...
* }
*
* // Then
* expect(injector.annotate(MyController)).toEqual(['$scope', '$route']);
* ```
*
* You can disallow this method by using strict injection mode.
*
* This method does not work with code minification / obfuscation. For this reason the following
* annotation strategies are supported.
*
* # The `$inject` property
*
* If a function has an `$inject` property and its value is an array of strings, then the strings
* represent names of services to be injected into the function.
* ```js
* // Given
* var MyController = function(obfuscatedScope, obfuscatedRoute) {
* // ...
* }
* // Define function dependencies
* MyController['$inject'] = ['$scope', '$route'];
*
* // Then
* expect(injector.annotate(MyController)).toEqual(['$scope', '$route']);
* ```
*
* # The array notation
*
* It is often desirable to inline Injected functions and that's when setting the `$inject` property
* is very inconvenient. In these situations using the array notation to specify the dependencies in
* a way that survives minification is a better choice:
*
* ```js
* // We wish to write this (not minification / obfuscation safe)
* injector.invoke(function($compile, $rootScope) {
* // ...
* });
*
* // We are forced to write break inlining
* var tmpFn = function(obfuscatedCompile, obfuscatedRootScope) {
* // ...
* };
* tmpFn.$inject = ['$compile', '$rootScope'];
* injector.invoke(tmpFn);
*
* // To better support inline function the inline annotation is supported
* injector.invoke(['$compile', '$rootScope', function(obfCompile, obfRootScope) {
* // ...
* }]);
*
* // Therefore
* expect(injector.annotate(
* ['$compile', '$rootScope', function(obfus_$compile, obfus_$rootScope) {}])
* ).toEqual(['$compile', '$rootScope']);
* ```
*
* @param {Function|Array.} fn Function for which dependent service names need to
* be retrieved as described above.
*
* @param {boolean=} [strictDi=false] Disallow argument name annotation inference.
*
* @returns {Array.} The names of the services which the function requires.
*/
/**
* @ngdoc service
* @name $provide
*
* @description
*
* The {@link auto.$provide $provide} service has a number of methods for registering components
* with the {@link auto.$injector $injector}. Many of these functions are also exposed on
* {@link angular.Module}.
*
* An Angular **service** is a singleton object created by a **service factory**. These **service
* factories** are functions which, in turn, are created by a **service provider**.
* The **service providers** are constructor functions. When instantiated they must contain a
* property called `$get`, which holds the **service factory** function.
*
* When you request a service, the {@link auto.$injector $injector} is responsible for finding the
* correct **service provider**, instantiating it and then calling its `$get` **service factory**
* function to get the instance of the **service**.
*
* Often services have no configuration options and there is no need to add methods to the service
* provider. The provider will be no more than a constructor function with a `$get` property. For
* these cases the {@link auto.$provide $provide} service has additional helper methods to register
* services without specifying a provider.
*
* * {@link auto.$provide#provider provider(provider)} - registers a **service provider** with the
* {@link auto.$injector $injector}
* * {@link auto.$provide#constant constant(obj)} - registers a value/object that can be accessed by
* providers and services.
* * {@link auto.$provide#value value(obj)} - registers a value/object that can only be accessed by
* services, not providers.
* * {@link auto.$provide#factory factory(fn)} - registers a service **factory function**, `fn`,
* that will be wrapped in a **service provider** object, whose `$get` property will contain the
* given factory function.
* * {@link auto.$provide#service service(class)} - registers a **constructor function**, `class`
* that will be wrapped in a **service provider** object, whose `$get` property will instantiate
* a new object using the given constructor function.
*
* See the individual methods for more information and examples.
*/
/**
* @ngdoc method
* @name $provide#provider
* @description
*
* Register a **provider function** with the {@link auto.$injector $injector}. Provider functions
* are constructor functions, whose instances are responsible for "providing" a factory for a
* service.
*
* Service provider names start with the name of the service they provide followed by `Provider`.
* For example, the {@link ng.$log $log} service has a provider called
* {@link ng.$logProvider $logProvider}.
*
* Service provider objects can have additional methods which allow configuration of the provider
* and its service. Importantly, you can configure what kind of service is created by the `$get`
* method, or how that service will act. For example, the {@link ng.$logProvider $logProvider} has a
* method {@link ng.$logProvider#debugEnabled debugEnabled}
* which lets you specify whether the {@link ng.$log $log} service will log debug messages to the
* console or not.
*
* @param {string} name The name of the instance. NOTE: the provider will be available under `name +
'Provider'` key.
* @param {(Object|function())} provider If the provider is:
*
* - `Object`: then it should have a `$get` method. The `$get` method will be invoked using
* {@link auto.$injector#invoke $injector.invoke()} when an instance needs to be created.
* - `Constructor`: a new instance of the provider will be created using
* {@link auto.$injector#instantiate $injector.instantiate()}, then treated as `object`.
*
* @returns {Object} registered provider instance
* @example
*
* The following example shows how to create a simple event tracking service and register it using
* {@link auto.$provide#provider $provide.provider()}.
*
* ```js
* // Define the eventTracker provider
* function EventTrackerProvider() {
* var trackingUrl = '/track';
*
* // A provider method for configuring where the tracked events should been saved
* this.setTrackingUrl = function(url) {
* trackingUrl = url;
* };
*
* // The service factory function
* this.$get = ['$http', function($http) {
* var trackedEvents = {};
* return {
* // Call this to track an event
* event: function(event) {
* var count = trackedEvents[event] || 0;
* count += 1;
* trackedEvents[event] = count;
* return count;
* },
* // Call this to save the tracked events to the trackingUrl
* save: function() {
* $http.post(trackingUrl, trackedEvents);
* }
* };
* }];
* }
*
* describe('eventTracker', function() {
* var postSpy;
*
* beforeEach(module(function($provide) {
* // Register the eventTracker provider
* $provide.provider('eventTracker', EventTrackerProvider);
* }));
*
* beforeEach(module(function(eventTrackerProvider) {
* // Configure eventTracker provider
* eventTrackerProvider.setTrackingUrl('/custom-track');
* }));
*
* it('tracks events', inject(function(eventTracker) {
* expect(eventTracker.event('login')).toEqual(1);
* expect(eventTracker.event('login')).toEqual(2);
* }));
*
* it('saves to the tracking url', inject(function(eventTracker, $http) {
* postSpy = spyOn($http, 'post');
* eventTracker.event('login');
* eventTracker.save();
* expect(postSpy).toHaveBeenCalled();
* expect(postSpy.mostRecentCall.args[0]).not.toEqual('/track');
* expect(postSpy.mostRecentCall.args[0]).toEqual('/custom-track');
* expect(postSpy.mostRecentCall.args[1]).toEqual({ 'login': 1 });
* }));
* });
* ```
*/
/**
* @ngdoc method
* @name $provide#factory
* @description
*
* Register a **service factory**, which will be called to return the service instance.
* This is short for registering a service where its provider consists of only a `$get` property,
* which is the given service factory function.
* You should use {@link auto.$provide#factory $provide.factory(getFn)} if you do not need to
* configure your service in a provider.
*
* @param {string} name The name of the instance.
* @param {function()} $getFn The $getFn for the instance creation. Internally this is a short hand
* for `$provide.provider(name, {$get: $getFn})`.
* @returns {Object} registered provider instance
*
* @example
* Here is an example of registering a service
* ```js
* $provide.factory('ping', ['$http', function($http) {
* return function ping() {
* return $http.send('/ping');
* };
* }]);
* ```
* You would then inject and use this service like this:
* ```js
* someModule.controller('Ctrl', ['ping', function(ping) {
* ping();
* }]);
* ```
*/
/**
* @ngdoc method
* @name $provide#service
* @description
*
* Register a **service constructor**, which will be invoked with `new` to create the service
* instance.
* This is short for registering a service where its provider's `$get` property is the service
* constructor function that will be used to instantiate the service instance.
*
* You should use {@link auto.$provide#service $provide.service(class)} if you define your service
* as a type/class.
*
* @param {string} name The name of the instance.
* @param {Function} constructor A class (constructor function) that will be instantiated.
* @returns {Object} registered provider instance
*
* @example
* Here is an example of registering a service using
* {@link auto.$provide#service $provide.service(class)}.
* ```js
* var Ping = function($http) {
* this.$http = $http;
* };
*
* Ping.$inject = ['$http'];
*
* Ping.prototype.send = function() {
* return this.$http.get('/ping');
* };
* $provide.service('ping', Ping);
* ```
* You would then inject and use this service like this:
* ```js
* someModule.controller('Ctrl', ['ping', function(ping) {
* ping.send();
* }]);
* ```
*/
/**
* @ngdoc method
* @name $provide#value
* @description
*
* Register a **value service** with the {@link auto.$injector $injector}, such as a string, a
* number, an array, an object or a function. This is short for registering a service where its
* provider's `$get` property is a factory function that takes no arguments and returns the **value
* service**.
*
* Value services are similar to constant services, except that they cannot be injected into a
* module configuration function (see {@link angular.Module#config}) but they can be overridden by
* an Angular
* {@link auto.$provide#decorator decorator}.
*
* @param {string} name The name of the instance.
* @param {*} value The value.
* @returns {Object} registered provider instance
*
* @example
* Here are some examples of creating value services.
* ```js
* $provide.value('ADMIN_USER', 'admin');
*
* $provide.value('RoleLookup', { admin: 0, writer: 1, reader: 2 });
*
* $provide.value('halfOf', function(value) {
* return value / 2;
* });
* ```
*/
/**
* @ngdoc method
* @name $provide#constant
* @description
*
* Register a **constant service**, such as a string, a number, an array, an object or a function,
* with the {@link auto.$injector $injector}. Unlike {@link auto.$provide#value value} it can be
* injected into a module configuration function (see {@link angular.Module#config}) and it cannot
* be overridden by an Angular {@link auto.$provide#decorator decorator}.
*
* @param {string} name The name of the constant.
* @param {*} value The constant value.
* @returns {Object} registered instance
*
* @example
* Here a some examples of creating constants:
* ```js
* $provide.constant('SHARD_HEIGHT', 306);
*
* $provide.constant('MY_COLOURS', ['red', 'blue', 'grey']);
*
* $provide.constant('double', function(value) {
* return value * 2;
* });
* ```
*/
/**
* @ngdoc method
* @name $provide#decorator
* @description
*
* Register a **service decorator** with the {@link auto.$injector $injector}. A service decorator
* intercepts the creation of a service, allowing it to override or modify the behaviour of the
* service. The object returned by the decorator may be the original service, or a new service
* object which replaces or wraps and delegates to the original service.
*
* @param {string} name The name of the service to decorate.
* @param {function()} decorator This function will be invoked when the service needs to be
* instantiated and should return the decorated service instance. The function is called using
* the {@link auto.$injector#invoke injector.invoke} method and is therefore fully injectable.
* Local injection arguments:
*
* * `$delegate` - The original service instance, which can be monkey patched, configured,
* decorated or delegated to.
*
* @example
* Here we decorate the {@link ng.$log $log} service to convert warnings to errors by intercepting
* calls to {@link ng.$log#error $log.warn()}.
* ```js
* $provide.decorator('$log', ['$delegate', function($delegate) {
* $delegate.warn = $delegate.error;
* return $delegate;
* }]);
* ```
*/
function createInjector(modulesToLoad, strictDi) {
strictDi = (strictDi === true);
var INSTANTIATING = {},
providerSuffix = 'Provider',
path = [],
loadedModules = new HashMap([], true),
providerCache = {
$provide: {
provider: supportObject(provider),
factory: supportObject(factory),
service: supportObject(service),
value: supportObject(value),
constant: supportObject(constant),
decorator: decorator
}
},
providerInjector = (providerCache.$injector =
createInternalInjector(providerCache, function() {
throw $injectorMinErr('unpr', "Unknown provider: {0}", path.join(' <- '));
})),
instanceCache = {},
instanceInjector = (instanceCache.$injector =
createInternalInjector(instanceCache, function(servicename) {
var provider = providerInjector.get(servicename + providerSuffix);
return instanceInjector.invoke(provider.$get, provider, undefined, servicename);
}));
forEach(loadModules(modulesToLoad), function(fn) { instanceInjector.invoke(fn || noop); });
return instanceInjector;
////////////////////////////////////
// $provider
////////////////////////////////////
function supportObject(delegate) {
return function(key, value) {
if (isObject(key)) {
forEach(key, reverseParams(delegate));
} else {
return delegate(key, value);
}
};
}
function provider(name, provider_) {
assertNotHasOwnProperty(name, 'service');
if (isFunction(provider_) || isArray(provider_)) {
provider_ = providerInjector.instantiate(provider_);
}
if (!provider_.$get) {
throw $injectorMinErr('pget', "Provider '{0}' must define $get factory method.", name);
}
return providerCache[name + providerSuffix] = provider_;
}
function enforceReturnValue(name, factory) {
return function enforcedReturnValue() {
var result = instanceInjector.invoke(factory, this, undefined, name);
if (isUndefined(result)) {
throw $injectorMinErr('undef', "Provider '{0}' must return a value from $get factory method.", name);
}
return result;
};
}
function factory(name, factoryFn, enforce) {
return provider(name, {
$get: enforce !== false ? enforceReturnValue(name, factoryFn) : factoryFn
});
}
function service(name, constructor) {
return factory(name, ['$injector', function($injector) {
return $injector.instantiate(constructor);
}]);
}
function value(name, val) { return factory(name, valueFn(val), false); }
function constant(name, value) {
assertNotHasOwnProperty(name, 'constant');
providerCache[name] = value;
instanceCache[name] = value;
}
function decorator(serviceName, decorFn) {
var origProvider = providerInjector.get(serviceName + providerSuffix),
orig$get = origProvider.$get;
origProvider.$get = function() {
var origInstance = instanceInjector.invoke(orig$get, origProvider);
return instanceInjector.invoke(decorFn, null, {$delegate: origInstance});
};
}
////////////////////////////////////
// Module Loading
////////////////////////////////////
function loadModules(modulesToLoad) {
var runBlocks = [], moduleFn;
forEach(modulesToLoad, function(module) {
if (loadedModules.get(module)) return;
loadedModules.put(module, true);
function runInvokeQueue(queue) {
var i, ii;
for (i = 0, ii = queue.length; i < ii; i++) {
var invokeArgs = queue[i],
provider = providerInjector.get(invokeArgs[0]);
provider[invokeArgs[1]].apply(provider, invokeArgs[2]);
}
}
try {
if (isString(module)) {
moduleFn = angularModule(module);
runBlocks = runBlocks.concat(loadModules(moduleFn.requires)).concat(moduleFn._runBlocks);
runInvokeQueue(moduleFn._invokeQueue);
runInvokeQueue(moduleFn._configBlocks);
} else if (isFunction(module)) {
runBlocks.push(providerInjector.invoke(module));
} else if (isArray(module)) {
runBlocks.push(providerInjector.invoke(module));
} else {
assertArgFn(module, 'module');
}
} catch (e) {
if (isArray(module)) {
module = module[module.length - 1];
}
if (e.message && e.stack && e.stack.indexOf(e.message) == -1) {
// Safari & FF's stack traces don't contain error.message content
// unlike those of Chrome and IE
// So if stack doesn't contain message, we create a new string that contains both.
// Since error.stack is read-only in Safari, I'm overriding e and not e.stack here.
/* jshint -W022 */
e = e.message + '\n' + e.stack;
}
throw $injectorMinErr('modulerr', "Failed to instantiate module {0} due to:\n{1}",
module, e.stack || e.message || e);
}
});
return runBlocks;
}
////////////////////////////////////
// internal Injector
////////////////////////////////////
function createInternalInjector(cache, factory) {
function getService(serviceName) {
if (cache.hasOwnProperty(serviceName)) {
if (cache[serviceName] === INSTANTIATING) {
throw $injectorMinErr('cdep', 'Circular dependency found: {0}',
serviceName + ' <- ' + path.join(' <- '));
}
return cache[serviceName];
} else {
try {
path.unshift(serviceName);
cache[serviceName] = INSTANTIATING;
return cache[serviceName] = factory(serviceName);
} catch (err) {
if (cache[serviceName] === INSTANTIATING) {
delete cache[serviceName];
}
throw err;
} finally {
path.shift();
}
}
}
function invoke(fn, self, locals, serviceName) {
if (typeof locals === 'string') {
serviceName = locals;
locals = null;
}
var args = [],
$inject = annotate(fn, strictDi, serviceName),
length, i,
key;
for (i = 0, length = $inject.length; i < length; i++) {
key = $inject[i];
if (typeof key !== 'string') {
throw $injectorMinErr('itkn',
'Incorrect injection token! Expected service name as string, got {0}', key);
}
args.push(
locals && locals.hasOwnProperty(key)
? locals[key]
: getService(key)
);
}
if (isArray(fn)) {
fn = fn[length];
}
// http://jsperf.com/angularjs-invoke-apply-vs-switch
// #5388
return fn.apply(self, args);
}
function instantiate(Type, locals, serviceName) {
// Check if Type is annotated and use just the given function at n-1 as parameter
// e.g. someModule.factory('greeter', ['$window', function(renamed$window) {}]);
// Object creation: http://jsperf.com/create-constructor/2
var instance = Object.create((isArray(Type) ? Type[Type.length - 1] : Type).prototype);
var returnedValue = invoke(Type, instance, locals, serviceName);
return isObject(returnedValue) || isFunction(returnedValue) ? returnedValue : instance;
}
return {
invoke: invoke,
instantiate: instantiate,
get: getService,
annotate: annotate,
has: function(name) {
return providerCache.hasOwnProperty(name + providerSuffix) || cache.hasOwnProperty(name);
}
};
}
}
createInjector.$$annotate = annotate;
/**
* @ngdoc provider
* @name $anchorScrollProvider
*
* @description
* Use `$anchorScrollProvider` to disable automatic scrolling whenever
* {@link ng.$location#hash $location.hash()} changes.
*/
function $AnchorScrollProvider() {
var autoScrollingEnabled = true;
/**
* @ngdoc method
* @name $anchorScrollProvider#disableAutoScrolling
*
* @description
* By default, {@link ng.$anchorScroll $anchorScroll()} will automatically detect changes to
* {@link ng.$location#hash $location.hash()} and scroll to the element matching the new hash.
* Use this method to disable automatic scrolling.
*
* If automatic scrolling is disabled, one must explicitly call
* {@link ng.$anchorScroll $anchorScroll()} in order to scroll to the element related to the
* current hash.
*/
this.disableAutoScrolling = function() {
autoScrollingEnabled = false;
};
/**
* @ngdoc service
* @name $anchorScroll
* @kind function
* @requires $window
* @requires $location
* @requires $rootScope
*
* @description
* When called, it checks the current value of {@link ng.$location#hash $location.hash()} and
* scrolls to the related element, according to the rules specified in the
* [Html5 spec](http://dev.w3.org/html5/spec/Overview.html#the-indicated-part-of-the-document).
*
* It also watches the {@link ng.$location#hash $location.hash()} and automatically scrolls to
* match any anchor whenever it changes. This can be disabled by calling
* {@link ng.$anchorScrollProvider#disableAutoScrolling $anchorScrollProvider.disableAutoScrolling()}.
*
* Additionally, you can use its {@link ng.$anchorScroll#yOffset yOffset} property to specify a
* vertical scroll-offset (either fixed or dynamic).
*
* @property {(number|function|jqLite)} yOffset
* If set, specifies a vertical scroll-offset. This is often useful when there are fixed
* positioned elements at the top of the page, such as navbars, headers etc.
*
* `yOffset` can be specified in various ways:
* - **number**: A fixed number of pixels to be used as offset.
* - **function**: A getter function called everytime `$anchorScroll()` is executed. Must return
* a number representing the offset (in pixels).
* - **jqLite**: A jqLite/jQuery element to be used for specifying the offset. The distance from
* the top of the page to the element's bottom will be used as offset.
* **Note**: The element will be taken into account only as long as its `position` is set to
* `fixed`. This option is useful, when dealing with responsive navbars/headers that adjust
* their height and/or positioning according to the viewport's size.
*
*
*
* In order for `yOffset` to work properly, scrolling should take place on the document's root and
* not some child element.
*
angular.module('anchorScrollExample', [])
.controller('ScrollController', ['$scope', '$location', '$anchorScroll',
function ($scope, $location, $anchorScroll) {
$scope.gotoBottom = function() {
// set the location.hash to the id of
// the element you wish to scroll to.
$location.hash('bottom');
// call $anchorScroll()
$anchorScroll();
};
}]);
#scrollArea {
height: 280px;
overflow: auto;
}
#bottom {
display: block;
margin-top: 2000px;
}
*
*
* The example below illustrates the use of a vertical scroll-offset (specified as a fixed value).
* See {@link ng.$anchorScroll#yOffset $anchorScroll.yOffset} for more details.
*
* @example
angular.module('anchorScrollOffsetExample', [])
.run(['$anchorScroll', function($anchorScroll) {
$anchorScroll.yOffset = 50; // always scroll by 50 extra pixels
}])
.controller('headerCtrl', ['$anchorScroll', '$location', '$scope',
function ($anchorScroll, $location, $scope) {
$scope.gotoAnchor = function(x) {
var newHash = 'anchor' + x;
if ($location.hash() !== newHash) {
// set the $location.hash to `newHash` and
// $anchorScroll will automatically scroll to it
$location.hash('anchor' + x);
} else {
// call $anchorScroll() explicitly,
// since $location.hash hasn't changed
$anchorScroll();
}
};
}
]);
body {
padding-top: 50px;
}
.anchor {
border: 2px dashed DarkOrchid;
padding: 10px 10px 200px 10px;
}
.fixed-header {
background-color: rgba(0, 0, 0, 0.2);
height: 50px;
position: fixed;
top: 0; left: 0; right: 0;
}
.fixed-header > a {
display: inline-block;
margin: 5px 15px;
}
*/
this.$get = ['$window', '$location', '$rootScope', function($window, $location, $rootScope) {
var document = $window.document;
// Helper function to get first anchor from a NodeList
// (using `Array#some()` instead of `angular#forEach()` since it's more performant
// and working in all supported browsers.)
function getFirstAnchor(list) {
var result = null;
Array.prototype.some.call(list, function(element) {
if (nodeName_(element) === 'a') {
result = element;
return true;
}
});
return result;
}
function getYOffset() {
var offset = scroll.yOffset;
if (isFunction(offset)) {
offset = offset();
} else if (isElement(offset)) {
var elem = offset[0];
var style = $window.getComputedStyle(elem);
if (style.position !== 'fixed') {
offset = 0;
} else {
offset = elem.getBoundingClientRect().bottom;
}
} else if (!isNumber(offset)) {
offset = 0;
}
return offset;
}
function scrollTo(elem) {
if (elem) {
elem.scrollIntoView();
var offset = getYOffset();
if (offset) {
// `offset` is the number of pixels we should scroll UP in order to align `elem` properly.
// This is true ONLY if the call to `elem.scrollIntoView()` initially aligns `elem` at the
// top of the viewport.
//
// IF the number of pixels from the top of `elem` to the end of the page's content is less
// than the height of the viewport, then `elem.scrollIntoView()` will align the `elem` some
// way down the page.
//
// This is often the case for elements near the bottom of the page.
//
// In such cases we do not need to scroll the whole `offset` up, just the difference between
// the top of the element and the offset, which is enough to align the top of `elem` at the
// desired position.
var elemTop = elem.getBoundingClientRect().top;
$window.scrollBy(0, elemTop - offset);
}
} else {
$window.scrollTo(0, 0);
}
}
function scroll() {
var hash = $location.hash(), elm;
// empty hash, scroll to the top of the page
if (!hash) scrollTo(null);
// element with given id
else if ((elm = document.getElementById(hash))) scrollTo(elm);
// first anchor with given name :-D
else if ((elm = getFirstAnchor(document.getElementsByName(hash)))) scrollTo(elm);
// no element and hash == 'top', scroll to the top of the page
else if (hash === 'top') scrollTo(null);
}
// does not scroll when user clicks on anchor link that is currently on
// (no url change, no $location.hash() change), browser native does scroll
if (autoScrollingEnabled) {
$rootScope.$watch(function autoScrollWatch() {return $location.hash();},
function autoScrollWatchAction(newVal, oldVal) {
// skip the initial scroll if $location.hash is empty
if (newVal === oldVal && newVal === '') return;
jqLiteDocumentLoaded(function() {
$rootScope.$evalAsync(scroll);
});
});
}
return scroll;
}];
}
var $animateMinErr = minErr('$animate');
/**
* @ngdoc provider
* @name $animateProvider
*
* @description
* Default implementation of $animate that doesn't perform any animations, instead just
* synchronously performs DOM
* updates and calls done() callbacks.
*
* In order to enable animations the ngAnimate module has to be loaded.
*
* To see the functional implementation check out src/ngAnimate/animate.js
*/
var $AnimateProvider = ['$provide', function($provide) {
this.$$selectors = {};
/**
* @ngdoc method
* @name $animateProvider#register
*
* @description
* Registers a new injectable animation factory function. The factory function produces the
* animation object which contains callback functions for each event that is expected to be
* animated.
*
* * `eventFn`: `function(Element, doneFunction)` The element to animate, the `doneFunction`
* must be called once the element animation is complete. If a function is returned then the
* animation service will use this function to cancel the animation whenever a cancel event is
* triggered.
*
*
* ```js
* return {
* eventFn : function(element, done) {
* //code to run the animation
* //once complete, then run done()
* return function cancellationFunction() {
* //code to cancel the animation
* }
* }
* }
* ```
*
* @param {string} name The name of the animation.
* @param {Function} factory The factory function that will be executed to return the animation
* object.
*/
this.register = function(name, factory) {
var key = name + '-animation';
if (name && name.charAt(0) != '.') throw $animateMinErr('notcsel',
"Expecting class selector starting with '.' got '{0}'.", name);
this.$$selectors[name.substr(1)] = key;
$provide.factory(key, factory);
};
/**
* @ngdoc method
* @name $animateProvider#classNameFilter
*
* @description
* Sets and/or returns the CSS class regular expression that is checked when performing
* an animation. Upon bootstrap the classNameFilter value is not set at all and will
* therefore enable $animate to attempt to perform an animation on any element.
* When setting the classNameFilter value, animations will only be performed on elements
* that successfully match the filter expression. This in turn can boost performance
* for low-powered devices as well as applications containing a lot of structural operations.
* @param {RegExp=} expression The className expression which will be checked against all animations
* @return {RegExp} The current CSS className expression value. If null then there is no expression value
*/
this.classNameFilter = function(expression) {
if (arguments.length === 1) {
this.$$classNameFilter = (expression instanceof RegExp) ? expression : null;
}
return this.$$classNameFilter;
};
this.$get = ['$$q', '$$asyncCallback', '$rootScope', function($$q, $$asyncCallback, $rootScope) {
var currentDefer;
function runAnimationPostDigest(fn) {
var cancelFn, defer = $$q.defer();
defer.promise.$$cancelFn = function ngAnimateMaybeCancel() {
cancelFn && cancelFn();
};
$rootScope.$$postDigest(function ngAnimatePostDigest() {
cancelFn = fn(function ngAnimateNotifyComplete() {
defer.resolve();
});
});
return defer.promise;
}
function resolveElementClasses(element, classes) {
var toAdd = [], toRemove = [];
var hasClasses = createMap();
forEach((element.attr('class') || '').split(/\s+/), function(className) {
hasClasses[className] = true;
});
forEach(classes, function(status, className) {
var hasClass = hasClasses[className];
// If the most recent class manipulation (via $animate) was to remove the class, and the
// element currently has the class, the class is scheduled for removal. Otherwise, if
// the most recent class manipulation (via $animate) was to add the class, and the
// element does not currently have the class, the class is scheduled to be added.
if (status === false && hasClass) {
toRemove.push(className);
} else if (status === true && !hasClass) {
toAdd.push(className);
}
});
return (toAdd.length + toRemove.length) > 0 &&
[toAdd.length ? toAdd : null, toRemove.length ? toRemove : null];
}
function cachedClassManipulation(cache, classes, op) {
for (var i=0, ii = classes.length; i < ii; ++i) {
var className = classes[i];
cache[className] = op;
}
}
function asyncPromise() {
// only serve one instance of a promise in order to save CPU cycles
if (!currentDefer) {
currentDefer = $$q.defer();
$$asyncCallback(function() {
currentDefer.resolve();
currentDefer = null;
});
}
return currentDefer.promise;
}
function applyStyles(element, options) {
if (angular.isObject(options)) {
var styles = extend(options.from || {}, options.to || {});
element.css(styles);
}
}
/**
*
* @ngdoc service
* @name $animate
* @description The $animate service provides rudimentary DOM manipulation functions to
* insert, remove and move elements within the DOM, as well as adding and removing classes.
* This service is the core service used by the ngAnimate $animator service which provides
* high-level animation hooks for CSS and JavaScript.
*
* $animate is available in the AngularJS core, however, the ngAnimate module must be included
* to enable full out animation support. Otherwise, $animate will only perform simple DOM
* manipulation operations.
*
* To learn more about enabling animation support, click here to visit the {@link ngAnimate
* ngAnimate module page} as well as the {@link ngAnimate.$animate ngAnimate $animate service
* page}.
*/
return {
animate: function(element, from, to) {
applyStyles(element, { from: from, to: to });
return asyncPromise();
},
/**
*
* @ngdoc method
* @name $animate#enter
* @kind function
* @description Inserts the element into the DOM either after the `after` element or
* as the first child within the `parent` element. When the function is called a promise
* is returned that will be resolved at a later time.
* @param {DOMElement} element the element which will be inserted into the DOM
* @param {DOMElement} parent the parent element which will append the element as
* a child (if the after element is not present)
* @param {DOMElement} after the sibling element which will append the element
* after itself
* @param {object=} options an optional collection of styles that will be applied to the element.
* @return {Promise} the animation callback promise
*/
enter: function(element, parent, after, options) {
applyStyles(element, options);
after ? after.after(element)
: parent.prepend(element);
return asyncPromise();
},
/**
*
* @ngdoc method
* @name $animate#leave
* @kind function
* @description Removes the element from the DOM. When the function is called a promise
* is returned that will be resolved at a later time.
* @param {DOMElement} element the element which will be removed from the DOM
* @param {object=} options an optional collection of options that will be applied to the element.
* @return {Promise} the animation callback promise
*/
leave: function(element, options) {
element.remove();
return asyncPromise();
},
/**
*
* @ngdoc method
* @name $animate#move
* @kind function
* @description Moves the position of the provided element within the DOM to be placed
* either after the `after` element or inside of the `parent` element. When the function
* is called a promise is returned that will be resolved at a later time.
*
* @param {DOMElement} element the element which will be moved around within the
* DOM
* @param {DOMElement} parent the parent element where the element will be
* inserted into (if the after element is not present)
* @param {DOMElement} after the sibling element where the element will be
* positioned next to
* @param {object=} options an optional collection of options that will be applied to the element.
* @return {Promise} the animation callback promise
*/
move: function(element, parent, after, options) {
// Do not remove element before insert. Removing will cause data associated with the
// element to be dropped. Insert will implicitly do the remove.
return this.enter(element, parent, after, options);
},
/**
*
* @ngdoc method
* @name $animate#addClass
* @kind function
* @description Adds the provided className CSS class value to the provided element.
* When the function is called a promise is returned that will be resolved at a later time.
* @param {DOMElement} element the element which will have the className value
* added to it
* @param {string} className the CSS class which will be added to the element
* @param {object=} options an optional collection of options that will be applied to the element.
* @return {Promise} the animation callback promise
*/
addClass: function(element, className, options) {
return this.setClass(element, className, [], options);
},
$$addClassImmediately: function(element, className, options) {
element = jqLite(element);
className = !isString(className)
? (isArray(className) ? className.join(' ') : '')
: className;
forEach(element, function(element) {
jqLiteAddClass(element, className);
});
applyStyles(element, options);
return asyncPromise();
},
/**
*
* @ngdoc method
* @name $animate#removeClass
* @kind function
* @description Removes the provided className CSS class value from the provided element.
* When the function is called a promise is returned that will be resolved at a later time.
* @param {DOMElement} element the element which will have the className value
* removed from it
* @param {string} className the CSS class which will be removed from the element
* @param {object=} options an optional collection of options that will be applied to the element.
* @return {Promise} the animation callback promise
*/
removeClass: function(element, className, options) {
return this.setClass(element, [], className, options);
},
$$removeClassImmediately: function(element, className, options) {
element = jqLite(element);
className = !isString(className)
? (isArray(className) ? className.join(' ') : '')
: className;
forEach(element, function(element) {
jqLiteRemoveClass(element, className);
});
applyStyles(element, options);
return asyncPromise();
},
/**
*
* @ngdoc method
* @name $animate#setClass
* @kind function
* @description Adds and/or removes the given CSS classes to and from the element.
* When the function is called a promise is returned that will be resolved at a later time.
* @param {DOMElement} element the element which will have its CSS classes changed
* removed from it
* @param {string} add the CSS classes which will be added to the element
* @param {string} remove the CSS class which will be removed from the element
* @param {object=} options an optional collection of options that will be applied to the element.
* @return {Promise} the animation callback promise
*/
setClass: function(element, add, remove, options) {
var self = this;
var STORAGE_KEY = '$$animateClasses';
var createdCache = false;
element = jqLite(element);
var cache = element.data(STORAGE_KEY);
if (!cache) {
cache = {
classes: {},
options: options
};
createdCache = true;
} else if (options && cache.options) {
cache.options = angular.extend(cache.options || {}, options);
}
var classes = cache.classes;
add = isArray(add) ? add : add.split(' ');
remove = isArray(remove) ? remove : remove.split(' ');
cachedClassManipulation(classes, add, true);
cachedClassManipulation(classes, remove, false);
if (createdCache) {
cache.promise = runAnimationPostDigest(function(done) {
var cache = element.data(STORAGE_KEY);
element.removeData(STORAGE_KEY);
// in the event that the element is removed before postDigest
// is run then the cache will be undefined and there will be
// no need anymore to add or remove and of the element classes
if (cache) {
var classes = resolveElementClasses(element, cache.classes);
if (classes) {
self.$$setClassImmediately(element, classes[0], classes[1], cache.options);
}
}
done();
});
element.data(STORAGE_KEY, cache);
}
return cache.promise;
},
$$setClassImmediately: function(element, add, remove, options) {
add && this.$$addClassImmediately(element, add);
remove && this.$$removeClassImmediately(element, remove);
applyStyles(element, options);
return asyncPromise();
},
enabled: noop,
cancel: noop
};
}];
}];
function $$AsyncCallbackProvider() {
this.$get = ['$$rAF', '$timeout', function($$rAF, $timeout) {
return $$rAF.supported
? function(fn) { return $$rAF(fn); }
: function(fn) {
return $timeout(fn, 0, false);
};
}];
}
/* global stripHash: true */
/**
* ! This is a private undocumented service !
*
* @name $browser
* @requires $log
* @description
* This object has two goals:
*
* - hide all the global state in the browser caused by the window object
* - abstract away all the browser specific features and inconsistencies
*
* For tests we provide {@link ngMock.$browser mock implementation} of the `$browser`
* service, which can be used for convenient testing of the application without the interaction with
* the real browser apis.
*/
/**
* @param {object} window The global window object.
* @param {object} document jQuery wrapped document.
* @param {object} $log window.console or an object with the same interface.
* @param {object} $sniffer $sniffer service
*/
function Browser(window, document, $log, $sniffer) {
var self = this,
rawDocument = document[0],
location = window.location,
history = window.history,
setTimeout = window.setTimeout,
clearTimeout = window.clearTimeout,
pendingDeferIds = {};
self.isMock = false;
var outstandingRequestCount = 0;
var outstandingRequestCallbacks = [];
// TODO(vojta): remove this temporary api
self.$$completeOutstandingRequest = completeOutstandingRequest;
self.$$incOutstandingRequestCount = function() { outstandingRequestCount++; };
/**
* Executes the `fn` function(supports currying) and decrements the `outstandingRequestCallbacks`
* counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed.
*/
function completeOutstandingRequest(fn) {
try {
fn.apply(null, sliceArgs(arguments, 1));
} finally {
outstandingRequestCount--;
if (outstandingRequestCount === 0) {
while (outstandingRequestCallbacks.length) {
try {
outstandingRequestCallbacks.pop()();
} catch (e) {
$log.error(e);
}
}
}
}
}
/**
* @private
* Note: this method is used only by scenario runner
* TODO(vojta): prefix this method with $$ ?
* @param {function()} callback Function that will be called when no outstanding request
*/
self.notifyWhenNoOutstandingRequests = function(callback) {
// force browser to execute all pollFns - this is needed so that cookies and other pollers fire
// at some deterministic time in respect to the test runner's actions. Leaving things up to the
// regular poller would result in flaky tests.
forEach(pollFns, function(pollFn) { pollFn(); });
if (outstandingRequestCount === 0) {
callback();
} else {
outstandingRequestCallbacks.push(callback);
}
};
//////////////////////////////////////////////////////////////
// Poll Watcher API
//////////////////////////////////////////////////////////////
var pollFns = [],
pollTimeout;
/**
* @name $browser#addPollFn
*
* @param {function()} fn Poll function to add
*
* @description
* Adds a function to the list of functions that poller periodically executes,
* and starts polling if not started yet.
*
* @returns {function()} the added function
*/
self.addPollFn = function(fn) {
if (isUndefined(pollTimeout)) startPoller(100, setTimeout);
pollFns.push(fn);
return fn;
};
/**
* @param {number} interval How often should browser call poll functions (ms)
* @param {function()} setTimeout Reference to a real or fake `setTimeout` function.
*
* @description
* Configures the poller to run in the specified intervals, using the specified
* setTimeout fn and kicks it off.
*/
function startPoller(interval, setTimeout) {
(function check() {
forEach(pollFns, function(pollFn) { pollFn(); });
pollTimeout = setTimeout(check, interval);
})();
}
//////////////////////////////////////////////////////////////
// URL API
//////////////////////////////////////////////////////////////
var cachedState, lastHistoryState,
lastBrowserUrl = location.href,
baseElement = document.find('base'),
reloadLocation = null;
cacheState();
lastHistoryState = cachedState;
/**
* @name $browser#url
*
* @description
* GETTER:
* Without any argument, this method just returns current value of location.href.
*
* SETTER:
* With at least one argument, this method sets url to new value.
* If html5 history api supported, pushState/replaceState is used, otherwise
* location.href/location.replace is used.
* Returns its own instance to allow chaining
*
* NOTE: this api is intended for use only by the $location service. Please use the
* {@link ng.$location $location service} to change url.
*
* @param {string} url New url (when used as setter)
* @param {boolean=} replace Should new url replace current history record?
* @param {object=} state object to use with pushState/replaceState
*/
self.url = function(url, replace, state) {
// In modern browsers `history.state` is `null` by default; treating it separately
// from `undefined` would cause `$browser.url('/foo')` to change `history.state`
// to undefined via `pushState`. Instead, let's change `undefined` to `null` here.
if (isUndefined(state)) {
state = null;
}
// Android Browser BFCache causes location, history reference to become stale.
if (location !== window.location) location = window.location;
if (history !== window.history) history = window.history;
// setter
if (url) {
var sameState = lastHistoryState === state;
// Don't change anything if previous and current URLs and states match. This also prevents
// IE<10 from getting into redirect loop when in LocationHashbangInHtml5Url mode.
// See https://github.com/angular/angular.js/commit/ffb2701
if (lastBrowserUrl === url && (!$sniffer.history || sameState)) {
return self;
}
var sameBase = lastBrowserUrl && stripHash(lastBrowserUrl) === stripHash(url);
lastBrowserUrl = url;
lastHistoryState = state;
// Don't use history API if only the hash changed
// due to a bug in IE10/IE11 which leads
// to not firing a `hashchange` nor `popstate` event
// in some cases (see #9143).
if ($sniffer.history && (!sameBase || !sameState)) {
history[replace ? 'replaceState' : 'pushState'](state, '', url);
cacheState();
// Do the assignment again so that those two variables are referentially identical.
lastHistoryState = cachedState;
} else {
if (!sameBase) {
reloadLocation = url;
}
if (replace) {
location.replace(url);
} else {
location.href = url;
}
}
return self;
// getter
} else {
// - reloadLocation is needed as browsers don't allow to read out
// the new location.href if a reload happened.
// - the replacement is a workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=407172
return reloadLocation || location.href.replace(/%27/g,"'");
}
};
/**
* @name $browser#state
*
* @description
* This method is a getter.
*
* Return history.state or null if history.state is undefined.
*
* @returns {object} state
*/
self.state = function() {
return cachedState;
};
var urlChangeListeners = [],
urlChangeInit = false;
function cacheStateAndFireUrlChange() {
cacheState();
fireUrlChange();
}
// This variable should be used *only* inside the cacheState function.
var lastCachedState = null;
function cacheState() {
// This should be the only place in $browser where `history.state` is read.
cachedState = window.history.state;
cachedState = isUndefined(cachedState) ? null : cachedState;
// Prevent callbacks fo fire twice if both hashchange & popstate were fired.
if (equals(cachedState, lastCachedState)) {
cachedState = lastCachedState;
}
lastCachedState = cachedState;
}
function fireUrlChange() {
if (lastBrowserUrl === self.url() && lastHistoryState === cachedState) {
return;
}
lastBrowserUrl = self.url();
lastHistoryState = cachedState;
forEach(urlChangeListeners, function(listener) {
listener(self.url(), cachedState);
});
}
/**
* @name $browser#onUrlChange
*
* @description
* Register callback function that will be called, when url changes.
*
* It's only called when the url is changed from outside of angular:
* - user types different url into address bar
* - user clicks on history (forward/back) button
* - user clicks on a link
*
* It's not called when url is changed by $browser.url() method
*
* The listener gets called with new url as parameter.
*
* NOTE: this api is intended for use only by the $location service. Please use the
* {@link ng.$location $location service} to monitor url changes in angular apps.
*
* @param {function(string)} listener Listener function to be called when url changes.
* @return {function(string)} Returns the registered listener fn - handy if the fn is anonymous.
*/
self.onUrlChange = function(callback) {
// TODO(vojta): refactor to use node's syntax for events
if (!urlChangeInit) {
// We listen on both (hashchange/popstate) when available, as some browsers (e.g. Opera)
// don't fire popstate when user change the address bar and don't fire hashchange when url
// changed by push/replaceState
// html5 history api - popstate event
if ($sniffer.history) jqLite(window).on('popstate', cacheStateAndFireUrlChange);
// hashchange event
jqLite(window).on('hashchange', cacheStateAndFireUrlChange);
urlChangeInit = true;
}
urlChangeListeners.push(callback);
return callback;
};
/**
* Checks whether the url has changed outside of Angular.
* Needs to be exported to be able to check for changes that have been done in sync,
* as hashchange/popstate events fire in async.
*/
self.$$checkUrlChange = fireUrlChange;
//////////////////////////////////////////////////////////////
// Misc API
//////////////////////////////////////////////////////////////
/**
* @name $browser#baseHref
*
* @description
* Returns current
* (always relative - without domain)
*
* @returns {string} The current base href
*/
self.baseHref = function() {
var href = baseElement.attr('href');
return href ? href.replace(/^(https?\:)?\/\/[^\/]*/, '') : '';
};
//////////////////////////////////////////////////////////////
// Cookies API
//////////////////////////////////////////////////////////////
var lastCookies = {};
var lastCookieString = '';
var cookiePath = self.baseHref();
function safeDecodeURIComponent(str) {
try {
return decodeURIComponent(str);
} catch (e) {
return str;
}
}
/**
* @name $browser#cookies
*
* @param {string=} name Cookie name
* @param {string=} value Cookie value
*
* @description
* The cookies method provides a 'private' low level access to browser cookies.
* It is not meant to be used directly, use the $cookie service instead.
*
* The return values vary depending on the arguments that the method was called with as follows:
*
* - cookies() -> hash of all cookies, this is NOT a copy of the internal state, so do not modify
* it
* - cookies(name, value) -> set name to value, if value is undefined delete the cookie
* - cookies(name) -> the same as (name, undefined) == DELETES (no one calls it right now that
* way)
*
* @returns {Object} Hash of all cookies (if called without any parameter)
*/
self.cookies = function(name, value) {
var cookieLength, cookieArray, cookie, i, index;
if (name) {
if (value === undefined) {
rawDocument.cookie = encodeURIComponent(name) + "=;path=" + cookiePath +
";expires=Thu, 01 Jan 1970 00:00:00 GMT";
} else {
if (isString(value)) {
cookieLength = (rawDocument.cookie = encodeURIComponent(name) + '=' + encodeURIComponent(value) +
';path=' + cookiePath).length + 1;
// per http://www.ietf.org/rfc/rfc2109.txt browser must allow at minimum:
// - 300 cookies
// - 20 cookies per unique domain
// - 4096 bytes per cookie
if (cookieLength > 4096) {
$log.warn("Cookie '" + name +
"' possibly not set or overflowed because it was too large (" +
cookieLength + " > 4096 bytes)!");
}
}
}
} else {
if (rawDocument.cookie !== lastCookieString) {
lastCookieString = rawDocument.cookie;
cookieArray = lastCookieString.split("; ");
lastCookies = {};
for (i = 0; i < cookieArray.length; i++) {
cookie = cookieArray[i];
index = cookie.indexOf('=');
if (index > 0) { //ignore nameless cookies
name = safeDecodeURIComponent(cookie.substring(0, index));
// the first value that is seen for a cookie is the most
// specific one. values for the same cookie name that
// follow are for less specific paths.
if (lastCookies[name] === undefined) {
lastCookies[name] = safeDecodeURIComponent(cookie.substring(index + 1));
}
}
}
}
return lastCookies;
}
};
/**
* @name $browser#defer
* @param {function()} fn A function, who's execution should be deferred.
* @param {number=} [delay=0] of milliseconds to defer the function execution.
* @returns {*} DeferId that can be used to cancel the task via `$browser.defer.cancel()`.
*
* @description
* Executes a fn asynchronously via `setTimeout(fn, delay)`.
*
* Unlike when calling `setTimeout` directly, in test this function is mocked and instead of using
* `setTimeout` in tests, the fns are queued in an array, which can be programmatically flushed
* via `$browser.defer.flush()`.
*
*/
self.defer = function(fn, delay) {
var timeoutId;
outstandingRequestCount++;
timeoutId = setTimeout(function() {
delete pendingDeferIds[timeoutId];
completeOutstandingRequest(fn);
}, delay || 0);
pendingDeferIds[timeoutId] = true;
return timeoutId;
};
/**
* @name $browser#defer.cancel
*
* @description
* Cancels a deferred task identified with `deferId`.
*
* @param {*} deferId Token returned by the `$browser.defer` function.
* @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully
* canceled.
*/
self.defer.cancel = function(deferId) {
if (pendingDeferIds[deferId]) {
delete pendingDeferIds[deferId];
clearTimeout(deferId);
completeOutstandingRequest(noop);
return true;
}
return false;
};
}
function $BrowserProvider() {
this.$get = ['$window', '$log', '$sniffer', '$document',
function($window, $log, $sniffer, $document) {
return new Browser($window, $document, $log, $sniffer);
}];
}
/**
* @ngdoc service
* @name $cacheFactory
*
* @description
* Factory that constructs {@link $cacheFactory.Cache Cache} objects and gives access to
* them.
*
* ```js
*
* var cache = $cacheFactory('cacheId');
* expect($cacheFactory.get('cacheId')).toBe(cache);
* expect($cacheFactory.get('noSuchCacheId')).not.toBeDefined();
*
* cache.put("key", "value");
* cache.put("another key", "another value");
*
* // We've specified no options on creation
* expect(cache.info()).toEqual({id: 'cacheId', size: 2});
*
* ```
*
*
* @param {string} cacheId Name or id of the newly created cache.
* @param {object=} options Options object that specifies the cache behavior. Properties:
*
* - `{number=}` `capacity` — turns the cache into LRU cache.
*
* @returns {object} Newly created cache object with the following set of methods:
*
* - `{object}` `info()` — Returns id, size, and options of cache.
* - `{{*}}` `put({string} key, {*} value)` — Puts a new key-value pair into the cache and returns
* it.
* - `{{*}}` `get({string} key)` — Returns cached value for `key` or undefined for cache miss.
* - `{void}` `remove({string} key)` — Removes a key-value pair from the cache.
* - `{void}` `removeAll()` — Removes all cached values.
* - `{void}` `destroy()` — Removes references to this cache from $cacheFactory.
*
* @example
Cached Values
:
Cache Info
:
angular.module('cacheExampleApp', []).
controller('CacheController', ['$scope', '$cacheFactory', function($scope, $cacheFactory) {
$scope.keys = [];
$scope.cache = $cacheFactory('cacheId');
$scope.put = function(key, value) {
if ($scope.cache.get(key) === undefined) {
$scope.keys.push(key);
}
$scope.cache.put(key, value === undefined ? null : value);
};
}]);
p {
margin: 10px 0 3px;
}
*/
function $CacheFactoryProvider() {
this.$get = function() {
var caches = {};
function cacheFactory(cacheId, options) {
if (cacheId in caches) {
throw minErr('$cacheFactory')('iid', "CacheId '{0}' is already taken!", cacheId);
}
var size = 0,
stats = extend({}, options, {id: cacheId}),
data = {},
capacity = (options && options.capacity) || Number.MAX_VALUE,
lruHash = {},
freshEnd = null,
staleEnd = null;
/**
* @ngdoc type
* @name $cacheFactory.Cache
*
* @description
* A cache object used to store and retrieve data, primarily used by
* {@link $http $http} and the {@link ng.directive:script script} directive to cache
* templates and other data.
*
* ```js
* angular.module('superCache')
* .factory('superCache', ['$cacheFactory', function($cacheFactory) {
* return $cacheFactory('super-cache');
* }]);
* ```
*
* Example test:
*
* ```js
* it('should behave like a cache', inject(function(superCache) {
* superCache.put('key', 'value');
* superCache.put('another key', 'another value');
*
* expect(superCache.info()).toEqual({
* id: 'super-cache',
* size: 2
* });
*
* superCache.remove('another key');
* expect(superCache.get('another key')).toBeUndefined();
*
* superCache.removeAll();
* expect(superCache.info()).toEqual({
* id: 'super-cache',
* size: 0
* });
* }));
* ```
*/
return caches[cacheId] = {
/**
* @ngdoc method
* @name $cacheFactory.Cache#put
* @kind function
*
* @description
* Inserts a named entry into the {@link $cacheFactory.Cache Cache} object to be
* retrieved later, and incrementing the size of the cache if the key was not already
* present in the cache. If behaving like an LRU cache, it will also remove stale
* entries from the set.
*
* It will not insert undefined values into the cache.
*
* @param {string} key the key under which the cached data is stored.
* @param {*} value the value to store alongside the key. If it is undefined, the key
* will not be stored.
* @returns {*} the value stored.
*/
put: function(key, value) {
if (capacity < Number.MAX_VALUE) {
var lruEntry = lruHash[key] || (lruHash[key] = {key: key});
refresh(lruEntry);
}
if (isUndefined(value)) return;
if (!(key in data)) size++;
data[key] = value;
if (size > capacity) {
this.remove(staleEnd.key);
}
return value;
},
/**
* @ngdoc method
* @name $cacheFactory.Cache#get
* @kind function
*
* @description
* Retrieves named data stored in the {@link $cacheFactory.Cache Cache} object.
*
* @param {string} key the key of the data to be retrieved
* @returns {*} the value stored.
*/
get: function(key) {
if (capacity < Number.MAX_VALUE) {
var lruEntry = lruHash[key];
if (!lruEntry) return;
refresh(lruEntry);
}
return data[key];
},
/**
* @ngdoc method
* @name $cacheFactory.Cache#remove
* @kind function
*
* @description
* Removes an entry from the {@link $cacheFactory.Cache Cache} object.
*
* @param {string} key the key of the entry to be removed
*/
remove: function(key) {
if (capacity < Number.MAX_VALUE) {
var lruEntry = lruHash[key];
if (!lruEntry) return;
if (lruEntry == freshEnd) freshEnd = lruEntry.p;
if (lruEntry == staleEnd) staleEnd = lruEntry.n;
link(lruEntry.n,lruEntry.p);
delete lruHash[key];
}
delete data[key];
size--;
},
/**
* @ngdoc method
* @name $cacheFactory.Cache#removeAll
* @kind function
*
* @description
* Clears the cache object of any entries.
*/
removeAll: function() {
data = {};
size = 0;
lruHash = {};
freshEnd = staleEnd = null;
},
/**
* @ngdoc method
* @name $cacheFactory.Cache#destroy
* @kind function
*
* @description
* Destroys the {@link $cacheFactory.Cache Cache} object entirely,
* removing it from the {@link $cacheFactory $cacheFactory} set.
*/
destroy: function() {
data = null;
stats = null;
lruHash = null;
delete caches[cacheId];
},
/**
* @ngdoc method
* @name $cacheFactory.Cache#info
* @kind function
*
* @description
* Retrieve information regarding a particular {@link $cacheFactory.Cache Cache}.
*
* @returns {object} an object with the following properties:
*
*
**id**: the id of the cache instance
*
**size**: the number of entries kept in the cache instance
*
**...**: any additional properties from the options object when creating the
* cache.
*
*/
info: function() {
return extend({}, stats, {size: size});
}
};
/**
* makes the `entry` the freshEnd of the LRU linked list
*/
function refresh(entry) {
if (entry != freshEnd) {
if (!staleEnd) {
staleEnd = entry;
} else if (staleEnd == entry) {
staleEnd = entry.n;
}
link(entry.n, entry.p);
link(entry, freshEnd);
freshEnd = entry;
freshEnd.n = null;
}
}
/**
* bidirectionally links two entries of the LRU linked list
*/
function link(nextEntry, prevEntry) {
if (nextEntry != prevEntry) {
if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify
if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify
}
}
}
/**
* @ngdoc method
* @name $cacheFactory#info
*
* @description
* Get information about all the caches that have been created
*
* @returns {Object} - key-value map of `cacheId` to the result of calling `cache#info`
*/
cacheFactory.info = function() {
var info = {};
forEach(caches, function(cache, cacheId) {
info[cacheId] = cache.info();
});
return info;
};
/**
* @ngdoc method
* @name $cacheFactory#get
*
* @description
* Get access to a cache object by the `cacheId` used when it was created.
*
* @param {string} cacheId Name or id of a cache to access.
* @returns {object} Cache object identified by the cacheId or undefined if no such cache.
*/
cacheFactory.get = function(cacheId) {
return caches[cacheId];
};
return cacheFactory;
};
}
/**
* @ngdoc service
* @name $templateCache
*
* @description
* The first time a template is used, it is loaded in the template cache for quick retrieval. You
* can load templates directly into the cache in a `script` tag, or by consuming the
* `$templateCache` service directly.
*
* Adding via the `script` tag:
*
* ```html
*
* ```
*
* **Note:** the `script` tag containing the template does not need to be included in the `head` of
* the document, but it must be a descendent of the {@link ng.$rootElement $rootElement} (IE,
* element with ng-app attribute), otherwise the template will be ignored.
*
* Adding via the $templateCache service:
*
* ```js
* var myApp = angular.module('myApp', []);
* myApp.run(function($templateCache) {
* $templateCache.put('templateId.html', 'This is the content of the template');
* });
* ```
*
* To retrieve the template later, simply use it in your HTML:
* ```html
*
* ```
*
* or get it via Javascript:
* ```js
* $templateCache.get('templateId.html')
* ```
*
* See {@link ng.$cacheFactory $cacheFactory}.
*
*/
function $TemplateCacheProvider() {
this.$get = ['$cacheFactory', function($cacheFactory) {
return $cacheFactory('templates');
}];
}
/* ! VARIABLE/FUNCTION NAMING CONVENTIONS THAT APPLY TO THIS FILE!
*
* DOM-related variables:
*
* - "node" - DOM Node
* - "element" - DOM Element or Node
* - "$node" or "$element" - jqLite-wrapped node or element
*
*
* Compiler related stuff:
*
* - "linkFn" - linking fn of a single directive
* - "nodeLinkFn" - function that aggregates all linking fns for a particular node
* - "childLinkFn" - function that aggregates all linking fns for child nodes of a particular node
* - "compositeLinkFn" - function that aggregates all linking fns for a compilation root (nodeList)
*/
/**
* @ngdoc service
* @name $compile
* @kind function
*
* @description
* Compiles an HTML string or DOM into a template and produces a template function, which
* can then be used to link {@link ng.$rootScope.Scope `scope`} and the template together.
*
* The compilation is a process of walking the DOM tree and matching DOM elements to
* {@link ng.$compileProvider#directive directives}.
*
*
* **Note:** This document is an in-depth reference of all directive options.
* For a gentle introduction to directives with examples of common use cases,
* see the {@link guide/directive directive guide}.
*
*
* ## Comprehensive Directive API
*
* There are many different options for a directive.
*
* The difference resides in the return value of the factory function.
* You can either return a "Directive Definition Object" (see below) that defines the directive properties,
* or just the `postLink` function (all other properties will have the default values).
*
*
* **Best Practice:** It's recommended to use the "directive definition object" form.
*
*
* Here's an example directive declared with a Directive Definition Object:
*
* ```js
* var myModule = angular.module(...);
*
* myModule.directive('directiveName', function factory(injectables) {
* var directiveDefinitionObject = {
* priority: 0,
* template: '', // or // function(tElement, tAttrs) { ... },
* // or
* // templateUrl: 'directive.html', // or // function(tElement, tAttrs) { ... },
* transclude: false,
* restrict: 'A',
* templateNamespace: 'html',
* scope: false,
* controller: function($scope, $element, $attrs, $transclude, otherInjectables) { ... },
* controllerAs: 'stringAlias',
* require: 'siblingDirectiveName', // or // ['^parentDirectiveName', '?optionalDirectiveName', '?^optionalParent'],
* compile: function compile(tElement, tAttrs, transclude) {
* return {
* pre: function preLink(scope, iElement, iAttrs, controller) { ... },
* post: function postLink(scope, iElement, iAttrs, controller) { ... }
* }
* // or
* // return function postLink( ... ) { ... }
* },
* // or
* // link: {
* // pre: function preLink(scope, iElement, iAttrs, controller) { ... },
* // post: function postLink(scope, iElement, iAttrs, controller) { ... }
* // }
* // or
* // link: function postLink( ... ) { ... }
* };
* return directiveDefinitionObject;
* });
* ```
*
*
* **Note:** Any unspecified options will use the default value. You can see the default values below.
*
*
* Therefore the above can be simplified as:
*
* ```js
* var myModule = angular.module(...);
*
* myModule.directive('directiveName', function factory(injectables) {
* var directiveDefinitionObject = {
* link: function postLink(scope, iElement, iAttrs) { ... }
* };
* return directiveDefinitionObject;
* // or
* // return function postLink(scope, iElement, iAttrs) { ... }
* });
* ```
*
*
*
* ### Directive Definition Object
*
* The directive definition object provides instructions to the {@link ng.$compile
* compiler}. The attributes are:
*
* #### `multiElement`
* When this property is set to true, the HTML compiler will collect DOM nodes between
* nodes with the attributes `directive-name-start` and `directive-name-end`, and group them
* together as the directive elements. It is recomended that this feature be used on directives
* which are not strictly behavioural (such as {@link ngClick}), and which
* do not manipulate or replace child nodes (such as {@link ngInclude}).
*
* #### `priority`
* When there are multiple directives defined on a single DOM element, sometimes it
* is necessary to specify the order in which the directives are applied. The `priority` is used
* to sort the directives before their `compile` functions get called. Priority is defined as a
* number. Directives with greater numerical `priority` are compiled first. Pre-link functions
* are also run in priority order, but post-link functions are run in reverse order. The order
* of directives with the same priority is undefined. The default priority is `0`.
*
* #### `terminal`
* If set to true then the current `priority` will be the last set of directives
* which will execute (any directives at the current priority will still execute
* as the order of execution on same `priority` is undefined). Note that expressions
* and other directives used in the directive's template will also be excluded from execution.
*
* #### `scope`
* **If set to `true`,** then a new scope will be created for this directive. If multiple directives on the
* same element request a new scope, only one new scope is created. The new scope rule does not
* apply for the root of the template since the root of the template always gets a new scope.
*
* **If set to `{}` (object hash),** then a new "isolate" scope is created. The 'isolate' scope differs from
* normal scope in that it does not prototypically inherit from the parent scope. This is useful
* when creating reusable components, which should not accidentally read or modify data in the
* parent scope.
*
* The 'isolate' scope takes an object hash which defines a set of local scope properties
* derived from the parent scope. These local properties are useful for aliasing values for
* templates. Locals definition is a hash of local scope property to its source:
*
* * `@` or `@attr` - bind a local scope property to the value of DOM attribute. The result is
* always a string since DOM attributes are strings. If no `attr` name is specified then the
* attribute name is assumed to be the same as the local name.
* Given `` and widget definition
* of `scope: { localName:'@myAttr' }`, then widget scope property `localName` will reflect
* the interpolated value of `hello {{name}}`. As the `name` attribute changes so will the
* `localName` property on the widget scope. The `name` is read from the parent scope (not
* component scope).
*
* * `=` or `=attr` - set up bi-directional binding between a local scope property and the
* parent scope property of name defined via the value of the `attr` attribute. If no `attr`
* name is specified then the attribute name is assumed to be the same as the local name.
* Given `` and widget definition of
* `scope: { localModel:'=myAttr' }`, then widget scope property `localModel` will reflect the
* value of `parentModel` on the parent scope. Any changes to `parentModel` will be reflected
* in `localModel` and any changes in `localModel` will reflect in `parentModel`. If the parent
* scope property doesn't exist, it will throw a NON_ASSIGNABLE_MODEL_EXPRESSION exception. You
* can avoid this behavior using `=?` or `=?attr` in order to flag the property as optional. If
* you want to shallow watch for changes (i.e. $watchCollection instead of $watch) you can use
* `=*` or `=*attr` (`=*?` or `=*?attr` if the property is optional).
*
* * `&` or `&attr` - provides a way to execute an expression in the context of the parent scope.
* If no `attr` name is specified then the attribute name is assumed to be the same as the
* local name. Given `` and widget definition of
* `scope: { localFn:'&myAttr' }`, then isolate scope property `localFn` will point to
* a function wrapper for the `count = count + value` expression. Often it's desirable to
* pass data from the isolated scope via an expression to the parent scope, this can be
* done by passing a map of local variable names and values into the expression wrapper fn.
* For example, if the expression is `increment(amount)` then we can specify the amount value
* by calling the `localFn` as `localFn({amount: 22})`.
*
*
* #### `bindToController`
* When an isolate scope is used for a component (see above), and `controllerAs` is used, `bindToController: true` will
* allow a component to have its properties bound to the controller, rather than to scope. When the controller
* is instantiated, the initial values of the isolate scope bindings are already available.
*
* #### `controller`
* Controller constructor function. The controller is instantiated before the
* pre-linking phase and it is shared with other directives (see
* `require` attribute). This allows the directives to communicate with each other and augment
* each other's behavior. The controller is injectable (and supports bracket notation) with the following locals:
*
* * `$scope` - Current scope associated with the element
* * `$element` - Current element
* * `$attrs` - Current attributes object for the element
* * `$transclude` - A transclude linking function pre-bound to the correct transclusion scope:
* `function([scope], cloneLinkingFn, futureParentElement)`.
* * `scope`: optional argument to override the scope.
* * `cloneLinkingFn`: optional argument to create clones of the original transcluded content.
* * `futureParentElement`:
* * defines the parent to which the `cloneLinkingFn` will add the cloned elements.
* * default: `$element.parent()` resp. `$element` for `transclude:'element'` resp. `transclude:true`.
* * only needed for transcludes that are allowed to contain non html elements (e.g. SVG elements)
* and when the `cloneLinkinFn` is passed,
* as those elements need to created and cloned in a special way when they are defined outside their
* usual containers (e.g. like `
*
* @param {string|function=} stateConfig.templateUrl
*
*
* path or function that returns a path to an html
* template that should be used by uiView.
*
* If `templateUrl` is a function, it will be called with the following parameters:
*
* - {array.<object>} - state parameters extracted from the current $location.path() by
* applying the current state
*
*
*
* @param {string|function=} stateConfig.controller
*
*
* Controller fn that should be associated with newly
* related scope or the name of a registered controller if passed as a string.
* Optionally, the ControllerAs may be declared here.
*
controller: "MyRegisteredController"
*
controller:
* "MyRegisteredController as fooCtrl"}
*
* @param {string=} stateConfig.controllerAs
*
*
* A controller alias name. If present the controller will be
* published to scope under the controllerAs name.
*
controllerAs: "myCtrl"
*
* @param {object=} stateConfig.resolve
*
*
* An optional map<string, function> of dependencies which
* should be injected into the controller. If any of these dependencies are promises,
* the router will wait for them all to be resolved before the controller is instantiated.
* If all the promises are resolved successfully, the $stateChangeSuccess event is fired
* and the values of the resolved promises are injected into any controllers that reference them.
* If any of the promises are rejected the $stateChangeError event is fired.
*
* The map object is:
*
* - key - {string}: name of dependency to be injected into controller
* - factory - {string|function}: If string then it is alias for service. Otherwise if function,
* it is injected and return value it treated as dependency. If result is a promise, it is
* resolved before its value is injected into controller.
*
*
*
* @param {string=} stateConfig.url
*
*
* A url fragment with optional parameters. When a state is navigated or
* transitioned to, the `$stateParams` service will be populated with any
* parameters that were passed.
*
* examples:
*
* url: "/messages/:mailboxid?{before:date}&{after:date}"
*
* @param {object=} stateConfig.views
*
* an optional map<string, object> which defined multiple views, or targets views
* manually/explicitly.
*
* Examples:
*
* Targets three named `ui-view`s in the parent state's template
*
*
* @param {boolean=} [stateConfig.abstract=false]
*
* An abstract state will never be directly activated,
* but can provide inherited properties to its common children states.
*
abstract: true
*
* @param {function=} stateConfig.onEnter
*
*
* Callback function for when a state is entered. Good way
* to trigger an action or dispatch an event, such as opening a dialog.
* If minifying your scripts, make sure to explictly annotate this function,
* because it won't be automatically annotated by your build tools.
*
*
*
* @param {function=} stateConfig.onExit
*
*
* Callback function for when a state is exited. Good way to
* trigger an action or dispatch an event, such as opening a dialog.
* If minifying your scripts, make sure to explictly annotate this function,
* because it won't be automatically annotated by your build tools.
*
*
*
* @param {boolean=} [stateConfig.reloadOnSearch=true]
*
*
* If `false`, will not retrigger the same state
* just because a search/query parameter has changed (via $location.search() or $location.hash()).
* Useful for when you'd like to modify $location.search() without triggering a reload.
*
reloadOnSearch: false
*
* @param {object=} stateConfig.data
*
*
* Arbitrary data object, useful for custom configuration. The parent state's `data` is
* prototypally inherited. In other words, adding a data property to a state adds it to
* the entire subtree via prototypal inheritance.
*
*
data: {
* requiredRole: 'foo'
* }
*
* @param {object=} stateConfig.params
*
*
* A map which optionally configures parameters declared in the `url`, or
* defines additional non-url parameters. For each parameter being
* configured, add a configuration object keyed to the name of the parameter.
*
* Each parameter configuration object may contain the following properties:
*
* - ** value ** - {object|function=}: specifies the default value for this
* parameter. This implicitly sets this parameter as optional.
*
* When UI-Router routes to a state and no value is
* specified for this parameter in the URL or transition, the
* default value will be used instead. If `value` is a function,
* it will be injected and invoked, and the return value used.
*
* *Note*: `undefined` is treated as "no default value" while `null`
* is treated as "the default value is `null`".
*
* *Shorthand*: If you only need to configure the default value of the
* parameter, you may use a shorthand syntax. In the **`params`**
* map, instead mapping the param name to a full parameter configuration
* object, simply set map it to the default parameter value, e.g.:
*
*
*
* - ** array ** - {boolean=}: *(default: false)* If true, the param value will be
* treated as an array of values. If you specified a Type, the value will be
* treated as an array of the specified Type. Note: query parameter values
* default to a special `"auto"` mode.
*
* For query parameters in `"auto"` mode, if multiple values for a single parameter
* are present in the URL (e.g.: `/foo?bar=1&bar=2&bar=3`) then the values
* are mapped to an array (e.g.: `{ foo: [ '1', '2', '3' ] }`). However, if
* only one value is present (e.g.: `/foo?bar=1`) then the value is treated as single
* value (e.g.: `{ foo: '1' }`).
*
*
params: {
* param1: { array: true }
* }
*
* - ** squash ** - {bool|string=}: `squash` configures how a default parameter value is represented in the URL when
* the current parameter value is the same as the default value. If `squash` is not set, it uses the
* configured default squash policy.
* (See {@link ui.router.util.$urlMatcherFactory#methods_defaultSquashPolicy `defaultSquashPolicy()`})
*
* There are three squash settings:
*
* - false: The parameter's default value is not squashed. It is encoded and included in the URL
* - true: The parameter's default value is omitted from the URL. If the parameter is preceeded and followed
* by slashes in the state's `url` declaration, then one of those slashes are omitted.
* This can allow for cleaner looking URLs.
* - `""`: The parameter's default value is replaced with an arbitrary placeholder of your choice.
*
*
* // Some state name examples
*
* // stateName can be a single top-level name (must be unique).
* $stateProvider.state("home", {});
*
* // Or it can be a nested state name. This state is a child of the
* // above "home" state.
* $stateProvider.state("home.newest", {});
*
* // Nest states as deeply as needed.
* $stateProvider.state("home.newest.abc.xyz.inception", {});
*
* // state() returns $stateProvider, so you can chain state declarations.
* $stateProvider
* .state("home", {})
* .state("about", {})
* .state("contacts", {});
*
*
*/
this.state = state;
function state(name, definition) {
/*jshint validthis: true */
if (isObject(name)) definition = name;
else definition.name = name;
registerState(definition);
return this;
}
/**
* @ngdoc object
* @name ui.router.state.$state
*
* @requires $rootScope
* @requires $q
* @requires ui.router.state.$view
* @requires $injector
* @requires ui.router.util.$resolve
* @requires ui.router.state.$stateParams
* @requires ui.router.router.$urlRouter
*
* @property {object} params A param object, e.g. {sectionId: section.id)}, that
* you'd like to test against the current active state.
* @property {object} current A reference to the state's config object. However
* you passed it in. Useful for accessing custom data.
* @property {object} transition Currently pending transition. A promise that'll
* resolve or reject.
*
* @description
* `$state` service is responsible for representing states as well as transitioning
* between them. It also provides interfaces to ask for current state or even states
* you're coming from.
*/
this.$get = $get;
$get.$inject = ['$rootScope', '$q', '$view', '$injector', '$resolve', '$stateParams', '$urlRouter', '$location', '$urlMatcherFactory'];
function $get( $rootScope, $q, $view, $injector, $resolve, $stateParams, $urlRouter, $location, $urlMatcherFactory) {
var TransitionSuperseded = $q.reject(new Error('transition superseded'));
var TransitionPrevented = $q.reject(new Error('transition prevented'));
var TransitionAborted = $q.reject(new Error('transition aborted'));
var TransitionFailed = $q.reject(new Error('transition failed'));
// Handles the case where a state which is the target of a transition is not found, and the user
// can optionally retry or defer the transition
function handleRedirect(redirect, state, params, options) {
/**
* @ngdoc event
* @name ui.router.state.$state#$stateNotFound
* @eventOf ui.router.state.$state
* @eventType broadcast on root scope
* @description
* Fired when a requested state **cannot be found** using the provided state name during transition.
* The event is broadcast allowing any handlers a single chance to deal with the error (usually by
* lazy-loading the unfound state). A special `unfoundState` object is passed to the listener handler,
* you can see its three properties in the example. You can use `event.preventDefault()` to abort the
* transition and the promise returned from `go` will be rejected with a `'transition aborted'` value.
*
* @param {Object} event Event object.
* @param {Object} unfoundState Unfound State information. Contains: `to, toParams, options` properties.
* @param {State} fromState Current state object.
* @param {Object} fromParams Current state params.
*
* @example
*
*
*
* @returns {promise} A promise representing the state of the new transition. See
* {@link ui.router.state.$state#methods_go $state.go}.
*/
$state.reload = function reload() {
return $state.transitionTo($state.current, $stateParams, { reload: true, inherit: false, notify: true });
};
/**
* @ngdoc function
* @name ui.router.state.$state#go
* @methodOf ui.router.state.$state
*
* @description
* Convenience method for transitioning to a new state. `$state.go` calls
* `$state.transitionTo` internally but automatically sets options to
* `{ location: true, inherit: true, relative: $state.$current, notify: true }`.
* This allows you to easily use an absolute or relative to path and specify
* only the parameters you'd like to update (while letting unspecified parameters
* inherit from the currently active ancestor states).
*
* @example
*
* var app = angular.module('app', ['ui.router']);
*
* app.controller('ctrl', function ($scope, $state) {
* $scope.changeState = function () {
* $state.go('contact.detail');
* };
* });
*
*
*
* @param {string} to Absolute state name or relative state path. Some examples:
*
* - `$state.go('contact.detail')` - will go to the `contact.detail` state
* - `$state.go('^')` - will go to a parent state
* - `$state.go('^.sibling')` - will go to a sibling state
* - `$state.go('.child.grandchild')` - will go to grandchild state
*
* @param {object=} params A map of the parameters that will be sent to the state,
* will populate $stateParams. Any parameters that are not specified will be inherited from currently
* defined parameters. This allows, for example, going to a sibling state that shares parameters
* specified in a parent state. Parameter inheritance only works between common ancestor states, I.e.
* transitioning to a sibling will get you the parameters for all parents, transitioning to a child
* will get you all current parameters, etc.
* @param {object=} options Options object. The options are:
*
* - **`location`** - {boolean=true|string=} - If `true` will update the url in the location bar, if `false`
* will not. If string, must be `"replace"`, which will update url and also replace last history record.
* - **`inherit`** - {boolean=true}, If `true` will inherit url parameters from current url.
* - **`relative`** - {object=$state.$current}, When transitioning with relative path (e.g '^'),
* defines which state to be relative from.
* - **`notify`** - {boolean=true}, If `true` will broadcast $stateChangeStart and $stateChangeSuccess events.
* - **`reload`** (v0.2.5) - {boolean=false}, If `true` will force transition even if the state or params
* have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd
* use this when you want to force a reload when *everything* is the same, including search params.
*
* @returns {promise} A promise representing the state of the new transition.
*
* Possible success values:
*
* - $state.current
*
* Possible rejection values:
*
* - 'transition superseded' - when a newer transition has been started after this one
* - 'transition prevented' - when `event.preventDefault()` has been called in a `$stateChangeStart` listener
* - 'transition aborted' - when `event.preventDefault()` has been called in a `$stateNotFound` listener or
* when a `$stateNotFound` `event.retry` promise errors.
* - 'transition failed' - when a state has been unsuccessfully found after 2 tries.
* - *resolve error* - when an error has occurred with a `resolve`
*
*/
$state.go = function go(to, params, options) {
return $state.transitionTo(to, params, extend({ inherit: true, relative: $state.$current }, options));
};
/**
* @ngdoc function
* @name ui.router.state.$state#transitionTo
* @methodOf ui.router.state.$state
*
* @description
* Low-level method for transitioning to a new state. {@link ui.router.state.$state#methods_go $state.go}
* uses `transitionTo` internally. `$state.go` is recommended in most situations.
*
* @example
*
* var app = angular.module('app', ['ui.router']);
*
* app.controller('ctrl', function ($scope, $state) {
* $scope.changeState = function () {
* $state.transitionTo('contact.detail');
* };
* });
*
*
* @param {string} to State name.
* @param {object=} toParams A map of the parameters that will be sent to the state,
* will populate $stateParams.
* @param {object=} options Options object. The options are:
*
* - **`location`** - {boolean=true|string=} - If `true` will update the url in the location bar, if `false`
* will not. If string, must be `"replace"`, which will update url and also replace last history record.
* - **`inherit`** - {boolean=false}, If `true` will inherit url parameters from current url.
* - **`relative`** - {object=}, When transitioning with relative path (e.g '^'),
* defines which state to be relative from.
* - **`notify`** - {boolean=true}, If `true` will broadcast $stateChangeStart and $stateChangeSuccess events.
* - **`reload`** (v0.2.5) - {boolean=false}, If `true` will force transition even if the state or params
* have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd
* use this when you want to force a reload when *everything* is the same, including search params.
*
* @returns {promise} A promise representing the state of the new transition. See
* {@link ui.router.state.$state#methods_go $state.go}.
*/
$state.transitionTo = function transitionTo(to, toParams, options) {
toParams = toParams || {};
options = extend({
location: true, inherit: false, relative: null, notify: true, reload: false, $retry: false
}, options || {});
var from = $state.$current, fromParams = $state.params, fromPath = from.path;
var evt, toState = findState(to, options.relative);
if (!isDefined(toState)) {
var redirect = { to: to, toParams: toParams, options: options };
var redirectResult = handleRedirect(redirect, from.self, fromParams, options);
if (redirectResult) {
return redirectResult;
}
// Always retry once if the $stateNotFound was not prevented
// (handles either redirect changed or state lazy-definition)
to = redirect.to;
toParams = redirect.toParams;
options = redirect.options;
toState = findState(to, options.relative);
if (!isDefined(toState)) {
if (!options.relative) throw new Error("No such state '" + to + "'");
throw new Error("Could not resolve '" + to + "' from state '" + options.relative + "'");
}
}
if (toState[abstractKey]) throw new Error("Cannot transition to abstract state '" + to + "'");
if (options.inherit) toParams = inheritParams($stateParams, toParams || {}, $state.$current, toState);
if (!toState.params.$$validates(toParams)) return TransitionFailed;
toParams = toState.params.$$values(toParams);
to = toState;
var toPath = to.path;
// Starting from the root of the path, keep all levels that haven't changed
var keep = 0, state = toPath[keep], locals = root.locals, toLocals = [];
if (!options.reload) {
while (state && state === fromPath[keep] && state.ownParams.$$equals(toParams, fromParams)) {
locals = toLocals[keep] = state.locals;
keep++;
state = toPath[keep];
}
}
// If we're going to the same state and all locals are kept, we've got nothing to do.
// But clear 'transition', as we still want to cancel any other pending transitions.
// TODO: We may not want to bump 'transition' if we're called from a location change
// that we've initiated ourselves, because we might accidentally abort a legitimate
// transition initiated from code?
if (shouldTriggerReload(to, from, locals, options)) {
if (to.self.reloadOnSearch !== false) $urlRouter.update();
$state.transition = null;
return $q.when($state.current);
}
// Filter parameters before we pass them to event handlers etc.
toParams = filterByKeys(to.params.$$keys(), toParams || {});
// Broadcast start event and cancel the transition if requested
if (options.notify) {
/**
* @ngdoc event
* @name ui.router.state.$state#$stateChangeStart
* @eventOf ui.router.state.$state
* @eventType broadcast on root scope
* @description
* Fired when the state transition **begins**. You can use `event.preventDefault()`
* to prevent the transition from happening and then the transition promise will be
* rejected with a `'transition prevented'` value.
*
* @param {Object} event Event object.
* @param {State} toState The state being transitioned to.
* @param {Object} toParams The params supplied to the `toState`.
* @param {State} fromState The current state, pre-transition.
* @param {Object} fromParams The params supplied to the `fromState`.
*
* @example
*
*
* $rootScope.$on('$stateChangeStart',
* function(event, toState, toParams, fromState, fromParams){
* event.preventDefault();
* // transitionTo() promise will be rejected with
* // a 'transition prevented' error
* })
*
*/
if ($rootScope.$broadcast('$stateChangeStart', to.self, toParams, from.self, fromParams).defaultPrevented) {
$urlRouter.update();
return TransitionPrevented;
}
}
// Resolve locals for the remaining states, but don't update any global state just
// yet -- if anything fails to resolve the current state needs to remain untouched.
// We also set up an inheritance chain for the locals here. This allows the view directive
// to quickly look up the correct definition for each view in the current state. Even
// though we create the locals object itself outside resolveState(), it is initially
// empty and gets filled asynchronously. We need to keep track of the promise for the
// (fully resolved) current locals, and pass this down the chain.
var resolved = $q.when(locals);
for (var l = keep; l < toPath.length; l++, state = toPath[l]) {
locals = toLocals[l] = inherit(locals);
resolved = resolveState(state, toParams, state === to, resolved, locals, options);
}
// Once everything is resolved, we are ready to perform the actual transition
// and return a promise for the new state. We also keep track of what the
// current promise is, so that we can detect overlapping transitions and
// keep only the outcome of the last transition.
var transition = $state.transition = resolved.then(function () {
var l, entering, exiting;
if ($state.transition !== transition) return TransitionSuperseded;
// Exit 'from' states not kept
for (l = fromPath.length - 1; l >= keep; l--) {
exiting = fromPath[l];
if (exiting.self.onExit) {
$injector.invoke(exiting.self.onExit, exiting.self, exiting.locals.globals);
}
exiting.locals = null;
}
// Enter 'to' states not kept
for (l = keep; l < toPath.length; l++) {
entering = toPath[l];
entering.locals = toLocals[l];
if (entering.self.onEnter) {
$injector.invoke(entering.self.onEnter, entering.self, entering.locals.globals);
}
}
// Run it again, to catch any transitions in callbacks
if ($state.transition !== transition) return TransitionSuperseded;
// Update globals in $state
$state.$current = to;
$state.current = to.self;
$state.params = toParams;
copy($state.params, $stateParams);
$state.transition = null;
if (options.location && to.navigable) {
$urlRouter.push(to.navigable.url, to.navigable.locals.globals.$stateParams, {
$$avoidResync: true, replace: options.location === 'replace'
});
}
if (options.notify) {
/**
* @ngdoc event
* @name ui.router.state.$state#$stateChangeSuccess
* @eventOf ui.router.state.$state
* @eventType broadcast on root scope
* @description
* Fired once the state transition is **complete**.
*
* @param {Object} event Event object.
* @param {State} toState The state being transitioned to.
* @param {Object} toParams The params supplied to the `toState`.
* @param {State} fromState The current state, pre-transition.
* @param {Object} fromParams The params supplied to the `fromState`.
*/
$rootScope.$broadcast('$stateChangeSuccess', to.self, toParams, from.self, fromParams);
}
$urlRouter.update(true);
return $state.current;
}, function (error) {
if ($state.transition !== transition) return TransitionSuperseded;
$state.transition = null;
/**
* @ngdoc event
* @name ui.router.state.$state#$stateChangeError
* @eventOf ui.router.state.$state
* @eventType broadcast on root scope
* @description
* Fired when an **error occurs** during transition. It's important to note that if you
* have any errors in your resolve functions (javascript errors, non-existent services, etc)
* they will not throw traditionally. You must listen for this $stateChangeError event to
* catch **ALL** errors.
*
* @param {Object} event Event object.
* @param {State} toState The state being transitioned to.
* @param {Object} toParams The params supplied to the `toState`.
* @param {State} fromState The current state, pre-transition.
* @param {Object} fromParams The params supplied to the `fromState`.
* @param {Error} error The resolve error object.
*/
evt = $rootScope.$broadcast('$stateChangeError', to.self, toParams, from.self, fromParams, error);
if (!evt.defaultPrevented) {
$urlRouter.update();
}
return $q.reject(error);
});
return transition;
};
/**
* @ngdoc function
* @name ui.router.state.$state#is
* @methodOf ui.router.state.$state
*
* @description
* Similar to {@link ui.router.state.$state#methods_includes $state.includes},
* but only checks for the full state name. If params is supplied then it will be
* tested for strict equality against the current active params object, so all params
* must match with none missing and no extras.
*
* @example
*
* $state.$current.name = 'contacts.details.item';
*
* // absolute name
* $state.is('contact.details.item'); // returns true
* $state.is(contactDetailItemStateObject); // returns true
*
* // relative name (. and ^), typically from a template
* // E.g. from the 'contacts.details' template
*
Item
*
*
* @param {string|object} stateOrName The state name (absolute or relative) or state object you'd like to check.
* @param {object=} params A param object, e.g. `{sectionId: section.id}`, that you'd like
* to test against the current active state.
* @param {object=} options An options object. The options are:
*
* - **`relative`** - {string|object} - If `stateOrName` is a relative state name and `options.relative` is set, .is will
* test relative to `options.relative` state (or name).
*
* @returns {boolean} Returns true if it is the state.
*/
$state.is = function is(stateOrName, params, options) {
options = extend({ relative: $state.$current }, options || {});
var state = findState(stateOrName, options.relative);
if (!isDefined(state)) { return undefined; }
if ($state.$current !== state) { return false; }
return params ? equalForKeys(state.params.$$values(params), $stateParams) : true;
};
/**
* @ngdoc function
* @name ui.router.state.$state#includes
* @methodOf ui.router.state.$state
*
* @description
* A method to determine if the current active state is equal to or is the child of the
* state stateName. If any params are passed then they will be tested for a match as well.
* Not all the parameters need to be passed, just the ones you'd like to test for equality.
*
* @example
* Partial and relative names
*
* $state.$current.name = 'contacts.details.item';
*
* // Using partial names
* $state.includes("contacts"); // returns true
* $state.includes("contacts.details"); // returns true
* $state.includes("contacts.details.item"); // returns true
* $state.includes("contacts.list"); // returns false
* $state.includes("about"); // returns false
*
* // Using relative names (. and ^), typically from a template
* // E.g. from the 'contacts.details' template
*
*
* @param {string} stateOrName A partial name, relative name, or glob pattern
* to be searched for within the current state name.
* @param {object=} params A param object, e.g. `{sectionId: section.id}`,
* that you'd like to test against the current active state.
* @param {object=} options An options object. The options are:
*
* - **`relative`** - {string|object=} - If `stateOrName` is a relative state reference and `options.relative` is set,
* .includes will test relative to `options.relative` state (or name).
*
* @returns {boolean} Returns true if it does include the state
*/
$state.includes = function includes(stateOrName, params, options) {
options = extend({ relative: $state.$current }, options || {});
if (isString(stateOrName) && isGlob(stateOrName)) {
if (!doesStateMatchGlob(stateOrName)) {
return false;
}
stateOrName = $state.$current.name;
}
var state = findState(stateOrName, options.relative);
if (!isDefined(state)) { return undefined; }
if (!isDefined($state.$current.includes[state.name])) { return false; }
return params ? equalForKeys(state.params.$$values(params), $stateParams, objectKeys(params)) : true;
};
/**
* @ngdoc function
* @name ui.router.state.$state#href
* @methodOf ui.router.state.$state
*
* @description
* A url generation method that returns the compiled url for the given state populated with the given params.
*
* @example
*
*
* @param {string|object} stateOrName The state name or state object you'd like to generate a url from.
* @param {object=} params An object of parameter values to fill the state's required parameters.
* @param {object=} options Options object. The options are:
*
* - **`lossy`** - {boolean=true} - If true, and if there is no url associated with the state provided in the
* first parameter, then the constructed href url will be built from the first navigable ancestor (aka
* ancestor with a valid url).
* - **`inherit`** - {boolean=true}, If `true` will inherit url parameters from current url.
* - **`relative`** - {object=$state.$current}, When transitioning with relative path (e.g '^'),
* defines which state to be relative from.
* - **`absolute`** - {boolean=false}, If true will generate an absolute url, e.g. "http://www.example.com/fullurl".
*
* @returns {string} compiled state url
*/
$state.href = function href(stateOrName, params, options) {
options = extend({
lossy: true,
inherit: true,
absolute: false,
relative: $state.$current
}, options || {});
var state = findState(stateOrName, options.relative);
if (!isDefined(state)) return null;
if (options.inherit) params = inheritParams($stateParams, params || {}, $state.$current, state);
var nav = (state && options.lossy) ? state.navigable : state;
if (!nav || nav.url === undefined || nav.url === null) {
return null;
}
return $urlRouter.href(nav.url, filterByKeys(state.params.$$keys(), params || {}), {
absolute: options.absolute
});
};
/**
* @ngdoc function
* @name ui.router.state.$state#get
* @methodOf ui.router.state.$state
*
* @description
* Returns the state configuration object for any specific state or all states.
*
* @param {string|object=} stateOrName (absolute or relative) If provided, will only get the config for
* the requested state. If not provided, returns an array of ALL state configs.
* @param {string|object=} context When stateOrName is a relative state reference, the state will be retrieved relative to context.
* @returns {Object|Array} State configuration object or array of all objects.
*/
$state.get = function (stateOrName, context) {
if (arguments.length === 0) return map(objectKeys(states), function(name) { return states[name].self; });
var state = findState(stateOrName, context || $state.$current);
return (state && state.self) ? state.self : null;
};
function resolveState(state, params, paramsAreFiltered, inherited, dst, options) {
// Make a restricted $stateParams with only the parameters that apply to this state if
// necessary. In addition to being available to the controller and onEnter/onExit callbacks,
// we also need $stateParams to be available for any $injector calls we make during the
// dependency resolution process.
var $stateParams = (paramsAreFiltered) ? params : filterByKeys(state.params.$$keys(), params);
var locals = { $stateParams: $stateParams };
// Resolve 'global' dependencies for the state, i.e. those not specific to a view.
// We're also including $stateParams in this; that way the parameters are restricted
// to the set that should be visible to the state, and are independent of when we update
// the global $state and $stateParams values.
dst.resolve = $resolve.resolve(state.resolve, locals, dst.resolve, state);
var promises = [dst.resolve.then(function (globals) {
dst.globals = globals;
})];
if (inherited) promises.push(inherited);
// Resolve template and dependencies for all views.
forEach(state.views, function (view, name) {
var injectables = (view.resolve && view.resolve !== state.resolve ? view.resolve : {});
injectables.$template = [ function () {
return $view.load(name, { view: view, locals: locals, params: $stateParams, notify: options.notify }) || '';
}];
promises.push($resolve.resolve(injectables, locals, dst.resolve, state).then(function (result) {
// References to the controller (only instantiated at link time)
if (isFunction(view.controllerProvider) || isArray(view.controllerProvider)) {
var injectLocals = angular.extend({}, injectables, locals);
result.$$controller = $injector.invoke(view.controllerProvider, null, injectLocals);
} else {
result.$$controller = view.controller;
}
// Provide access to the state itself for internal use
result.$$state = state;
result.$$controllerAs = view.controllerAs;
dst[name] = result;
}));
});
// Wait for all the promises and then return the activation object
return $q.all(promises).then(function (values) {
return dst;
});
}
return $state;
}
function shouldTriggerReload(to, from, locals, options) {
if (to === from && ((locals === from.locals && !options.reload) || (to.self.reloadOnSearch === false))) {
return true;
}
}
}
angular.module('ui.router.state')
.value('$stateParams', {})
.provider('$state', $StateProvider);
$ViewProvider.$inject = [];
function $ViewProvider() {
this.$get = $get;
/**
* @ngdoc object
* @name ui.router.state.$view
*
* @requires ui.router.util.$templateFactory
* @requires $rootScope
*
* @description
*
*/
$get.$inject = ['$rootScope', '$templateFactory'];
function $get( $rootScope, $templateFactory) {
return {
// $view.load('full.viewName', { template: ..., controller: ..., resolve: ..., async: false, params: ... })
/**
* @ngdoc function
* @name ui.router.state.$view#load
* @methodOf ui.router.state.$view
*
* @description
*
* @param {string} name name
* @param {object} options option object.
*/
load: function load(name, options) {
var result, defaults = {
template: null, controller: null, view: null, locals: null, notify: true, async: true, params: {}
};
options = extend(defaults, options);
if (options.view) {
result = $templateFactory.fromConfig(options.view, options.params, options.locals);
}
if (result && options.notify) {
/**
* @ngdoc event
* @name ui.router.state.$state#$viewContentLoading
* @eventOf ui.router.state.$view
* @eventType broadcast on root scope
* @description
*
* Fired once the view **begins loading**, *before* the DOM is rendered.
*
* @param {Object} event Event object.
* @param {Object} viewConfig The view config properties (template, controller, etc).
*
* @example
*
*
* $scope.$on('$viewContentLoading',
* function(event, viewConfig){
* // Access to all the view config properties.
* // and one special property 'targetView'
* // viewConfig.targetView
* });
*
*/
$rootScope.$broadcast('$viewContentLoading', options);
}
return result;
}
};
}
}
angular.module('ui.router.state').provider('$view', $ViewProvider);
/**
* @ngdoc object
* @name ui.router.state.$uiViewScrollProvider
*
* @description
* Provider that returns the {@link ui.router.state.$uiViewScroll} service function.
*/
function $ViewScrollProvider() {
var useAnchorScroll = false;
/**
* @ngdoc function
* @name ui.router.state.$uiViewScrollProvider#useAnchorScroll
* @methodOf ui.router.state.$uiViewScrollProvider
*
* @description
* Reverts back to using the core [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll) service for
* scrolling based on the url anchor.
*/
this.useAnchorScroll = function () {
useAnchorScroll = true;
};
/**
* @ngdoc object
* @name ui.router.state.$uiViewScroll
*
* @requires $anchorScroll
* @requires $timeout
*
* @description
* When called with a jqLite element, it scrolls the element into view (after a
* `$timeout` so the DOM has time to refresh).
*
* If you prefer to rely on `$anchorScroll` to scroll the view to the anchor,
* this can be enabled by calling {@link ui.router.state.$uiViewScrollProvider#methods_useAnchorScroll `$uiViewScrollProvider.useAnchorScroll()`}.
*/
this.$get = ['$anchorScroll', '$timeout', function ($anchorScroll, $timeout) {
if (useAnchorScroll) {
return $anchorScroll;
}
return function ($element) {
$timeout(function () {
$element[0].scrollIntoView();
}, 0, false);
};
}];
}
angular.module('ui.router.state').provider('$uiViewScroll', $ViewScrollProvider);
/**
* @ngdoc directive
* @name ui.router.state.directive:ui-view
*
* @requires ui.router.state.$state
* @requires $compile
* @requires $controller
* @requires $injector
* @requires ui.router.state.$uiViewScroll
* @requires $document
*
* @restrict ECA
*
* @description
* The ui-view directive tells $state where to place your templates.
*
* @param {string=} name A view name. The name should be unique amongst the other views in the
* same state. You can have views of the same name that live in different states.
*
* @param {string=} autoscroll It allows you to set the scroll behavior of the browser window
* when a view is populated. By default, $anchorScroll is overridden by ui-router's custom scroll
* service, {@link ui.router.state.$uiViewScroll}. This custom service let's you
* scroll ui-view elements into view when they are populated during a state activation.
*
* *Note: To revert back to old [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll)
* functionality, call `$uiViewScrollProvider.useAnchorScroll()`.*
*
* @param {string=} onload Expression to evaluate whenever the view updates.
*
* @example
* A view can be unnamed or named.
*
*
*
*
*
*
*
*
* You can only have one unnamed view within any template (or root html). If you are only using a
* single view and it is unnamed then you can populate it like so:
*
*
* $stateProvider.state("home", {
* template: "
HELLO!
"
* })
*
*
* The above is a convenient shortcut equivalent to specifying your view explicitly with the {@link ui.router.state.$stateProvider#views `views`}
* config property, by name, in this case an empty name:
*
*
* But typically you'll only use the views property if you name your view or have more than one view
* in the same template. There's not really a compelling reason to name a view if its the only one,
* but you could if you wanted, like so:
*
*/
$ViewDirective.$inject = ['$state', '$injector', '$uiViewScroll', '$interpolate'];
function $ViewDirective( $state, $injector, $uiViewScroll, $interpolate) {
function getService() {
return ($injector.has) ? function(service) {
return $injector.has(service) ? $injector.get(service) : null;
} : function(service) {
try {
return $injector.get(service);
} catch (e) {
return null;
}
};
}
var service = getService(),
$animator = service('$animator'),
$animate = service('$animate');
// Returns a set of DOM manipulation functions based on which Angular version
// it should use
function getRenderer(attrs, scope) {
var statics = function() {
return {
enter: function (element, target, cb) { target.after(element); cb(); },
leave: function (element, cb) { element.remove(); cb(); }
};
};
if ($animate) {
return {
enter: function(element, target, cb) {
var promise = $animate.enter(element, null, target, cb);
if (promise && promise.then) promise.then(cb);
},
leave: function(element, cb) {
var promise = $animate.leave(element, cb);
if (promise && promise.then) promise.then(cb);
}
};
}
if ($animator) {
var animate = $animator && $animator(scope, attrs);
return {
enter: function(element, target, cb) {animate.enter(element, null, target); cb(); },
leave: function(element, cb) { animate.leave(element); cb(); }
};
}
return statics();
}
var directive = {
restrict: 'ECA',
terminal: true,
priority: 400,
transclude: 'element',
compile: function (tElement, tAttrs, $transclude) {
return function (scope, $element, attrs) {
var previousEl, currentEl, currentScope, latestLocals,
onloadExp = attrs.onload || '',
autoScrollExp = attrs.autoscroll,
renderer = getRenderer(attrs, scope);
scope.$on('$stateChangeSuccess', function() {
updateView(false);
});
scope.$on('$viewContentLoading', function() {
updateView(false);
});
updateView(true);
function cleanupLastView() {
if (previousEl) {
previousEl.remove();
previousEl = null;
}
if (currentScope) {
currentScope.$destroy();
currentScope = null;
}
if (currentEl) {
renderer.leave(currentEl, function() {
previousEl = null;
});
previousEl = currentEl;
currentEl = null;
}
}
function updateView(firstTime) {
var newScope,
name = getUiViewName(scope, attrs, $element, $interpolate),
previousLocals = name && $state.$current && $state.$current.locals[name];
if (!firstTime && previousLocals === latestLocals) return; // nothing to do
newScope = scope.$new();
latestLocals = $state.$current.locals[name];
var clone = $transclude(newScope, function(clone) {
renderer.enter(clone, $element, function onUiViewEnter() {
if(currentScope) {
currentScope.$emit('$viewContentAnimationEnded');
}
if (angular.isDefined(autoScrollExp) && !autoScrollExp || scope.$eval(autoScrollExp)) {
$uiViewScroll(clone);
}
});
cleanupLastView();
});
currentEl = clone;
currentScope = newScope;
/**
* @ngdoc event
* @name ui.router.state.directive:ui-view#$viewContentLoaded
* @eventOf ui.router.state.directive:ui-view
* @eventType emits on ui-view directive scope
* @description *
* Fired once the view is **loaded**, *after* the DOM is rendered.
*
* @param {Object} event Event object.
*/
currentScope.$emit('$viewContentLoaded');
currentScope.$eval(onloadExp);
}
};
}
};
return directive;
}
$ViewDirectiveFill.$inject = ['$compile', '$controller', '$state', '$interpolate'];
function $ViewDirectiveFill ( $compile, $controller, $state, $interpolate) {
return {
restrict: 'ECA',
priority: -400,
compile: function (tElement) {
var initial = tElement.html();
return function (scope, $element, attrs) {
var current = $state.$current,
name = getUiViewName(scope, attrs, $element, $interpolate),
locals = current && current.locals[name];
if (! locals) {
return;
}
$element.data('$uiView', { name: name, state: locals.$$state });
$element.html(locals.$template ? locals.$template : initial);
var link = $compile($element.contents());
if (locals.$$controller) {
locals.$scope = scope;
var controller = $controller(locals.$$controller, locals);
if (locals.$$controllerAs) {
scope[locals.$$controllerAs] = controller;
}
$element.data('$ngControllerController', controller);
$element.children().data('$ngControllerController', controller);
}
link(scope);
};
}
};
}
/**
* Shared ui-view code for both directives:
* Given scope, element, and its attributes, return the view's name
*/
function getUiViewName(scope, attrs, element, $interpolate) {
var name = $interpolate(attrs.uiView || attrs.name || '')(scope);
var inherited = element.inheritedData('$uiView');
return name.indexOf('@') >= 0 ? name : (name + '@' + (inherited ? inherited.state.name : ''));
}
angular.module('ui.router.state').directive('uiView', $ViewDirective);
angular.module('ui.router.state').directive('uiView', $ViewDirectiveFill);
function parseStateRef(ref, current) {
var preparsed = ref.match(/^\s*({[^}]*})\s*$/), parsed;
if (preparsed) ref = current + '(' + preparsed[1] + ')';
parsed = ref.replace(/\n/g, " ").match(/^([^(]+?)\s*(\((.*)\))?$/);
if (!parsed || parsed.length !== 4) throw new Error("Invalid state ref '" + ref + "'");
return { state: parsed[1], paramExpr: parsed[3] || null };
}
function stateContext(el) {
var stateData = el.parent().inheritedData('$uiView');
if (stateData && stateData.state && stateData.state.name) {
return stateData.state;
}
}
/**
* @ngdoc directive
* @name ui.router.state.directive:ui-sref
*
* @requires ui.router.state.$state
* @requires $timeout
*
* @restrict A
*
* @description
* A directive that binds a link (`` tag) to a state. If the state has an associated
* URL, the directive will automatically generate & update the `href` attribute via
* the {@link ui.router.state.$state#methods_href $state.href()} method. Clicking
* the link will trigger a state transition with optional parameters.
*
* Also middle-clicking, right-clicking, and ctrl-clicking on the link will be
* handled natively by the browser.
*
* You can also use relative state paths within ui-sref, just like the relative
* paths passed to `$state.go()`. You just need to be aware that the path is relative
* to the state that the link lives in, in other words the state that loaded the
* template containing the link.
*
* You can specify options to pass to {@link ui.router.state.$state#go $state.go()}
* using the `ui-sref-opts` attribute. Options are restricted to `location`, `inherit`,
* and `reload`.
*
* @example
* Here's an example of how you'd use ui-sref and how it would compile. If you have the
* following template:
*
*
*
*
* When the app state is "app.user" (or any children states), and contains the state parameter "user" with value "bilbobaggins",
* the resulting HTML will appear as (note the 'active' class):
*
*
*
* The class name is interpolated **once** during the directives link time (any further changes to the
* interpolated value are ignored).
*
* Multiple classes may be specified in a space-separated format:
*
*
*/
/**
* @ngdoc directive
* @name ui.router.state.directive:ui-sref-active-eq
*
* @requires ui.router.state.$state
* @requires ui.router.state.$stateParams
* @requires $interpolate
*
* @restrict A
*
* @description
* The same as {@link ui.router.state.directive:ui-sref-active ui-sref-active} but will only activate
* when the exact target state used in the `ui-sref` is active; no child states.
*
*/
$StateRefActiveDirective.$inject = ['$state', '$stateParams', '$interpolate'];
function $StateRefActiveDirective($state, $stateParams, $interpolate) {
return {
restrict: "A",
controller: ['$scope', '$element', '$attrs', function ($scope, $element, $attrs) {
var state, params, activeClass;
// There probably isn't much point in $observing this
// uiSrefActive and uiSrefActiveEq share the same directive object with some
// slight difference in logic routing
activeClass = $interpolate($attrs.uiSrefActiveEq || $attrs.uiSrefActive || '', false)($scope);
// Allow uiSref to communicate with uiSrefActive[Equals]
this.$$setStateInfo = function (newState, newParams) {
state = $state.get(newState, stateContext($element));
params = newParams;
update();
};
$scope.$on('$stateChangeSuccess', update);
// Update route state
function update() {
if (isMatch()) {
$element.addClass(activeClass);
} else {
$element.removeClass(activeClass);
}
}
function isMatch() {
if (typeof $attrs.uiSrefActiveEq !== 'undefined') {
return state && $state.is(state.name, params);
} else {
return state && $state.includes(state.name, params);
}
}
}]
};
}
angular.module('ui.router.state')
.directive('uiSref', $StateRefDirective)
.directive('uiSrefActive', $StateRefActiveDirective)
.directive('uiSrefActiveEq', $StateRefActiveDirective);
/**
* @ngdoc filter
* @name ui.router.state.filter:isState
*
* @requires ui.router.state.$state
*
* @description
* Translates to {@link ui.router.state.$state#methods_is $state.is("stateName")}.
*/
$IsStateFilter.$inject = ['$state'];
function $IsStateFilter($state) {
var isFilter = function (state) {
return $state.is(state);
};
isFilter.$stateful = true;
return isFilter;
}
/**
* @ngdoc filter
* @name ui.router.state.filter:includedByState
*
* @requires ui.router.state.$state
*
* @description
* Translates to {@link ui.router.state.$state#methods_includes $state.includes('fullOrPartialStateName')}.
*/
$IncludedByStateFilter.$inject = ['$state'];
function $IncludedByStateFilter($state) {
var includesFilter = function (state) {
return $state.includes(state);
};
includesFilter.$stateful = true;
return includesFilter;
}
angular.module('ui.router.state')
.filter('isState', $IsStateFilter)
.filter('includedByState', $IncludedByStateFilter);
})(window, window.angular);
================================================
FILE: client/components/angular-ui-router/src/common.js
================================================
/*jshint globalstrict:true*/
/*global angular:false*/
'use strict';
var isDefined = angular.isDefined,
isFunction = angular.isFunction,
isString = angular.isString,
isObject = angular.isObject,
isArray = angular.isArray,
forEach = angular.forEach,
extend = angular.extend,
copy = angular.copy;
function inherit(parent, extra) {
return extend(new (extend(function() {}, { prototype: parent }))(), extra);
}
function merge(dst) {
forEach(arguments, function(obj) {
if (obj !== dst) {
forEach(obj, function(value, key) {
if (!dst.hasOwnProperty(key)) dst[key] = value;
});
}
});
return dst;
}
/**
* Finds the common ancestor path between two states.
*
* @param {Object} first The first state.
* @param {Object} second The second state.
* @return {Array} Returns an array of state names in descending order, not including the root.
*/
function ancestors(first, second) {
var path = [];
for (var n in first.path) {
if (first.path[n] !== second.path[n]) break;
path.push(first.path[n]);
}
return path;
}
/**
* IE8-safe wrapper for `Object.keys()`.
*
* @param {Object} object A JavaScript object.
* @return {Array} Returns the keys of the object as an array.
*/
function objectKeys(object) {
if (Object.keys) {
return Object.keys(object);
}
var result = [];
angular.forEach(object, function(val, key) {
result.push(key);
});
return result;
}
/**
* IE8-safe wrapper for `Array.prototype.indexOf()`.
*
* @param {Array} array A JavaScript array.
* @param {*} value A value to search the array for.
* @return {Number} Returns the array index value of `value`, or `-1` if not present.
*/
function indexOf(array, value) {
if (Array.prototype.indexOf) {
return array.indexOf(value, Number(arguments[2]) || 0);
}
var len = array.length >>> 0, from = Number(arguments[2]) || 0;
from = (from < 0) ? Math.ceil(from) : Math.floor(from);
if (from < 0) from += len;
for (; from < len; from++) {
if (from in array && array[from] === value) return from;
}
return -1;
}
/**
* Merges a set of parameters with all parameters inherited between the common parents of the
* current state and a given destination state.
*
* @param {Object} currentParams The value of the current state parameters ($stateParams).
* @param {Object} newParams The set of parameters which will be composited with inherited params.
* @param {Object} $current Internal definition of object representing the current state.
* @param {Object} $to Internal definition of object representing state to transition to.
*/
function inheritParams(currentParams, newParams, $current, $to) {
var parents = ancestors($current, $to), parentParams, inherited = {}, inheritList = [];
for (var i in parents) {
if (!parents[i].params) continue;
parentParams = objectKeys(parents[i].params);
if (!parentParams.length) continue;
for (var j in parentParams) {
if (indexOf(inheritList, parentParams[j]) >= 0) continue;
inheritList.push(parentParams[j]);
inherited[parentParams[j]] = currentParams[parentParams[j]];
}
}
return extend({}, inherited, newParams);
}
/**
* Performs a non-strict comparison of the subset of two objects, defined by a list of keys.
*
* @param {Object} a The first object.
* @param {Object} b The second object.
* @param {Array} keys The list of keys within each object to compare. If the list is empty or not specified,
* it defaults to the list of keys in `a`.
* @return {Boolean} Returns `true` if the keys match, otherwise `false`.
*/
function equalForKeys(a, b, keys) {
if (!keys) {
keys = [];
for (var n in a) keys.push(n); // Used instead of Object.keys() for IE8 compatibility
}
for (var i=0; i
*
*
*
*
*
*
*
*
*
*
*
*
*/
angular.module('ui.router', ['ui.router.state']);
angular.module('ui.router.compat', ['ui.router']);
================================================
FILE: client/components/angular-ui-router/src/resolve.js
================================================
/**
* @ngdoc object
* @name ui.router.util.$resolve
*
* @requires $q
* @requires $injector
*
* @description
* Manages resolution of (acyclic) graphs of promises.
*/
$Resolve.$inject = ['$q', '$injector'];
function $Resolve( $q, $injector) {
var VISIT_IN_PROGRESS = 1,
VISIT_DONE = 2,
NOTHING = {},
NO_DEPENDENCIES = [],
NO_LOCALS = NOTHING,
NO_PARENT = extend($q.when(NOTHING), { $$promises: NOTHING, $$values: NOTHING });
/**
* @ngdoc function
* @name ui.router.util.$resolve#study
* @methodOf ui.router.util.$resolve
*
* @description
* Studies a set of invocables that are likely to be used multiple times.
*
* but the former is more efficient (in fact `resolve` just calls `study`
* internally).
*
* @param {object} invocables Invocable objects
* @return {function} a function to pass in locals, parent and self
*/
this.study = function (invocables) {
if (!isObject(invocables)) throw new Error("'invocables' must be an object");
var invocableKeys = objectKeys(invocables || {});
// Perform a topological sort of invocables to build an ordered plan
var plan = [], cycle = [], visited = {};
function visit(value, key) {
if (visited[key] === VISIT_DONE) return;
cycle.push(key);
if (visited[key] === VISIT_IN_PROGRESS) {
cycle.splice(0, indexOf(cycle, key));
throw new Error("Cyclic dependency: " + cycle.join(" -> "));
}
visited[key] = VISIT_IN_PROGRESS;
if (isString(value)) {
plan.push(key, [ function() { return $injector.get(value); }], NO_DEPENDENCIES);
} else {
var params = $injector.annotate(value);
forEach(params, function (param) {
if (param !== key && invocables.hasOwnProperty(param)) visit(invocables[param], param);
});
plan.push(key, value, params);
}
cycle.pop();
visited[key] = VISIT_DONE;
}
forEach(invocables, visit);
invocables = cycle = visited = null; // plan is all that's required
function isResolve(value) {
return isObject(value) && value.then && value.$$promises;
}
return function (locals, parent, self) {
if (isResolve(locals) && self === undefined) {
self = parent; parent = locals; locals = null;
}
if (!locals) locals = NO_LOCALS;
else if (!isObject(locals)) {
throw new Error("'locals' must be an object");
}
if (!parent) parent = NO_PARENT;
else if (!isResolve(parent)) {
throw new Error("'parent' must be a promise returned by $resolve.resolve()");
}
// To complete the overall resolution, we have to wait for the parent
// promise and for the promise for each invokable in our plan.
var resolution = $q.defer(),
result = resolution.promise,
promises = result.$$promises = {},
values = extend({}, locals),
wait = 1 + plan.length/3,
merged = false;
function done() {
// Merge parent values we haven't got yet and publish our own $$values
if (!--wait) {
if (!merged) merge(values, parent.$$values);
result.$$values = values;
result.$$promises = result.$$promises || true; // keep for isResolve()
delete result.$$inheritedValues;
resolution.resolve(values);
}
}
function fail(reason) {
result.$$failure = reason;
resolution.reject(reason);
}
// Short-circuit if parent has already failed
if (isDefined(parent.$$failure)) {
fail(parent.$$failure);
return result;
}
if (parent.$$inheritedValues) {
merge(values, omit(parent.$$inheritedValues, invocableKeys));
}
// Merge parent values if the parent has already resolved, or merge
// parent promises and wait if the parent resolve is still in progress.
extend(promises, parent.$$promises);
if (parent.$$values) {
merged = merge(values, omit(parent.$$values, invocableKeys));
result.$$inheritedValues = omit(parent.$$values, invocableKeys);
done();
} else {
if (parent.$$inheritedValues) {
result.$$inheritedValues = omit(parent.$$inheritedValues, invocableKeys);
}
parent.then(done, fail);
}
// Process each invocable in the plan, but ignore any where a local of the same name exists.
for (var i=0, ii=plan.length; i= 0) throw new Error("State must have a valid name");
if (states.hasOwnProperty(name)) throw new Error("State '" + name + "'' is already defined");
// Get parent name
var parentName = (name.indexOf('.') !== -1) ? name.substring(0, name.lastIndexOf('.'))
: (isString(state.parent)) ? state.parent
: (isObject(state.parent) && isString(state.parent.name)) ? state.parent.name
: '';
// If parent is not registered yet, add state to queue and register later
if (parentName && !states[parentName]) {
return queueState(parentName, state.self);
}
for (var key in stateBuilder) {
if (isFunction(stateBuilder[key])) state[key] = stateBuilder[key](state, stateBuilder.$delegates[key]);
}
states[name] = state;
// Register the state in the global state list and with $urlRouter if necessary.
if (!state[abstractKey] && state.url) {
$urlRouterProvider.when(state.url, ['$match', '$stateParams', function ($match, $stateParams) {
if ($state.$current.navigable != state || !equalForKeys($match, $stateParams)) {
$state.transitionTo(state, $match, { inherit: true, location: false });
}
}]);
}
// Register any queued children
flushQueuedChildren(name);
return state;
}
// Checks text to see if it looks like a glob.
function isGlob (text) {
return text.indexOf('*') > -1;
}
// Returns true if glob matches current $state name.
function doesStateMatchGlob (glob) {
var globSegments = glob.split('.'),
segments = $state.$current.name.split('.');
//match greedy starts
if (globSegments[0] === '**') {
segments = segments.slice(indexOf(segments, globSegments[1]));
segments.unshift('**');
}
//match greedy ends
if (globSegments[globSegments.length - 1] === '**') {
segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);
segments.push('**');
}
if (globSegments.length != segments.length) {
return false;
}
//match single stars
for (var i = 0, l = globSegments.length; i < l; i++) {
if (globSegments[i] === '*') {
segments[i] = '*';
}
}
return segments.join('') === globSegments.join('');
}
// Implicit root state that is always active
root = registerState({
name: '',
url: '^',
views: null,
'abstract': true
});
root.navigable = null;
/**
* @ngdoc function
* @name ui.router.state.$stateProvider#decorator
* @methodOf ui.router.state.$stateProvider
*
* @description
* Allows you to extend (carefully) or override (at your own peril) the
* `stateBuilder` object used internally by `$stateProvider`. This can be used
* to add custom functionality to ui-router, for example inferring templateUrl
* based on the state name.
*
* When passing only a name, it returns the current (original or decorated) builder
* function that matches `name`.
*
* The builder functions that can be decorated are listed below. Though not all
* necessarily have a good use case for decoration, that is up to you to decide.
*
* In addition, users can attach custom decorators, which will generate new
* properties within the state's internal definition. There is currently no clear
* use-case for this beyond accessing internal states (i.e. $state.$current),
* however, expect this to become increasingly relevant as we introduce additional
* meta-programming features.
*
* **Warning**: Decorators should not be interdependent because the order of
* execution of the builder functions in non-deterministic. Builder functions
* should only be dependent on the state definition object and super function.
*
*
* Existing builder functions and current return values:
*
* - **parent** `{object}` - returns the parent state object.
* - **data** `{object}` - returns state data, including any inherited data that is not
* overridden by own values (if any).
* - **url** `{object}` - returns a {@link ui.router.util.type:UrlMatcher UrlMatcher}
* or `null`.
* - **navigable** `{object}` - returns closest ancestor state that has a URL (aka is
* navigable).
* - **params** `{object}` - returns an array of state params that are ensured to
* be a super-set of parent's params.
* - **views** `{object}` - returns a views object where each key is an absolute view
* name (i.e. "viewName@stateName") and each value is the config object
* (template, controller) for the view. Even when you don't use the views object
* explicitly on a state config, one is still created for you internally.
* So by decorating this builder function you have access to decorating template
* and controller properties.
* - **ownParams** `{object}` - returns an array of params that belong to the state,
* not including any params defined by ancestor states.
* - **path** `{string}` - returns the full path from the root down to this state.
* Needed for state activation.
* - **includes** `{object}` - returns an object that includes every state that
* would pass a `$state.includes()` test.
*
* @example
*
* // Override the internal 'views' builder with a function that takes the state
* // definition, and a reference to the internal function being overridden:
* $stateProvider.decorator('views', function (state, parent) {
* var result = {},
* views = parent(state);
*
* angular.forEach(views, function (config, name) {
* var autoName = (state.name + '.' + name).replace('.', '/');
* config.templateUrl = config.templateUrl || '/partials/' + autoName + '.html';
* result[name] = config;
* });
* return result;
* });
*
* $stateProvider.state('home', {
* views: {
* 'contact.list': { controller: 'ListController' },
* 'contact.item': { controller: 'ItemController' }
* }
* });
*
* // ...
*
* $state.go('home');
* // Auto-populates list and item views with /partials/home/contact/list.html,
* // and /partials/home/contact/item.html, respectively.
*
*
* @param {string} name The name of the builder function to decorate.
* @param {object} func A function that is responsible for decorating the original
* builder function. The function receives two parameters:
*
* - `{object}` - state - The state config object.
* - `{object}` - super - The original builder function.
*
* @return {object} $stateProvider - $stateProvider instance
*/
this.decorator = decorator;
function decorator(name, func) {
/*jshint validthis: true */
if (isString(name) && !isDefined(func)) {
return stateBuilder[name];
}
if (!isFunction(func) || !isString(name)) {
return this;
}
if (stateBuilder[name] && !stateBuilder.$delegates[name]) {
stateBuilder.$delegates[name] = stateBuilder[name];
}
stateBuilder[name] = func;
return this;
}
/**
* @ngdoc function
* @name ui.router.state.$stateProvider#state
* @methodOf ui.router.state.$stateProvider
*
* @description
* Registers a state configuration under a given state name. The stateConfig object
* has the following acceptable properties.
*
* @param {string} name A unique state name, e.g. "home", "about", "contacts".
* To create a parent/child state use a dot, e.g. "about.sales", "home.newest".
* @param {object} stateConfig State configuration object.
* @param {string|function=} stateConfig.template
*
* html template as a string or a function that returns
* an html template as a string which should be used by the uiView directives. This property
* takes precedence over templateUrl.
*
* If `template` is a function, it will be called with the following parameters:
*
* - {array.<object>} - state parameters extracted from the current $location.path() by
* applying the current state
*
*
template:
* "
inline template definition
" +
* ""
*
template: function(params) {
* return "
generated template
"; }
*
*
* @param {string|function=} stateConfig.templateUrl
*
*
* path or function that returns a path to an html
* template that should be used by uiView.
*
* If `templateUrl` is a function, it will be called with the following parameters:
*
* - {array.<object>} - state parameters extracted from the current $location.path() by
* applying the current state
*
*
*
* @param {string|function=} stateConfig.controller
*
*
* Controller fn that should be associated with newly
* related scope or the name of a registered controller if passed as a string.
* Optionally, the ControllerAs may be declared here.
*
controller: "MyRegisteredController"
*
controller:
* "MyRegisteredController as fooCtrl"}
*
* @param {string=} stateConfig.controllerAs
*
*
* A controller alias name. If present the controller will be
* published to scope under the controllerAs name.
*
controllerAs: "myCtrl"
*
* @param {object=} stateConfig.resolve
*
*
* An optional map<string, function> of dependencies which
* should be injected into the controller. If any of these dependencies are promises,
* the router will wait for them all to be resolved before the controller is instantiated.
* If all the promises are resolved successfully, the $stateChangeSuccess event is fired
* and the values of the resolved promises are injected into any controllers that reference them.
* If any of the promises are rejected the $stateChangeError event is fired.
*
* The map object is:
*
* - key - {string}: name of dependency to be injected into controller
* - factory - {string|function}: If string then it is alias for service. Otherwise if function,
* it is injected and return value it treated as dependency. If result is a promise, it is
* resolved before its value is injected into controller.
*
*
*
* @param {string=} stateConfig.url
*
*
* A url fragment with optional parameters. When a state is navigated or
* transitioned to, the `$stateParams` service will be populated with any
* parameters that were passed.
*
* examples:
*
* url: "/messages/:mailboxid?{before:date}&{after:date}"
*
* @param {object=} stateConfig.views
*
* an optional map<string, object> which defined multiple views, or targets views
* manually/explicitly.
*
* Examples:
*
* Targets three named `ui-view`s in the parent state's template
*
*
* @param {boolean=} [stateConfig.abstract=false]
*
* An abstract state will never be directly activated,
* but can provide inherited properties to its common children states.
*
abstract: true
*
* @param {function=} stateConfig.onEnter
*
*
* Callback function for when a state is entered. Good way
* to trigger an action or dispatch an event, such as opening a dialog.
* If minifying your scripts, make sure to explictly annotate this function,
* because it won't be automatically annotated by your build tools.
*
*
*
* @param {function=} stateConfig.onExit
*
*
* Callback function for when a state is exited. Good way to
* trigger an action or dispatch an event, such as opening a dialog.
* If minifying your scripts, make sure to explictly annotate this function,
* because it won't be automatically annotated by your build tools.
*
*
*
* @param {boolean=} [stateConfig.reloadOnSearch=true]
*
*
* If `false`, will not retrigger the same state
* just because a search/query parameter has changed (via $location.search() or $location.hash()).
* Useful for when you'd like to modify $location.search() without triggering a reload.
*
reloadOnSearch: false
*
* @param {object=} stateConfig.data
*
*
* Arbitrary data object, useful for custom configuration. The parent state's `data` is
* prototypally inherited. In other words, adding a data property to a state adds it to
* the entire subtree via prototypal inheritance.
*
*
data: {
* requiredRole: 'foo'
* }
*
* @param {object=} stateConfig.params
*
*
* A map which optionally configures parameters declared in the `url`, or
* defines additional non-url parameters. For each parameter being
* configured, add a configuration object keyed to the name of the parameter.
*
* Each parameter configuration object may contain the following properties:
*
* - ** value ** - {object|function=}: specifies the default value for this
* parameter. This implicitly sets this parameter as optional.
*
* When UI-Router routes to a state and no value is
* specified for this parameter in the URL or transition, the
* default value will be used instead. If `value` is a function,
* it will be injected and invoked, and the return value used.
*
* *Note*: `undefined` is treated as "no default value" while `null`
* is treated as "the default value is `null`".
*
* *Shorthand*: If you only need to configure the default value of the
* parameter, you may use a shorthand syntax. In the **`params`**
* map, instead mapping the param name to a full parameter configuration
* object, simply set map it to the default parameter value, e.g.:
*
*
*
* - ** array ** - {boolean=}: *(default: false)* If true, the param value will be
* treated as an array of values. If you specified a Type, the value will be
* treated as an array of the specified Type. Note: query parameter values
* default to a special `"auto"` mode.
*
* For query parameters in `"auto"` mode, if multiple values for a single parameter
* are present in the URL (e.g.: `/foo?bar=1&bar=2&bar=3`) then the values
* are mapped to an array (e.g.: `{ foo: [ '1', '2', '3' ] }`). However, if
* only one value is present (e.g.: `/foo?bar=1`) then the value is treated as single
* value (e.g.: `{ foo: '1' }`).
*
*
params: {
* param1: { array: true }
* }
*
* - ** squash ** - {bool|string=}: `squash` configures how a default parameter value is represented in the URL when
* the current parameter value is the same as the default value. If `squash` is not set, it uses the
* configured default squash policy.
* (See {@link ui.router.util.$urlMatcherFactory#methods_defaultSquashPolicy `defaultSquashPolicy()`})
*
* There are three squash settings:
*
* - false: The parameter's default value is not squashed. It is encoded and included in the URL
* - true: The parameter's default value is omitted from the URL. If the parameter is preceeded and followed
* by slashes in the state's `url` declaration, then one of those slashes are omitted.
* This can allow for cleaner looking URLs.
* - `""`: The parameter's default value is replaced with an arbitrary placeholder of your choice.
*
*
* // Some state name examples
*
* // stateName can be a single top-level name (must be unique).
* $stateProvider.state("home", {});
*
* // Or it can be a nested state name. This state is a child of the
* // above "home" state.
* $stateProvider.state("home.newest", {});
*
* // Nest states as deeply as needed.
* $stateProvider.state("home.newest.abc.xyz.inception", {});
*
* // state() returns $stateProvider, so you can chain state declarations.
* $stateProvider
* .state("home", {})
* .state("about", {})
* .state("contacts", {});
*
*
*/
this.state = state;
function state(name, definition) {
/*jshint validthis: true */
if (isObject(name)) definition = name;
else definition.name = name;
registerState(definition);
return this;
}
/**
* @ngdoc object
* @name ui.router.state.$state
*
* @requires $rootScope
* @requires $q
* @requires ui.router.state.$view
* @requires $injector
* @requires ui.router.util.$resolve
* @requires ui.router.state.$stateParams
* @requires ui.router.router.$urlRouter
*
* @property {object} params A param object, e.g. {sectionId: section.id)}, that
* you'd like to test against the current active state.
* @property {object} current A reference to the state's config object. However
* you passed it in. Useful for accessing custom data.
* @property {object} transition Currently pending transition. A promise that'll
* resolve or reject.
*
* @description
* `$state` service is responsible for representing states as well as transitioning
* between them. It also provides interfaces to ask for current state or even states
* you're coming from.
*/
this.$get = $get;
$get.$inject = ['$rootScope', '$q', '$view', '$injector', '$resolve', '$stateParams', '$urlRouter', '$location', '$urlMatcherFactory'];
function $get( $rootScope, $q, $view, $injector, $resolve, $stateParams, $urlRouter, $location, $urlMatcherFactory) {
var TransitionSuperseded = $q.reject(new Error('transition superseded'));
var TransitionPrevented = $q.reject(new Error('transition prevented'));
var TransitionAborted = $q.reject(new Error('transition aborted'));
var TransitionFailed = $q.reject(new Error('transition failed'));
// Handles the case where a state which is the target of a transition is not found, and the user
// can optionally retry or defer the transition
function handleRedirect(redirect, state, params, options) {
/**
* @ngdoc event
* @name ui.router.state.$state#$stateNotFound
* @eventOf ui.router.state.$state
* @eventType broadcast on root scope
* @description
* Fired when a requested state **cannot be found** using the provided state name during transition.
* The event is broadcast allowing any handlers a single chance to deal with the error (usually by
* lazy-loading the unfound state). A special `unfoundState` object is passed to the listener handler,
* you can see its three properties in the example. You can use `event.preventDefault()` to abort the
* transition and the promise returned from `go` will be rejected with a `'transition aborted'` value.
*
* @param {Object} event Event object.
* @param {Object} unfoundState Unfound State information. Contains: `to, toParams, options` properties.
* @param {State} fromState Current state object.
* @param {Object} fromParams Current state params.
*
* @example
*
*
*
* @returns {promise} A promise representing the state of the new transition. See
* {@link ui.router.state.$state#methods_go $state.go}.
*/
$state.reload = function reload() {
return $state.transitionTo($state.current, $stateParams, { reload: true, inherit: false, notify: true });
};
/**
* @ngdoc function
* @name ui.router.state.$state#go
* @methodOf ui.router.state.$state
*
* @description
* Convenience method for transitioning to a new state. `$state.go` calls
* `$state.transitionTo` internally but automatically sets options to
* `{ location: true, inherit: true, relative: $state.$current, notify: true }`.
* This allows you to easily use an absolute or relative to path and specify
* only the parameters you'd like to update (while letting unspecified parameters
* inherit from the currently active ancestor states).
*
* @example
*
* var app = angular.module('app', ['ui.router']);
*
* app.controller('ctrl', function ($scope, $state) {
* $scope.changeState = function () {
* $state.go('contact.detail');
* };
* });
*
*
*
* @param {string} to Absolute state name or relative state path. Some examples:
*
* - `$state.go('contact.detail')` - will go to the `contact.detail` state
* - `$state.go('^')` - will go to a parent state
* - `$state.go('^.sibling')` - will go to a sibling state
* - `$state.go('.child.grandchild')` - will go to grandchild state
*
* @param {object=} params A map of the parameters that will be sent to the state,
* will populate $stateParams. Any parameters that are not specified will be inherited from currently
* defined parameters. This allows, for example, going to a sibling state that shares parameters
* specified in a parent state. Parameter inheritance only works between common ancestor states, I.e.
* transitioning to a sibling will get you the parameters for all parents, transitioning to a child
* will get you all current parameters, etc.
* @param {object=} options Options object. The options are:
*
* - **`location`** - {boolean=true|string=} - If `true` will update the url in the location bar, if `false`
* will not. If string, must be `"replace"`, which will update url and also replace last history record.
* - **`inherit`** - {boolean=true}, If `true` will inherit url parameters from current url.
* - **`relative`** - {object=$state.$current}, When transitioning with relative path (e.g '^'),
* defines which state to be relative from.
* - **`notify`** - {boolean=true}, If `true` will broadcast $stateChangeStart and $stateChangeSuccess events.
* - **`reload`** (v0.2.5) - {boolean=false}, If `true` will force transition even if the state or params
* have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd
* use this when you want to force a reload when *everything* is the same, including search params.
*
* @returns {promise} A promise representing the state of the new transition.
*
* Possible success values:
*
* - $state.current
*
* Possible rejection values:
*
* - 'transition superseded' - when a newer transition has been started after this one
* - 'transition prevented' - when `event.preventDefault()` has been called in a `$stateChangeStart` listener
* - 'transition aborted' - when `event.preventDefault()` has been called in a `$stateNotFound` listener or
* when a `$stateNotFound` `event.retry` promise errors.
* - 'transition failed' - when a state has been unsuccessfully found after 2 tries.
* - *resolve error* - when an error has occurred with a `resolve`
*
*/
$state.go = function go(to, params, options) {
return $state.transitionTo(to, params, extend({ inherit: true, relative: $state.$current }, options));
};
/**
* @ngdoc function
* @name ui.router.state.$state#transitionTo
* @methodOf ui.router.state.$state
*
* @description
* Low-level method for transitioning to a new state. {@link ui.router.state.$state#methods_go $state.go}
* uses `transitionTo` internally. `$state.go` is recommended in most situations.
*
* @example
*
* var app = angular.module('app', ['ui.router']);
*
* app.controller('ctrl', function ($scope, $state) {
* $scope.changeState = function () {
* $state.transitionTo('contact.detail');
* };
* });
*
*
* @param {string} to State name.
* @param {object=} toParams A map of the parameters that will be sent to the state,
* will populate $stateParams.
* @param {object=} options Options object. The options are:
*
* - **`location`** - {boolean=true|string=} - If `true` will update the url in the location bar, if `false`
* will not. If string, must be `"replace"`, which will update url and also replace last history record.
* - **`inherit`** - {boolean=false}, If `true` will inherit url parameters from current url.
* - **`relative`** - {object=}, When transitioning with relative path (e.g '^'),
* defines which state to be relative from.
* - **`notify`** - {boolean=true}, If `true` will broadcast $stateChangeStart and $stateChangeSuccess events.
* - **`reload`** (v0.2.5) - {boolean=false}, If `true` will force transition even if the state or params
* have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd
* use this when you want to force a reload when *everything* is the same, including search params.
*
* @returns {promise} A promise representing the state of the new transition. See
* {@link ui.router.state.$state#methods_go $state.go}.
*/
$state.transitionTo = function transitionTo(to, toParams, options) {
toParams = toParams || {};
options = extend({
location: true, inherit: false, relative: null, notify: true, reload: false, $retry: false
}, options || {});
var from = $state.$current, fromParams = $state.params, fromPath = from.path;
var evt, toState = findState(to, options.relative);
if (!isDefined(toState)) {
var redirect = { to: to, toParams: toParams, options: options };
var redirectResult = handleRedirect(redirect, from.self, fromParams, options);
if (redirectResult) {
return redirectResult;
}
// Always retry once if the $stateNotFound was not prevented
// (handles either redirect changed or state lazy-definition)
to = redirect.to;
toParams = redirect.toParams;
options = redirect.options;
toState = findState(to, options.relative);
if (!isDefined(toState)) {
if (!options.relative) throw new Error("No such state '" + to + "'");
throw new Error("Could not resolve '" + to + "' from state '" + options.relative + "'");
}
}
if (toState[abstractKey]) throw new Error("Cannot transition to abstract state '" + to + "'");
if (options.inherit) toParams = inheritParams($stateParams, toParams || {}, $state.$current, toState);
if (!toState.params.$$validates(toParams)) return TransitionFailed;
toParams = toState.params.$$values(toParams);
to = toState;
var toPath = to.path;
// Starting from the root of the path, keep all levels that haven't changed
var keep = 0, state = toPath[keep], locals = root.locals, toLocals = [];
if (!options.reload) {
while (state && state === fromPath[keep] && state.ownParams.$$equals(toParams, fromParams)) {
locals = toLocals[keep] = state.locals;
keep++;
state = toPath[keep];
}
}
// If we're going to the same state and all locals are kept, we've got nothing to do.
// But clear 'transition', as we still want to cancel any other pending transitions.
// TODO: We may not want to bump 'transition' if we're called from a location change
// that we've initiated ourselves, because we might accidentally abort a legitimate
// transition initiated from code?
if (shouldTriggerReload(to, from, locals, options)) {
if (to.self.reloadOnSearch !== false) $urlRouter.update();
$state.transition = null;
return $q.when($state.current);
}
// Filter parameters before we pass them to event handlers etc.
toParams = filterByKeys(to.params.$$keys(), toParams || {});
// Broadcast start event and cancel the transition if requested
if (options.notify) {
/**
* @ngdoc event
* @name ui.router.state.$state#$stateChangeStart
* @eventOf ui.router.state.$state
* @eventType broadcast on root scope
* @description
* Fired when the state transition **begins**. You can use `event.preventDefault()`
* to prevent the transition from happening and then the transition promise will be
* rejected with a `'transition prevented'` value.
*
* @param {Object} event Event object.
* @param {State} toState The state being transitioned to.
* @param {Object} toParams The params supplied to the `toState`.
* @param {State} fromState The current state, pre-transition.
* @param {Object} fromParams The params supplied to the `fromState`.
*
* @example
*
*
* $rootScope.$on('$stateChangeStart',
* function(event, toState, toParams, fromState, fromParams){
* event.preventDefault();
* // transitionTo() promise will be rejected with
* // a 'transition prevented' error
* })
*
*/
if ($rootScope.$broadcast('$stateChangeStart', to.self, toParams, from.self, fromParams).defaultPrevented) {
$urlRouter.update();
return TransitionPrevented;
}
}
// Resolve locals for the remaining states, but don't update any global state just
// yet -- if anything fails to resolve the current state needs to remain untouched.
// We also set up an inheritance chain for the locals here. This allows the view directive
// to quickly look up the correct definition for each view in the current state. Even
// though we create the locals object itself outside resolveState(), it is initially
// empty and gets filled asynchronously. We need to keep track of the promise for the
// (fully resolved) current locals, and pass this down the chain.
var resolved = $q.when(locals);
for (var l = keep; l < toPath.length; l++, state = toPath[l]) {
locals = toLocals[l] = inherit(locals);
resolved = resolveState(state, toParams, state === to, resolved, locals, options);
}
// Once everything is resolved, we are ready to perform the actual transition
// and return a promise for the new state. We also keep track of what the
// current promise is, so that we can detect overlapping transitions and
// keep only the outcome of the last transition.
var transition = $state.transition = resolved.then(function () {
var l, entering, exiting;
if ($state.transition !== transition) return TransitionSuperseded;
// Exit 'from' states not kept
for (l = fromPath.length - 1; l >= keep; l--) {
exiting = fromPath[l];
if (exiting.self.onExit) {
$injector.invoke(exiting.self.onExit, exiting.self, exiting.locals.globals);
}
exiting.locals = null;
}
// Enter 'to' states not kept
for (l = keep; l < toPath.length; l++) {
entering = toPath[l];
entering.locals = toLocals[l];
if (entering.self.onEnter) {
$injector.invoke(entering.self.onEnter, entering.self, entering.locals.globals);
}
}
// Run it again, to catch any transitions in callbacks
if ($state.transition !== transition) return TransitionSuperseded;
// Update globals in $state
$state.$current = to;
$state.current = to.self;
$state.params = toParams;
copy($state.params, $stateParams);
$state.transition = null;
if (options.location && to.navigable) {
$urlRouter.push(to.navigable.url, to.navigable.locals.globals.$stateParams, {
$$avoidResync: true, replace: options.location === 'replace'
});
}
if (options.notify) {
/**
* @ngdoc event
* @name ui.router.state.$state#$stateChangeSuccess
* @eventOf ui.router.state.$state
* @eventType broadcast on root scope
* @description
* Fired once the state transition is **complete**.
*
* @param {Object} event Event object.
* @param {State} toState The state being transitioned to.
* @param {Object} toParams The params supplied to the `toState`.
* @param {State} fromState The current state, pre-transition.
* @param {Object} fromParams The params supplied to the `fromState`.
*/
$rootScope.$broadcast('$stateChangeSuccess', to.self, toParams, from.self, fromParams);
}
$urlRouter.update(true);
return $state.current;
}, function (error) {
if ($state.transition !== transition) return TransitionSuperseded;
$state.transition = null;
/**
* @ngdoc event
* @name ui.router.state.$state#$stateChangeError
* @eventOf ui.router.state.$state
* @eventType broadcast on root scope
* @description
* Fired when an **error occurs** during transition. It's important to note that if you
* have any errors in your resolve functions (javascript errors, non-existent services, etc)
* they will not throw traditionally. You must listen for this $stateChangeError event to
* catch **ALL** errors.
*
* @param {Object} event Event object.
* @param {State} toState The state being transitioned to.
* @param {Object} toParams The params supplied to the `toState`.
* @param {State} fromState The current state, pre-transition.
* @param {Object} fromParams The params supplied to the `fromState`.
* @param {Error} error The resolve error object.
*/
evt = $rootScope.$broadcast('$stateChangeError', to.self, toParams, from.self, fromParams, error);
if (!evt.defaultPrevented) {
$urlRouter.update();
}
return $q.reject(error);
});
return transition;
};
/**
* @ngdoc function
* @name ui.router.state.$state#is
* @methodOf ui.router.state.$state
*
* @description
* Similar to {@link ui.router.state.$state#methods_includes $state.includes},
* but only checks for the full state name. If params is supplied then it will be
* tested for strict equality against the current active params object, so all params
* must match with none missing and no extras.
*
* @example
*
* $state.$current.name = 'contacts.details.item';
*
* // absolute name
* $state.is('contact.details.item'); // returns true
* $state.is(contactDetailItemStateObject); // returns true
*
* // relative name (. and ^), typically from a template
* // E.g. from the 'contacts.details' template
*
Item
*
*
* @param {string|object} stateOrName The state name (absolute or relative) or state object you'd like to check.
* @param {object=} params A param object, e.g. `{sectionId: section.id}`, that you'd like
* to test against the current active state.
* @param {object=} options An options object. The options are:
*
* - **`relative`** - {string|object} - If `stateOrName` is a relative state name and `options.relative` is set, .is will
* test relative to `options.relative` state (or name).
*
* @returns {boolean} Returns true if it is the state.
*/
$state.is = function is(stateOrName, params, options) {
options = extend({ relative: $state.$current }, options || {});
var state = findState(stateOrName, options.relative);
if (!isDefined(state)) { return undefined; }
if ($state.$current !== state) { return false; }
return params ? equalForKeys(state.params.$$values(params), $stateParams) : true;
};
/**
* @ngdoc function
* @name ui.router.state.$state#includes
* @methodOf ui.router.state.$state
*
* @description
* A method to determine if the current active state is equal to or is the child of the
* state stateName. If any params are passed then they will be tested for a match as well.
* Not all the parameters need to be passed, just the ones you'd like to test for equality.
*
* @example
* Partial and relative names
*
* $state.$current.name = 'contacts.details.item';
*
* // Using partial names
* $state.includes("contacts"); // returns true
* $state.includes("contacts.details"); // returns true
* $state.includes("contacts.details.item"); // returns true
* $state.includes("contacts.list"); // returns false
* $state.includes("about"); // returns false
*
* // Using relative names (. and ^), typically from a template
* // E.g. from the 'contacts.details' template
*
*
* @param {string} stateOrName A partial name, relative name, or glob pattern
* to be searched for within the current state name.
* @param {object=} params A param object, e.g. `{sectionId: section.id}`,
* that you'd like to test against the current active state.
* @param {object=} options An options object. The options are:
*
* - **`relative`** - {string|object=} - If `stateOrName` is a relative state reference and `options.relative` is set,
* .includes will test relative to `options.relative` state (or name).
*
* @returns {boolean} Returns true if it does include the state
*/
$state.includes = function includes(stateOrName, params, options) {
options = extend({ relative: $state.$current }, options || {});
if (isString(stateOrName) && isGlob(stateOrName)) {
if (!doesStateMatchGlob(stateOrName)) {
return false;
}
stateOrName = $state.$current.name;
}
var state = findState(stateOrName, options.relative);
if (!isDefined(state)) { return undefined; }
if (!isDefined($state.$current.includes[state.name])) { return false; }
return params ? equalForKeys(state.params.$$values(params), $stateParams, objectKeys(params)) : true;
};
/**
* @ngdoc function
* @name ui.router.state.$state#href
* @methodOf ui.router.state.$state
*
* @description
* A url generation method that returns the compiled url for the given state populated with the given params.
*
* @example
*
*
* @param {string|object} stateOrName The state name or state object you'd like to generate a url from.
* @param {object=} params An object of parameter values to fill the state's required parameters.
* @param {object=} options Options object. The options are:
*
* - **`lossy`** - {boolean=true} - If true, and if there is no url associated with the state provided in the
* first parameter, then the constructed href url will be built from the first navigable ancestor (aka
* ancestor with a valid url).
* - **`inherit`** - {boolean=true}, If `true` will inherit url parameters from current url.
* - **`relative`** - {object=$state.$current}, When transitioning with relative path (e.g '^'),
* defines which state to be relative from.
* - **`absolute`** - {boolean=false}, If true will generate an absolute url, e.g. "http://www.example.com/fullurl".
*
* @returns {string} compiled state url
*/
$state.href = function href(stateOrName, params, options) {
options = extend({
lossy: true,
inherit: true,
absolute: false,
relative: $state.$current
}, options || {});
var state = findState(stateOrName, options.relative);
if (!isDefined(state)) return null;
if (options.inherit) params = inheritParams($stateParams, params || {}, $state.$current, state);
var nav = (state && options.lossy) ? state.navigable : state;
if (!nav || nav.url === undefined || nav.url === null) {
return null;
}
return $urlRouter.href(nav.url, filterByKeys(state.params.$$keys(), params || {}), {
absolute: options.absolute
});
};
/**
* @ngdoc function
* @name ui.router.state.$state#get
* @methodOf ui.router.state.$state
*
* @description
* Returns the state configuration object for any specific state or all states.
*
* @param {string|object=} stateOrName (absolute or relative) If provided, will only get the config for
* the requested state. If not provided, returns an array of ALL state configs.
* @param {string|object=} context When stateOrName is a relative state reference, the state will be retrieved relative to context.
* @returns {Object|Array} State configuration object or array of all objects.
*/
$state.get = function (stateOrName, context) {
if (arguments.length === 0) return map(objectKeys(states), function(name) { return states[name].self; });
var state = findState(stateOrName, context || $state.$current);
return (state && state.self) ? state.self : null;
};
function resolveState(state, params, paramsAreFiltered, inherited, dst, options) {
// Make a restricted $stateParams with only the parameters that apply to this state if
// necessary. In addition to being available to the controller and onEnter/onExit callbacks,
// we also need $stateParams to be available for any $injector calls we make during the
// dependency resolution process.
var $stateParams = (paramsAreFiltered) ? params : filterByKeys(state.params.$$keys(), params);
var locals = { $stateParams: $stateParams };
// Resolve 'global' dependencies for the state, i.e. those not specific to a view.
// We're also including $stateParams in this; that way the parameters are restricted
// to the set that should be visible to the state, and are independent of when we update
// the global $state and $stateParams values.
dst.resolve = $resolve.resolve(state.resolve, locals, dst.resolve, state);
var promises = [dst.resolve.then(function (globals) {
dst.globals = globals;
})];
if (inherited) promises.push(inherited);
// Resolve template and dependencies for all views.
forEach(state.views, function (view, name) {
var injectables = (view.resolve && view.resolve !== state.resolve ? view.resolve : {});
injectables.$template = [ function () {
return $view.load(name, { view: view, locals: locals, params: $stateParams, notify: options.notify }) || '';
}];
promises.push($resolve.resolve(injectables, locals, dst.resolve, state).then(function (result) {
// References to the controller (only instantiated at link time)
if (isFunction(view.controllerProvider) || isArray(view.controllerProvider)) {
var injectLocals = angular.extend({}, injectables, locals);
result.$$controller = $injector.invoke(view.controllerProvider, null, injectLocals);
} else {
result.$$controller = view.controller;
}
// Provide access to the state itself for internal use
result.$$state = state;
result.$$controllerAs = view.controllerAs;
dst[name] = result;
}));
});
// Wait for all the promises and then return the activation object
return $q.all(promises).then(function (values) {
return dst;
});
}
return $state;
}
function shouldTriggerReload(to, from, locals, options) {
if (to === from && ((locals === from.locals && !options.reload) || (to.self.reloadOnSearch === false))) {
return true;
}
}
}
angular.module('ui.router.state')
.value('$stateParams', {})
.provider('$state', $StateProvider);
================================================
FILE: client/components/angular-ui-router/src/stateDirectives.js
================================================
function parseStateRef(ref, current) {
var preparsed = ref.match(/^\s*({[^}]*})\s*$/), parsed;
if (preparsed) ref = current + '(' + preparsed[1] + ')';
parsed = ref.replace(/\n/g, " ").match(/^([^(]+?)\s*(\((.*)\))?$/);
if (!parsed || parsed.length !== 4) throw new Error("Invalid state ref '" + ref + "'");
return { state: parsed[1], paramExpr: parsed[3] || null };
}
function stateContext(el) {
var stateData = el.parent().inheritedData('$uiView');
if (stateData && stateData.state && stateData.state.name) {
return stateData.state;
}
}
/**
* @ngdoc directive
* @name ui.router.state.directive:ui-sref
*
* @requires ui.router.state.$state
* @requires $timeout
*
* @restrict A
*
* @description
* A directive that binds a link (`` tag) to a state. If the state has an associated
* URL, the directive will automatically generate & update the `href` attribute via
* the {@link ui.router.state.$state#methods_href $state.href()} method. Clicking
* the link will trigger a state transition with optional parameters.
*
* Also middle-clicking, right-clicking, and ctrl-clicking on the link will be
* handled natively by the browser.
*
* You can also use relative state paths within ui-sref, just like the relative
* paths passed to `$state.go()`. You just need to be aware that the path is relative
* to the state that the link lives in, in other words the state that loaded the
* template containing the link.
*
* You can specify options to pass to {@link ui.router.state.$state#go $state.go()}
* using the `ui-sref-opts` attribute. Options are restricted to `location`, `inherit`,
* and `reload`.
*
* @example
* Here's an example of how you'd use ui-sref and how it would compile. If you have the
* following template:
*
*
*
*
* When the app state is "app.user" (or any children states), and contains the state parameter "user" with value "bilbobaggins",
* the resulting HTML will appear as (note the 'active' class):
*
*
*
* The class name is interpolated **once** during the directives link time (any further changes to the
* interpolated value are ignored).
*
* Multiple classes may be specified in a space-separated format:
*
*
*/
/**
* @ngdoc directive
* @name ui.router.state.directive:ui-sref-active-eq
*
* @requires ui.router.state.$state
* @requires ui.router.state.$stateParams
* @requires $interpolate
*
* @restrict A
*
* @description
* The same as {@link ui.router.state.directive:ui-sref-active ui-sref-active} but will only activate
* when the exact target state used in the `ui-sref` is active; no child states.
*
*/
$StateRefActiveDirective.$inject = ['$state', '$stateParams', '$interpolate'];
function $StateRefActiveDirective($state, $stateParams, $interpolate) {
return {
restrict: "A",
controller: ['$scope', '$element', '$attrs', function ($scope, $element, $attrs) {
var state, params, activeClass;
// There probably isn't much point in $observing this
// uiSrefActive and uiSrefActiveEq share the same directive object with some
// slight difference in logic routing
activeClass = $interpolate($attrs.uiSrefActiveEq || $attrs.uiSrefActive || '', false)($scope);
// Allow uiSref to communicate with uiSrefActive[Equals]
this.$$setStateInfo = function (newState, newParams) {
state = $state.get(newState, stateContext($element));
params = newParams;
update();
};
$scope.$on('$stateChangeSuccess', update);
// Update route state
function update() {
if (isMatch()) {
$element.addClass(activeClass);
} else {
$element.removeClass(activeClass);
}
}
function isMatch() {
if (typeof $attrs.uiSrefActiveEq !== 'undefined') {
return state && $state.is(state.name, params);
} else {
return state && $state.includes(state.name, params);
}
}
}]
};
}
angular.module('ui.router.state')
.directive('uiSref', $StateRefDirective)
.directive('uiSrefActive', $StateRefActiveDirective)
.directive('uiSrefActiveEq', $StateRefActiveDirective);
================================================
FILE: client/components/angular-ui-router/src/stateFilters.js
================================================
/**
* @ngdoc filter
* @name ui.router.state.filter:isState
*
* @requires ui.router.state.$state
*
* @description
* Translates to {@link ui.router.state.$state#methods_is $state.is("stateName")}.
*/
$IsStateFilter.$inject = ['$state'];
function $IsStateFilter($state) {
var isFilter = function (state) {
return $state.is(state);
};
isFilter.$stateful = true;
return isFilter;
}
/**
* @ngdoc filter
* @name ui.router.state.filter:includedByState
*
* @requires ui.router.state.$state
*
* @description
* Translates to {@link ui.router.state.$state#methods_includes $state.includes('fullOrPartialStateName')}.
*/
$IncludedByStateFilter.$inject = ['$state'];
function $IncludedByStateFilter($state) {
var includesFilter = function (state) {
return $state.includes(state);
};
includesFilter.$stateful = true;
return includesFilter;
}
angular.module('ui.router.state')
.filter('isState', $IsStateFilter)
.filter('includedByState', $IncludedByStateFilter);
================================================
FILE: client/components/angular-ui-router/src/templateFactory.js
================================================
/**
* @ngdoc object
* @name ui.router.util.$templateFactory
*
* @requires $http
* @requires $templateCache
* @requires $injector
*
* @description
* Service. Manages loading of templates.
*/
$TemplateFactory.$inject = ['$http', '$templateCache', '$injector'];
function $TemplateFactory( $http, $templateCache, $injector) {
/**
* @ngdoc function
* @name ui.router.util.$templateFactory#fromConfig
* @methodOf ui.router.util.$templateFactory
*
* @description
* Creates a template from a configuration object.
*
* @param {object} config Configuration object for which to load a template.
* The following properties are search in the specified order, and the first one
* that is defined is used to create the template:
*
* @param {string|object} config.template html string template or function to
* load via {@link ui.router.util.$templateFactory#fromString fromString}.
* @param {string|object} config.templateUrl url to load or a function returning
* the url to load via {@link ui.router.util.$templateFactory#fromUrl fromUrl}.
* @param {Function} config.templateProvider function to invoke via
* {@link ui.router.util.$templateFactory#fromProvider fromProvider}.
* @param {object} params Parameters to pass to the template function.
* @param {object} locals Locals to pass to `invoke` if the template is loaded
* via a `templateProvider`. Defaults to `{ params: params }`.
*
* @return {string|object} The template html as a string, or a promise for
* that string,or `null` if no template is configured.
*/
this.fromConfig = function (config, params, locals) {
return (
isDefined(config.template) ? this.fromString(config.template, params) :
isDefined(config.templateUrl) ? this.fromUrl(config.templateUrl, params) :
isDefined(config.templateProvider) ? this.fromProvider(config.templateProvider, params, locals) :
null
);
};
/**
* @ngdoc function
* @name ui.router.util.$templateFactory#fromString
* @methodOf ui.router.util.$templateFactory
*
* @description
* Creates a template from a string or a function returning a string.
*
* @param {string|object} template html template as a string or function that
* returns an html template as a string.
* @param {object} params Parameters to pass to the template function.
*
* @return {string|object} The template html as a string, or a promise for that
* string.
*/
this.fromString = function (template, params) {
return isFunction(template) ? template(params) : template;
};
/**
* @ngdoc function
* @name ui.router.util.$templateFactory#fromUrl
* @methodOf ui.router.util.$templateFactory
*
* @description
* Loads a template from the a URL via `$http` and `$templateCache`.
*
* @param {string|Function} url url of the template to load, or a function
* that returns a url.
* @param {Object} params Parameters to pass to the url function.
* @return {string|Promise.} The template html as a string, or a promise
* for that string.
*/
this.fromUrl = function (url, params) {
if (isFunction(url)) url = url(params);
if (url == null) return null;
else return $http
.get(url, { cache: $templateCache, headers: { Accept: 'text/html' }})
.then(function(response) { return response.data; });
};
/**
* @ngdoc function
* @name ui.router.util.$templateFactory#fromProvider
* @methodOf ui.router.util.$templateFactory
*
* @description
* Creates a template by invoking an injectable provider function.
*
* @param {Function} provider Function to invoke via `$injector.invoke`
* @param {Object} params Parameters for the template.
* @param {Object} locals Locals to pass to `invoke`. Defaults to
* `{ params: params }`.
* @return {string|Promise.} The template html as a string, or a promise
* for that string.
*/
this.fromProvider = function (provider, params, locals) {
return $injector.invoke(provider, null, locals || { params: params });
};
}
angular.module('ui.router.util').service('$templateFactory', $TemplateFactory);
================================================
FILE: client/components/angular-ui-router/src/urlMatcherFactory.js
================================================
var $$UMFP; // reference to $UrlMatcherFactoryProvider
/**
* @ngdoc object
* @name ui.router.util.type:UrlMatcher
*
* @description
* Matches URLs against patterns and extracts named parameters from the path or the search
* part of the URL. A URL pattern consists of a path pattern, optionally followed by '?' and a list
* of search parameters. Multiple search parameter names are separated by '&'. Search parameters
* do not influence whether or not a URL is matched, but their values are passed through into
* the matched parameters returned by {@link ui.router.util.type:UrlMatcher#methods_exec exec}.
*
* Path parameter placeholders can be specified using simple colon/catch-all syntax or curly brace
* syntax, which optionally allows a regular expression for the parameter to be specified:
*
* * `':'` name - colon placeholder
* * `'*'` name - catch-all placeholder
* * `'{' name '}'` - curly placeholder
* * `'{' name ':' regexp|type '}'` - curly placeholder with regexp or type name. Should the
* regexp itself contain curly braces, they must be in matched pairs or escaped with a backslash.
*
* Parameter names may contain only word characters (latin letters, digits, and underscore) and
* must be unique within the pattern (across both path and search parameters). For colon
* placeholders or curly placeholders without an explicit regexp, a path parameter matches any
* number of characters other than '/'. For catch-all placeholders the path parameter matches
* any number of characters.
*
* Examples:
*
* * `'/hello/'` - Matches only if the path is exactly '/hello/'. There is no special treatment for
* trailing slashes, and patterns have to match the entire path, not just a prefix.
* * `'/user/:id'` - Matches '/user/bob' or '/user/1234!!!' or even '/user/' but not '/user' or
* '/user/bob/details'. The second path segment will be captured as the parameter 'id'.
* * `'/user/{id}'` - Same as the previous example, but using curly brace syntax.
* * `'/user/{id:[^/]*}'` - Same as the previous example.
* * `'/user/{id:[0-9a-fA-F]{1,8}}'` - Similar to the previous example, but only matches if the id
* parameter consists of 1 to 8 hex digits.
* * `'/files/{path:.*}'` - Matches any URL starting with '/files/' and captures the rest of the
* path into the parameter 'path'.
* * `'/files/*path'` - ditto.
* * `'/calendar/{start:date}'` - Matches "/calendar/2014-11-12" (because the pattern defined
* in the built-in `date` Type matches `2014-11-12`) and provides a Date object in $stateParams.start
*
* @param {string} pattern The pattern to compile into a matcher.
* @param {Object} config A configuration object hash:
* @param {Object=} parentMatcher Used to concatenate the pattern/config onto
* an existing UrlMatcher
*
* * `caseInsensitive` - `true` if URL matching should be case insensitive, otherwise `false`, the default value (for backward compatibility) is `false`.
* * `strict` - `false` if matching against a URL with a trailing slash should be treated as equivalent to a URL without a trailing slash, the default value is `true`.
*
* @property {string} prefix A static prefix of this pattern. The matcher guarantees that any
* URL matching this matcher (i.e. any string for which {@link ui.router.util.type:UrlMatcher#methods_exec exec()} returns
* non-null) will start with this prefix.
*
* @property {string} source The pattern that was passed into the constructor
*
* @property {string} sourcePath The path portion of the source property
*
* @property {string} sourceSearch The search portion of the source property
*
* @property {string} regex The constructed regex that will be used to match against the url when
* it is time to determine which url will match.
*
* @returns {Object} New `UrlMatcher` object
*/
function UrlMatcher(pattern, config, parentMatcher) {
config = extend({ params: {} }, isObject(config) ? config : {});
// Find all placeholders and create a compiled pattern, using either classic or curly syntax:
// '*' name
// ':' name
// '{' name '}'
// '{' name ':' regexp '}'
// The regular expression is somewhat complicated due to the need to allow curly braces
// inside the regular expression. The placeholder regexp breaks down as follows:
// ([:*])([\w\[\]]+) - classic placeholder ($1 / $2) (search version has - for snake-case)
// \{([\w\[\]]+)(?:\:( ... ))?\} - curly brace placeholder ($3) with optional regexp/type ... ($4) (search version has - for snake-case
// (?: ... | ... | ... )+ - the regexp consists of any number of atoms, an atom being either
// [^{}\\]+ - anything other than curly braces or backslash
// \\. - a backslash escape
// \{(?:[^{}\\]+|\\.)*\} - a matched set of curly braces containing other atoms
var placeholder = /([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,
searchPlaceholder = /([:]?)([\w\[\]-]+)|\{([\w\[\]-]+)(?:\:((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,
compiled = '^', last = 0, m,
segments = this.segments = [],
parentParams = parentMatcher ? parentMatcher.params : {},
params = this.params = parentMatcher ? parentMatcher.params.$$new() : new $$UMFP.ParamSet(),
paramNames = [];
function addParameter(id, type, config, location) {
paramNames.push(id);
if (parentParams[id]) return parentParams[id];
if (!/^\w+(-+\w+)*(?:\[\])?$/.test(id)) throw new Error("Invalid parameter name '" + id + "' in pattern '" + pattern + "'");
if (params[id]) throw new Error("Duplicate parameter name '" + id + "' in pattern '" + pattern + "'");
params[id] = new $$UMFP.Param(id, type, config, location);
return params[id];
}
function quoteRegExp(string, pattern, squash) {
var surroundPattern = ['',''], result = string.replace(/[\\\[\]\^$*+?.()|{}]/g, "\\$&");
if (!pattern) return result;
switch(squash) {
case false: surroundPattern = ['(', ')']; break;
case true: surroundPattern = ['?(', ')?']; break;
default: surroundPattern = ['(' + squash + "|", ')?']; break;
}
return result + surroundPattern[0] + pattern + surroundPattern[1];
}
this.source = pattern;
// Split into static segments separated by path parameter placeholders.
// The number of segments is always 1 more than the number of parameters.
function matchDetails(m, isSearch) {
var id, regexp, segment, type, cfg, arrayMode;
id = m[2] || m[3]; // IE[78] returns '' for unmatched groups instead of null
cfg = config.params[id];
segment = pattern.substring(last, m.index);
regexp = isSearch ? m[4] : m[4] || (m[1] == '*' ? '.*' : null);
type = $$UMFP.type(regexp || "string") || inherit($$UMFP.type("string"), { pattern: new RegExp(regexp) });
return {
id: id, regexp: regexp, segment: segment, type: type, cfg: cfg
};
}
var p, param, segment;
while ((m = placeholder.exec(pattern))) {
p = matchDetails(m, false);
if (p.segment.indexOf('?') >= 0) break; // we're into the search part
param = addParameter(p.id, p.type, p.cfg, "path");
compiled += quoteRegExp(p.segment, param.type.pattern.source, param.squash);
segments.push(p.segment);
last = placeholder.lastIndex;
}
segment = pattern.substring(last);
// Find any search parameter names and remove them from the last segment
var i = segment.indexOf('?');
if (i >= 0) {
var search = this.sourceSearch = segment.substring(i);
segment = segment.substring(0, i);
this.sourcePath = pattern.substring(0, last + i);
if (search.length > 0) {
last = 0;
while ((m = searchPlaceholder.exec(search))) {
p = matchDetails(m, true);
param = addParameter(p.id, p.type, p.cfg, "search");
last = placeholder.lastIndex;
// check if ?&
}
}
} else {
this.sourcePath = pattern;
this.sourceSearch = '';
}
compiled += quoteRegExp(segment) + (config.strict === false ? '\/?' : '') + '$';
segments.push(segment);
this.regexp = new RegExp(compiled, config.caseInsensitive ? 'i' : undefined);
this.prefix = segments[0];
this.$$paramNames = paramNames;
}
/**
* @ngdoc function
* @name ui.router.util.type:UrlMatcher#concat
* @methodOf ui.router.util.type:UrlMatcher
*
* @description
* Returns a new matcher for a pattern constructed by appending the path part and adding the
* search parameters of the specified pattern to this pattern. The current pattern is not
* modified. This can be understood as creating a pattern for URLs that are relative to (or
* suffixes of) the current pattern.
*
* @example
* The following two matchers are equivalent:
*
* new UrlMatcher('/user/{id}?q').concat('/details?date');
* new UrlMatcher('/user/{id}/details?q&date');
*
*
* @param {string} pattern The pattern to append.
* @param {Object} config An object hash of the configuration for the matcher.
* @returns {UrlMatcher} A matcher for the concatenated pattern.
*/
UrlMatcher.prototype.concat = function (pattern, config) {
// Because order of search parameters is irrelevant, we can add our own search
// parameters to the end of the new pattern. Parse the new pattern by itself
// and then join the bits together, but it's much easier to do this on a string level.
var defaultConfig = {
caseInsensitive: $$UMFP.caseInsensitive(),
strict: $$UMFP.strictMode(),
squash: $$UMFP.defaultSquashPolicy()
};
return new UrlMatcher(this.sourcePath + pattern + this.sourceSearch, extend(defaultConfig, config), this);
};
UrlMatcher.prototype.toString = function () {
return this.source;
};
/**
* @ngdoc function
* @name ui.router.util.type:UrlMatcher#exec
* @methodOf ui.router.util.type:UrlMatcher
*
* @description
* Tests the specified path against this matcher, and returns an object containing the captured
* parameter values, or null if the path does not match. The returned object contains the values
* of any search parameters that are mentioned in the pattern, but their value may be null if
* they are not present in `searchParams`. This means that search parameters are always treated
* as optional.
*
* @example
*
*
* @param {string} path The URL path to match, e.g. `$location.path()`.
* @param {Object} searchParams URL search parameters, e.g. `$location.search()`.
* @returns {Object} The captured parameter values.
*/
UrlMatcher.prototype.exec = function (path, searchParams) {
var m = this.regexp.exec(path);
if (!m) return null;
searchParams = searchParams || {};
var paramNames = this.parameters(), nTotal = paramNames.length,
nPath = this.segments.length - 1,
values = {}, i, j, cfg, paramName;
if (nPath !== m.length - 1) throw new Error("Unbalanced capture group in route '" + this.source + "'");
function decodePathArray(string) {
function reverseString(str) { return str.split("").reverse().join(""); }
function unquoteDashes(str) { return str.replace(/\\-/, "-"); }
var split = reverseString(string).split(/-(?!\\)/);
var allReversed = map(split, reverseString);
return map(allReversed, unquoteDashes).reverse();
}
for (i = 0; i < nPath; i++) {
paramName = paramNames[i];
var param = this.params[paramName];
var paramVal = m[i+1];
// if the param value matches a pre-replace pair, replace the value before decoding.
for (j = 0; j < param.replace; j++) {
if (param.replace[j].from === paramVal) paramVal = param.replace[j].to;
}
if (paramVal && param.array === true) paramVal = decodePathArray(paramVal);
values[paramName] = param.value(paramVal);
}
for (/**/; i < nTotal; i++) {
paramName = paramNames[i];
values[paramName] = this.params[paramName].value(searchParams[paramName]);
}
return values;
};
/**
* @ngdoc function
* @name ui.router.util.type:UrlMatcher#parameters
* @methodOf ui.router.util.type:UrlMatcher
*
* @description
* Returns the names of all path and search parameters of this pattern in an unspecified order.
*
* @returns {Array.} An array of parameter names. Must be treated as read-only. If the
* pattern has no parameters, an empty array is returned.
*/
UrlMatcher.prototype.parameters = function (param) {
if (!isDefined(param)) return this.$$paramNames;
return this.params[param] || null;
};
/**
* @ngdoc function
* @name ui.router.util.type:UrlMatcher#validate
* @methodOf ui.router.util.type:UrlMatcher
*
* @description
* Checks an object hash of parameters to validate their correctness according to the parameter
* types of this `UrlMatcher`.
*
* @param {Object} params The object hash of parameters to validate.
* @returns {boolean} Returns `true` if `params` validates, otherwise `false`.
*/
UrlMatcher.prototype.validates = function (params) {
return this.params.$$validates(params);
};
/**
* @ngdoc function
* @name ui.router.util.type:UrlMatcher#format
* @methodOf ui.router.util.type:UrlMatcher
*
* @description
* Creates a URL that matches this pattern by substituting the specified values
* for the path and search parameters. Null values for path parameters are
* treated as empty strings.
*
* @example
*
*
* @param {Object} values the values to substitute for the parameters in this pattern.
* @returns {string} the formatted URL (path and optionally search part).
*/
UrlMatcher.prototype.format = function (values) {
values = values || {};
var segments = this.segments, params = this.parameters(), paramset = this.params;
if (!this.validates(values)) return null;
var i, search = false, nPath = segments.length - 1, nTotal = params.length, result = segments[0];
function encodeDashes(str) { // Replace dashes with encoded "\-"
return encodeURIComponent(str).replace(/-/g, function(c) { return '%5C%' + c.charCodeAt(0).toString(16).toUpperCase(); });
}
for (i = 0; i < nTotal; i++) {
var isPathParam = i < nPath;
var name = params[i], param = paramset[name], value = param.value(values[name]);
var isDefaultValue = param.isOptional && param.type.equals(param.value(), value);
var squash = isDefaultValue ? param.squash : false;
var encoded = param.type.encode(value);
if (isPathParam) {
var nextSegment = segments[i + 1];
if (squash === false) {
if (encoded != null) {
if (isArray(encoded)) {
result += map(encoded, encodeDashes).join("-");
} else {
result += encodeURIComponent(encoded);
}
}
result += nextSegment;
} else if (squash === true) {
var capture = result.match(/\/$/) ? /\/?(.*)/ : /(.*)/;
result += nextSegment.match(capture)[1];
} else if (isString(squash)) {
result += squash + nextSegment;
}
} else {
if (encoded == null || (isDefaultValue && squash !== false)) continue;
if (!isArray(encoded)) encoded = [ encoded ];
encoded = map(encoded, encodeURIComponent).join('&' + name + '=');
result += (search ? '&' : '?') + (name + '=' + encoded);
search = true;
}
}
return result;
};
/**
* @ngdoc object
* @name ui.router.util.type:Type
*
* @description
* Implements an interface to define custom parameter types that can be decoded from and encoded to
* string parameters matched in a URL. Used by {@link ui.router.util.type:UrlMatcher `UrlMatcher`}
* objects when matching or formatting URLs, or comparing or validating parameter values.
*
* See {@link ui.router.util.$urlMatcherFactory#methods_type `$urlMatcherFactory#type()`} for more
* information on registering custom types.
*
* @param {Object} config A configuration object which contains the custom type definition. The object's
* properties will override the default methods and/or pattern in `Type`'s public interface.
* @example
*
*
* @property {RegExp} pattern The regular expression pattern used to match values of this type when
* coming from a substring of a URL.
*
* @returns {Object} Returns a new `Type` object.
*/
function Type(config) {
extend(this, config);
}
/**
* @ngdoc function
* @name ui.router.util.type:Type#is
* @methodOf ui.router.util.type:Type
*
* @description
* Detects whether a value is of a particular type. Accepts a native (decoded) value
* and determines whether it matches the current `Type` object.
*
* @param {*} val The value to check.
* @param {string} key Optional. If the type check is happening in the context of a specific
* {@link ui.router.util.type:UrlMatcher `UrlMatcher`} object, this is the name of the
* parameter in which `val` is stored. Can be used for meta-programming of `Type` objects.
* @returns {Boolean} Returns `true` if the value matches the type, otherwise `false`.
*/
Type.prototype.is = function(val, key) {
return true;
};
/**
* @ngdoc function
* @name ui.router.util.type:Type#encode
* @methodOf ui.router.util.type:Type
*
* @description
* Encodes a custom/native type value to a string that can be embedded in a URL. Note that the
* return value does *not* need to be URL-safe (i.e. passed through `encodeURIComponent()`), it
* only needs to be a representation of `val` that has been coerced to a string.
*
* @param {*} val The value to encode.
* @param {string} key The name of the parameter in which `val` is stored. Can be used for
* meta-programming of `Type` objects.
* @returns {string} Returns a string representation of `val` that can be encoded in a URL.
*/
Type.prototype.encode = function(val, key) {
return val;
};
/**
* @ngdoc function
* @name ui.router.util.type:Type#decode
* @methodOf ui.router.util.type:Type
*
* @description
* Converts a parameter value (from URL string or transition param) to a custom/native value.
*
* @param {string} val The URL parameter value to decode.
* @param {string} key The name of the parameter in which `val` is stored. Can be used for
* meta-programming of `Type` objects.
* @returns {*} Returns a custom representation of the URL parameter value.
*/
Type.prototype.decode = function(val, key) {
return val;
};
/**
* @ngdoc function
* @name ui.router.util.type:Type#equals
* @methodOf ui.router.util.type:Type
*
* @description
* Determines whether two decoded values are equivalent.
*
* @param {*} a A value to compare against.
* @param {*} b A value to compare against.
* @returns {Boolean} Returns `true` if the values are equivalent/equal, otherwise `false`.
*/
Type.prototype.equals = function(a, b) {
return a == b;
};
Type.prototype.$subPattern = function() {
var sub = this.pattern.toString();
return sub.substr(1, sub.length - 2);
};
Type.prototype.pattern = /.*/;
Type.prototype.toString = function() { return "{Type:" + this.name + "}"; };
/*
* Wraps an existing custom Type as an array of Type, depending on 'mode'.
* e.g.:
* - urlmatcher pattern "/path?{queryParam[]:int}"
* - url: "/path?queryParam=1&queryParam=2
* - $stateParams.queryParam will be [1, 2]
* if `mode` is "auto", then
* - url: "/path?queryParam=1 will create $stateParams.queryParam: 1
* - url: "/path?queryParam=1&queryParam=2 will create $stateParams.queryParam: [1, 2]
*/
Type.prototype.$asArray = function(mode, isSearch) {
if (!mode) return this;
if (mode === "auto" && !isSearch) throw new Error("'auto' array mode is for query parameters only");
return new ArrayType(this, mode);
function ArrayType(type, mode) {
function bindTo(type, callbackName) {
return function() {
return type[callbackName].apply(type, arguments);
};
}
// Wrap non-array value as array
function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }
// Unwrap array value for "auto" mode. Return undefined for empty array.
function arrayUnwrap(val) {
switch(val.length) {
case 0: return undefined;
case 1: return mode === "auto" ? val[0] : val;
default: return val;
}
}
function falsey(val) { return !val; }
// Wraps type (.is/.encode/.decode) functions to operate on each value of an array
function arrayHandler(callback, allTruthyMode) {
return function handleArray(val) {
val = arrayWrap(val);
var result = map(val, callback);
if (allTruthyMode === true)
return filter(result, falsey).length === 0;
return arrayUnwrap(result);
};
}
// Wraps type (.equals) functions to operate on each value of an array
function arrayEqualsHandler(callback) {
return function handleArray(val1, val2) {
var left = arrayWrap(val1), right = arrayWrap(val2);
if (left.length !== right.length) return false;
for (var i = 0; i < left.length; i++) {
if (!callback(left[i], right[i])) return false;
}
return true;
};
}
this.encode = arrayHandler(bindTo(type, 'encode'));
this.decode = arrayHandler(bindTo(type, 'decode'));
this.is = arrayHandler(bindTo(type, 'is'), true);
this.equals = arrayEqualsHandler(bindTo(type, 'equals'));
this.pattern = type.pattern;
this.$arrayMode = mode;
}
};
/**
* @ngdoc object
* @name ui.router.util.$urlMatcherFactory
*
* @description
* Factory for {@link ui.router.util.type:UrlMatcher `UrlMatcher`} instances. The factory
* is also available to providers under the name `$urlMatcherFactoryProvider`.
*/
function $UrlMatcherFactory() {
$$UMFP = this;
var isCaseInsensitive = false, isStrictMode = true, defaultSquashPolicy = false;
function valToString(val) { return val != null ? val.toString().replace(/\//g, "%2F") : val; }
function valFromString(val) { return val != null ? val.toString().replace(/%2F/g, "/") : val; }
// TODO: in 1.0, make string .is() return false if value is undefined by default.
// function regexpMatches(val) { /*jshint validthis:true */ return isDefined(val) && this.pattern.test(val); }
function regexpMatches(val) { /*jshint validthis:true */ return this.pattern.test(val); }
var $types = {}, enqueue = true, typeQueue = [], injector, defaultTypes = {
string: {
encode: valToString,
decode: valFromString,
is: regexpMatches,
pattern: /[^/]*/
},
int: {
encode: valToString,
decode: function(val) { return parseInt(val, 10); },
is: function(val) { return isDefined(val) && this.decode(val.toString()) === val; },
pattern: /\d+/
},
bool: {
encode: function(val) { return val ? 1 : 0; },
decode: function(val) { return parseInt(val, 10) !== 0; },
is: function(val) { return val === true || val === false; },
pattern: /0|1/
},
date: {
encode: function (val) {
if (!this.is(val))
return undefined;
return [ val.getFullYear(),
('0' + (val.getMonth() + 1)).slice(-2),
('0' + val.getDate()).slice(-2)
].join("-");
},
decode: function (val) {
if (this.is(val)) return val;
var match = this.capture.exec(val);
return match ? new Date(match[1], match[2] - 1, match[3]) : undefined;
},
is: function(val) { return val instanceof Date && !isNaN(val.valueOf()); },
equals: function (a, b) { return this.is(a) && this.is(b) && a.toISOString() === b.toISOString(); },
pattern: /[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,
capture: /([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/
},
json: {
encode: angular.toJson,
decode: angular.fromJson,
is: angular.isObject,
equals: angular.equals,
pattern: /[^/]*/
},
any: { // does not encode/decode
encode: angular.identity,
decode: angular.identity,
is: angular.identity,
equals: angular.equals,
pattern: /.*/
}
};
function getDefaultConfig() {
return {
strict: isStrictMode,
caseInsensitive: isCaseInsensitive
};
}
function isInjectable(value) {
return (isFunction(value) || (isArray(value) && isFunction(value[value.length - 1])));
}
/**
* [Internal] Get the default value of a parameter, which may be an injectable function.
*/
$UrlMatcherFactory.$$getDefaultValue = function(config) {
if (!isInjectable(config.value)) return config.value;
if (!injector) throw new Error("Injectable functions cannot be called at configuration time");
return injector.invoke(config.value);
};
/**
* @ngdoc function
* @name ui.router.util.$urlMatcherFactory#caseInsensitive
* @methodOf ui.router.util.$urlMatcherFactory
*
* @description
* Defines whether URL matching should be case sensitive (the default behavior), or not.
*
* @param {boolean} value `false` to match URL in a case sensitive manner; otherwise `true`;
* @returns {boolean} the current value of caseInsensitive
*/
this.caseInsensitive = function(value) {
if (isDefined(value))
isCaseInsensitive = value;
return isCaseInsensitive;
};
/**
* @ngdoc function
* @name ui.router.util.$urlMatcherFactory#strictMode
* @methodOf ui.router.util.$urlMatcherFactory
*
* @description
* Defines whether URLs should match trailing slashes, or not (the default behavior).
*
* @param {boolean=} value `false` to match trailing slashes in URLs, otherwise `true`.
* @returns {boolean} the current value of strictMode
*/
this.strictMode = function(value) {
if (isDefined(value))
isStrictMode = value;
return isStrictMode;
};
/**
* @ngdoc function
* @name ui.router.util.$urlMatcherFactory#defaultSquashPolicy
* @methodOf ui.router.util.$urlMatcherFactory
*
* @description
* Sets the default behavior when generating or matching URLs with default parameter values.
*
* @param {string} value A string that defines the default parameter URL squashing behavior.
* `nosquash`: When generating an href with a default parameter value, do not squash the parameter value from the URL
* `slash`: When generating an href with a default parameter value, squash (remove) the parameter value, and, if the
* parameter is surrounded by slashes, squash (remove) one slash from the URL
* any other string, e.g. "~": When generating an href with a default parameter value, squash (remove)
* the parameter value from the URL and replace it with this string.
*/
this.defaultSquashPolicy = function(value) {
if (!isDefined(value)) return defaultSquashPolicy;
if (value !== true && value !== false && !isString(value))
throw new Error("Invalid squash policy: " + value + ". Valid policies: false, true, arbitrary-string");
defaultSquashPolicy = value;
return value;
};
/**
* @ngdoc function
* @name ui.router.util.$urlMatcherFactory#compile
* @methodOf ui.router.util.$urlMatcherFactory
*
* @description
* Creates a {@link ui.router.util.type:UrlMatcher `UrlMatcher`} for the specified pattern.
*
* @param {string} pattern The URL pattern.
* @param {Object} config The config object hash.
* @returns {UrlMatcher} The UrlMatcher.
*/
this.compile = function (pattern, config) {
return new UrlMatcher(pattern, extend(getDefaultConfig(), config));
};
/**
* @ngdoc function
* @name ui.router.util.$urlMatcherFactory#isMatcher
* @methodOf ui.router.util.$urlMatcherFactory
*
* @description
* Returns true if the specified object is a `UrlMatcher`, or false otherwise.
*
* @param {Object} object The object to perform the type check against.
* @returns {Boolean} Returns `true` if the object matches the `UrlMatcher` interface, by
* implementing all the same methods.
*/
this.isMatcher = function (o) {
if (!isObject(o)) return false;
var result = true;
forEach(UrlMatcher.prototype, function(val, name) {
if (isFunction(val)) {
result = result && (isDefined(o[name]) && isFunction(o[name]));
}
});
return result;
};
/**
* @ngdoc function
* @name ui.router.util.$urlMatcherFactory#type
* @methodOf ui.router.util.$urlMatcherFactory
*
* @description
* Registers a custom {@link ui.router.util.type:Type `Type`} object that can be used to
* generate URLs with typed parameters.
*
* @param {string} name The type name.
* @param {Object|Function} definition The type definition. See
* {@link ui.router.util.type:Type `Type`} for information on the values accepted.
* @param {Object|Function} definitionFn (optional) A function that is injected before the app
* runtime starts. The result of this function is merged into the existing `definition`.
* See {@link ui.router.util.type:Type `Type`} for information on the values accepted.
*
* @returns {Object} Returns `$urlMatcherFactoryProvider`.
*
* @example
* This is a simple example of a custom type that encodes and decodes items from an
* array, using the array index as the URL-encoded value:
*
*
* var list = ['John', 'Paul', 'George', 'Ringo'];
*
* $urlMatcherFactoryProvider.type('listItem', {
* encode: function(item) {
* // Represent the list item in the URL using its corresponding index
* return list.indexOf(item);
* },
* decode: function(item) {
* // Look up the list item by index
* return list[parseInt(item, 10)];
* },
* is: function(item) {
* // Ensure the item is valid by checking to see that it appears
* // in the list
* return list.indexOf(item) > -1;
* }
* });
*
* $stateProvider.state('list', {
* url: "/list/{item:listItem}",
* controller: function($scope, $stateParams) {
* console.log($stateParams.item);
* }
* });
*
* // ...
*
* // Changes URL to '/list/3', logs "Ringo" to the console
* $state.go('list', { item: "Ringo" });
*
*
* This is a more complex example of a type that relies on dependency injection to
* interact with services, and uses the parameter name from the URL to infer how to
* handle encoding and decoding parameter values:
*
*
* // Defines a custom type that gets a value from a service,
* // where each service gets different types of values from
* // a backend API:
* $urlMatcherFactoryProvider.type('dbObject', {}, function(Users, Posts) {
*
* // Matches up services to URL parameter names
* var services = {
* user: Users,
* post: Posts
* };
*
* return {
* encode: function(object) {
* // Represent the object in the URL using its unique ID
* return object.id;
* },
* decode: function(value, key) {
* // Look up the object by ID, using the parameter
* // name (key) to call the correct service
* return services[key].findById(value);
* },
* is: function(object, key) {
* // Check that object is a valid dbObject
* return angular.isObject(object) && object.id && services[key];
* }
* equals: function(a, b) {
* // Check the equality of decoded objects by comparing
* // their unique IDs
* return a.id === b.id;
* }
* };
* });
*
* // In a config() block, you can then attach URLs with
* // type-annotated parameters:
* $stateProvider.state('users', {
* url: "/users",
* // ...
* }).state('users.item', {
* url: "/{user:dbObject}",
* controller: function($scope, $stateParams) {
* // $stateParams.user will now be an object returned from
* // the Users service
* },
* // ...
* });
*
*/
this.type = function (name, definition, definitionFn) {
if (!isDefined(definition)) return $types[name];
if ($types.hasOwnProperty(name)) throw new Error("A type named '" + name + "' has already been defined.");
$types[name] = new Type(extend({ name: name }, definition));
if (definitionFn) {
typeQueue.push({ name: name, def: definitionFn });
if (!enqueue) flushTypeQueue();
}
return this;
};
// `flushTypeQueue()` waits until `$urlMatcherFactory` is injected before invoking the queued `definitionFn`s
function flushTypeQueue() {
while(typeQueue.length) {
var type = typeQueue.shift();
if (type.pattern) throw new Error("You cannot override a type's .pattern at runtime.");
angular.extend($types[type.name], injector.invoke(type.def));
}
}
// Register default types. Store them in the prototype of $types.
forEach(defaultTypes, function(type, name) { $types[name] = new Type(extend({name: name}, type)); });
$types = inherit($types, {});
/* No need to document $get, since it returns this */
this.$get = ['$injector', function ($injector) {
injector = $injector;
enqueue = false;
flushTypeQueue();
forEach(defaultTypes, function(type, name) {
if (!$types[name]) $types[name] = new Type(type);
});
return this;
}];
this.Param = function Param(id, type, config, location) {
var self = this;
config = unwrapShorthand(config);
type = getType(config, type, location);
var arrayMode = getArrayMode();
type = arrayMode ? type.$asArray(arrayMode, location === "search") : type;
if (type.name === "string" && !arrayMode && location === "path" && config.value === undefined)
config.value = ""; // for 0.2.x; in 0.3.0+ do not automatically default to ""
var isOptional = config.value !== undefined;
var squash = getSquashPolicy(config, isOptional);
var replace = getReplace(config, arrayMode, isOptional, squash);
function unwrapShorthand(config) {
var keys = isObject(config) ? objectKeys(config) : [];
var isShorthand = indexOf(keys, "value") === -1 && indexOf(keys, "type") === -1 &&
indexOf(keys, "squash") === -1 && indexOf(keys, "array") === -1;
if (isShorthand) config = { value: config };
config.$$fn = isInjectable(config.value) ? config.value : function () { return config.value; };
return config;
}
function getType(config, urlType, location) {
if (config.type && urlType) throw new Error("Param '"+id+"' has two type configurations.");
if (urlType) return urlType;
if (!config.type) return (location === "config" ? $types.any : $types.string);
return config.type instanceof Type ? config.type : new Type(config.type);
}
// array config: param name (param[]) overrides default settings. explicit config overrides param name.
function getArrayMode() {
var arrayDefaults = { array: (location === "search" ? "auto" : false) };
var arrayParamNomenclature = id.match(/\[\]$/) ? { array: true } : {};
return extend(arrayDefaults, arrayParamNomenclature, config).array;
}
/**
* returns false, true, or the squash value to indicate the "default parameter url squash policy".
*/
function getSquashPolicy(config, isOptional) {
var squash = config.squash;
if (!isOptional || squash === false) return false;
if (!isDefined(squash) || squash == null) return defaultSquashPolicy;
if (squash === true || isString(squash)) return squash;
throw new Error("Invalid squash policy: '" + squash + "'. Valid policies: false, true, or arbitrary string");
}
function getReplace(config, arrayMode, isOptional, squash) {
var replace, configuredKeys, defaultPolicy = [
{ from: "", to: (isOptional || arrayMode ? undefined : "") },
{ from: null, to: (isOptional || arrayMode ? undefined : "") }
];
replace = isArray(config.replace) ? config.replace : [];
if (isString(squash))
replace.push({ from: squash, to: undefined });
configuredKeys = map(replace, function(item) { return item.from; } );
return filter(defaultPolicy, function(item) { return indexOf(configuredKeys, item.from) === -1; }).concat(replace);
}
/**
* [Internal] Get the default value of a parameter, which may be an injectable function.
*/
function $$getDefaultValue() {
if (!injector) throw new Error("Injectable functions cannot be called at configuration time");
return injector.invoke(config.$$fn);
}
/**
* [Internal] Gets the decoded representation of a value if the value is defined, otherwise, returns the
* default value, which may be the result of an injectable function.
*/
function $value(value) {
function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }
function $replace(value) {
var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });
return replacement.length ? replacement[0] : value;
}
value = $replace(value);
return isDefined(value) ? self.type.decode(value) : $$getDefaultValue();
}
function toString() { return "{Param:" + id + " " + type + " squash: '" + squash + "' optional: " + isOptional + "}"; }
extend(this, {
id: id,
type: type,
location: location,
array: arrayMode,
squash: squash,
replace: replace,
isOptional: isOptional,
value: $value,
dynamic: undefined,
config: config,
toString: toString
});
};
function ParamSet(params) {
extend(this, params || {});
}
ParamSet.prototype = {
$$new: function() {
return inherit(this, extend(new ParamSet(), { $$parent: this}));
},
$$keys: function () {
var keys = [], chain = [], parent = this,
ignore = objectKeys(ParamSet.prototype);
while (parent) { chain.push(parent); parent = parent.$$parent; }
chain.reverse();
forEach(chain, function(paramset) {
forEach(objectKeys(paramset), function(key) {
if (indexOf(keys, key) === -1 && indexOf(ignore, key) === -1) keys.push(key);
});
});
return keys;
},
$$values: function(paramValues) {
var values = {}, self = this;
forEach(self.$$keys(), function(key) {
values[key] = self[key].value(paramValues && paramValues[key]);
});
return values;
},
$$equals: function(paramValues1, paramValues2) {
var equal = true, self = this;
forEach(self.$$keys(), function(key) {
var left = paramValues1 && paramValues1[key], right = paramValues2 && paramValues2[key];
if (!self[key].type.equals(left, right)) equal = false;
});
return equal;
},
$$validates: function $$validate(paramValues) {
var result = true, isOptional, val, param, self = this;
forEach(this.$$keys(), function(key) {
param = self[key];
val = paramValues[key];
isOptional = !val && param.isOptional;
result = result && (isOptional || !!param.type.is(val));
});
return result;
},
$$parent: undefined
};
this.ParamSet = ParamSet;
}
// Register as a provider so it's available to other providers
angular.module('ui.router.util').provider('$urlMatcherFactory', $UrlMatcherFactory);
angular.module('ui.router.util').run(['$urlMatcherFactory', function($urlMatcherFactory) { }]);
================================================
FILE: client/components/angular-ui-router/src/urlRouter.js
================================================
/**
* @ngdoc object
* @name ui.router.router.$urlRouterProvider
*
* @requires ui.router.util.$urlMatcherFactoryProvider
* @requires $locationProvider
*
* @description
* `$urlRouterProvider` has the responsibility of watching `$location`.
* When `$location` changes it runs through a list of rules one by one until a
* match is found. `$urlRouterProvider` is used behind the scenes anytime you specify
* a url in a state configuration. All urls are compiled into a UrlMatcher object.
*
* There are several methods on `$urlRouterProvider` that make it useful to use directly
* in your module config.
*/
$UrlRouterProvider.$inject = ['$locationProvider', '$urlMatcherFactoryProvider'];
function $UrlRouterProvider( $locationProvider, $urlMatcherFactory) {
var rules = [], otherwise = null, interceptDeferred = false, listener;
// Returns a string that is a prefix of all strings matching the RegExp
function regExpPrefix(re) {
var prefix = /^\^((?:\\[^a-zA-Z0-9]|[^\\\[\]\^$*+?.()|{}]+)*)/.exec(re.source);
return (prefix != null) ? prefix[1].replace(/\\(.)/g, "$1") : '';
}
// Interpolates matched values into a String.replace()-style pattern
function interpolate(pattern, match) {
return pattern.replace(/\$(\$|\d{1,2})/, function (m, what) {
return match[what === '$' ? 0 : Number(what)];
});
}
/**
* @ngdoc function
* @name ui.router.router.$urlRouterProvider#rule
* @methodOf ui.router.router.$urlRouterProvider
*
* @description
* Defines rules that are used by `$urlRouterProvider` to find matches for
* specific URLs.
*
* @example
*
* var app = angular.module('app', ['ui.router.router']);
*
* app.config(function ($urlRouterProvider) {
* // Here's an example of how you might allow case insensitive urls
* $urlRouterProvider.rule(function ($injector, $location) {
* var path = $location.path(),
* normalized = path.toLowerCase();
*
* if (path !== normalized) {
* return normalized;
* }
* });
* });
*
*
* @param {object} rule Handler function that takes `$injector` and `$location`
* services as arguments. You can use them to return a valid path as a string.
*
* @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance
*/
this.rule = function (rule) {
if (!isFunction(rule)) throw new Error("'rule' must be a function");
rules.push(rule);
return this;
};
/**
* @ngdoc object
* @name ui.router.router.$urlRouterProvider#otherwise
* @methodOf ui.router.router.$urlRouterProvider
*
* @description
* Defines a path that is used when an invalid route is requested.
*
* @example
*
* var app = angular.module('app', ['ui.router.router']);
*
* app.config(function ($urlRouterProvider) {
* // if the path doesn't match any of the urls you configured
* // otherwise will take care of routing the user to the
* // specified url
* $urlRouterProvider.otherwise('/index');
*
* // Example of using function rule as param
* $urlRouterProvider.otherwise(function ($injector, $location) {
* return '/a/valid/url';
* });
* });
*
*
* @param {string|object} rule The url path you want to redirect to or a function
* rule that returns the url path. The function version is passed two params:
* `$injector` and `$location` services, and must return a url string.
*
* @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance
*/
this.otherwise = function (rule) {
if (isString(rule)) {
var redirect = rule;
rule = function () { return redirect; };
}
else if (!isFunction(rule)) throw new Error("'rule' must be a function");
otherwise = rule;
return this;
};
function handleIfMatch($injector, handler, match) {
if (!match) return false;
var result = $injector.invoke(handler, handler, { $match: match });
return isDefined(result) ? result : true;
}
/**
* @ngdoc function
* @name ui.router.router.$urlRouterProvider#when
* @methodOf ui.router.router.$urlRouterProvider
*
* @description
* Registers a handler for a given url matching. if handle is a string, it is
* treated as a redirect, and is interpolated according to the syntax of match
* (i.e. like `String.replace()` for `RegExp`, or like a `UrlMatcher` pattern otherwise).
*
* If the handler is a function, it is injectable. It gets invoked if `$location`
* matches. You have the option of inject the match object as `$match`.
*
* The handler can return
*
* - **falsy** to indicate that the rule didn't match after all, then `$urlRouter`
* will continue trying to find another one that matches.
* - **string** which is treated as a redirect and passed to `$location.url()`
* - **void** or any **truthy** value tells `$urlRouter` that the url was handled.
*
* @example
*
* var app = angular.module('app', ['ui.router.router']);
*
* app.config(function ($urlRouterProvider) {
* $urlRouterProvider.when($state.url, function ($match, $stateParams) {
* if ($state.$current.navigable !== state ||
* !equalForKeys($match, $stateParams) {
* $state.transitionTo(state, $match, false);
* }
* });
* });
*
*
* @param {string|object} what The incoming path that you want to redirect.
* @param {string|object} handler The path you want to redirect your user to.
*/
this.when = function (what, handler) {
var redirect, handlerIsString = isString(handler);
if (isString(what)) what = $urlMatcherFactory.compile(what);
if (!handlerIsString && !isFunction(handler) && !isArray(handler))
throw new Error("invalid 'handler' in when()");
var strategies = {
matcher: function (what, handler) {
if (handlerIsString) {
redirect = $urlMatcherFactory.compile(handler);
handler = ['$match', function ($match) { return redirect.format($match); }];
}
return extend(function ($injector, $location) {
return handleIfMatch($injector, handler, what.exec($location.path(), $location.search()));
}, {
prefix: isString(what.prefix) ? what.prefix : ''
});
},
regex: function (what, handler) {
if (what.global || what.sticky) throw new Error("when() RegExp must not be global or sticky");
if (handlerIsString) {
redirect = handler;
handler = ['$match', function ($match) { return interpolate(redirect, $match); }];
}
return extend(function ($injector, $location) {
return handleIfMatch($injector, handler, what.exec($location.path()));
}, {
prefix: regExpPrefix(what)
});
}
};
var check = { matcher: $urlMatcherFactory.isMatcher(what), regex: what instanceof RegExp };
for (var n in check) {
if (check[n]) return this.rule(strategies[n](what, handler));
}
throw new Error("invalid 'what' in when()");
};
/**
* @ngdoc function
* @name ui.router.router.$urlRouterProvider#deferIntercept
* @methodOf ui.router.router.$urlRouterProvider
*
* @description
* Disables (or enables) deferring location change interception.
*
* If you wish to customize the behavior of syncing the URL (for example, if you wish to
* defer a transition but maintain the current URL), call this method at configuration time.
* Then, at run time, call `$urlRouter.listen()` after you have configured your own
* `$locationChangeSuccess` event handler.
*
* @example
*
* var app = angular.module('app', ['ui.router.router']);
*
* app.config(function ($urlRouterProvider) {
*
* // Prevent $urlRouter from automatically intercepting URL changes;
* // this allows you to configure custom behavior in between
* // location changes and route synchronization:
* $urlRouterProvider.deferIntercept();
*
* }).run(function ($rootScope, $urlRouter, UserService) {
*
* $rootScope.$on('$locationChangeSuccess', function(e) {
* // UserService is an example service for managing user state
* if (UserService.isLoggedIn()) return;
*
* // Prevent $urlRouter's default handler from firing
* e.preventDefault();
*
* UserService.handleLogin().then(function() {
* // Once the user has logged in, sync the current URL
* // to the router:
* $urlRouter.sync();
* });
* });
*
* // Configures $urlRouter's listener *after* your custom listener
* $urlRouter.listen();
* });
*
*
* @param {boolean} defer Indicates whether to defer location change interception. Passing
no parameter is equivalent to `true`.
*/
this.deferIntercept = function (defer) {
if (defer === undefined) defer = true;
interceptDeferred = defer;
};
/**
* @ngdoc object
* @name ui.router.router.$urlRouter
*
* @requires $location
* @requires $rootScope
* @requires $injector
* @requires $browser
*
* @description
*
*/
this.$get = $get;
$get.$inject = ['$location', '$rootScope', '$injector', '$browser'];
function $get( $location, $rootScope, $injector, $browser) {
var baseHref = $browser.baseHref(), location = $location.url(), lastPushedUrl;
function appendBasePath(url, isHtml5, absolute) {
if (baseHref === '/') return url;
if (isHtml5) return baseHref.slice(0, -1) + url;
if (absolute) return baseHref.slice(1) + url;
return url;
}
// TODO: Optimize groups of rules with non-empty prefix into some sort of decision tree
function update(evt) {
if (evt && evt.defaultPrevented) return;
var ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl;
lastPushedUrl = undefined;
if (ignoreUpdate) return true;
function check(rule) {
var handled = rule($injector, $location);
if (!handled) return false;
if (isString(handled)) $location.replace().url(handled);
return true;
}
var n = rules.length, i;
for (i = 0; i < n; i++) {
if (check(rules[i])) return;
}
// always check otherwise last to allow dynamic updates to the set of rules
if (otherwise) check(otherwise);
}
function listen() {
listener = listener || $rootScope.$on('$locationChangeSuccess', update);
return listener;
}
if (!interceptDeferred) listen();
return {
/**
* @ngdoc function
* @name ui.router.router.$urlRouter#sync
* @methodOf ui.router.router.$urlRouter
*
* @description
* Triggers an update; the same update that happens when the address bar url changes, aka `$locationChangeSuccess`.
* This method is useful when you need to use `preventDefault()` on the `$locationChangeSuccess` event,
* perform some custom logic (route protection, auth, config, redirection, etc) and then finally proceed
* with the transition by calling `$urlRouter.sync()`.
*
* @example
*
* angular.module('app', ['ui.router'])
* .run(function($rootScope, $urlRouter) {
* $rootScope.$on('$locationChangeSuccess', function(evt) {
* // Halt state change from even starting
* evt.preventDefault();
* // Perform custom logic
* var meetsRequirement = ...
* // Continue with the update and state transition if logic allows
* if (meetsRequirement) $urlRouter.sync();
* });
* });
*
*/
sync: function() {
update();
},
listen: function() {
return listen();
},
update: function(read) {
if (read) {
location = $location.url();
return;
}
if ($location.url() === location) return;
$location.url(location);
$location.replace();
},
push: function(urlMatcher, params, options) {
$location.url(urlMatcher.format(params || {}));
lastPushedUrl = options && options.$$avoidResync ? $location.url() : undefined;
if (options && options.replace) $location.replace();
},
/**
* @ngdoc function
* @name ui.router.router.$urlRouter#href
* @methodOf ui.router.router.$urlRouter
*
* @description
* A URL generation method that returns the compiled URL for a given
* {@link ui.router.util.type:UrlMatcher `UrlMatcher`}, populated with the provided parameters.
*
* @example
*
*
* @param {UrlMatcher} urlMatcher The `UrlMatcher` object which is used as the template of the URL to generate.
* @param {object=} params An object of parameter values to fill the matcher's required parameters.
* @param {object=} options Options object. The options are:
*
* - **`absolute`** - {boolean=false}, If true will generate an absolute url, e.g. "http://www.example.com/fullurl".
*
* @returns {string} Returns the fully compiled URL, or `null` if `params` fail validation against `urlMatcher`
*/
href: function(urlMatcher, params, options) {
if (!urlMatcher.validates(params)) return null;
var isHtml5 = $locationProvider.html5Mode();
if (angular.isObject(isHtml5)) {
isHtml5 = isHtml5.enabled;
}
var url = urlMatcher.format(params);
options = options || {};
if (!isHtml5 && url !== null) {
url = "#" + $locationProvider.hashPrefix() + url;
}
url = appendBasePath(url, isHtml5, options.absolute);
if (!options.absolute || !url) {
return url;
}
var slash = (!isHtml5 && url ? '/' : ''), port = $location.port();
port = (port === 80 || port === 443 ? '' : ':' + port);
return [$location.protocol(), '://', $location.host(), port, slash, url].join('');
}
};
}
}
angular.module('ui.router.router').provider('$urlRouter', $UrlRouterProvider);
================================================
FILE: client/components/angular-ui-router/src/view.js
================================================
$ViewProvider.$inject = [];
function $ViewProvider() {
this.$get = $get;
/**
* @ngdoc object
* @name ui.router.state.$view
*
* @requires ui.router.util.$templateFactory
* @requires $rootScope
*
* @description
*
*/
$get.$inject = ['$rootScope', '$templateFactory'];
function $get( $rootScope, $templateFactory) {
return {
// $view.load('full.viewName', { template: ..., controller: ..., resolve: ..., async: false, params: ... })
/**
* @ngdoc function
* @name ui.router.state.$view#load
* @methodOf ui.router.state.$view
*
* @description
*
* @param {string} name name
* @param {object} options option object.
*/
load: function load(name, options) {
var result, defaults = {
template: null, controller: null, view: null, locals: null, notify: true, async: true, params: {}
};
options = extend(defaults, options);
if (options.view) {
result = $templateFactory.fromConfig(options.view, options.params, options.locals);
}
if (result && options.notify) {
/**
* @ngdoc event
* @name ui.router.state.$state#$viewContentLoading
* @eventOf ui.router.state.$view
* @eventType broadcast on root scope
* @description
*
* Fired once the view **begins loading**, *before* the DOM is rendered.
*
* @param {Object} event Event object.
* @param {Object} viewConfig The view config properties (template, controller, etc).
*
* @example
*
*
* $scope.$on('$viewContentLoading',
* function(event, viewConfig){
* // Access to all the view config properties.
* // and one special property 'targetView'
* // viewConfig.targetView
* });
*
*/
$rootScope.$broadcast('$viewContentLoading', options);
}
return result;
}
};
}
}
angular.module('ui.router.state').provider('$view', $ViewProvider);
================================================
FILE: client/components/angular-ui-router/src/viewDirective.js
================================================
/**
* @ngdoc directive
* @name ui.router.state.directive:ui-view
*
* @requires ui.router.state.$state
* @requires $compile
* @requires $controller
* @requires $injector
* @requires ui.router.state.$uiViewScroll
* @requires $document
*
* @restrict ECA
*
* @description
* The ui-view directive tells $state where to place your templates.
*
* @param {string=} name A view name. The name should be unique amongst the other views in the
* same state. You can have views of the same name that live in different states.
*
* @param {string=} autoscroll It allows you to set the scroll behavior of the browser window
* when a view is populated. By default, $anchorScroll is overridden by ui-router's custom scroll
* service, {@link ui.router.state.$uiViewScroll}. This custom service let's you
* scroll ui-view elements into view when they are populated during a state activation.
*
* *Note: To revert back to old [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll)
* functionality, call `$uiViewScrollProvider.useAnchorScroll()`.*
*
* @param {string=} onload Expression to evaluate whenever the view updates.
*
* @example
* A view can be unnamed or named.
*
*
*
*
*
*
*
*
* You can only have one unnamed view within any template (or root html). If you are only using a
* single view and it is unnamed then you can populate it like so:
*
*
* $stateProvider.state("home", {
* template: "
HELLO!
"
* })
*
*
* The above is a convenient shortcut equivalent to specifying your view explicitly with the {@link ui.router.state.$stateProvider#views `views`}
* config property, by name, in this case an empty name:
*
*
* But typically you'll only use the views property if you name your view or have more than one view
* in the same template. There's not really a compelling reason to name a view if its the only one,
* but you could if you wanted, like so:
*
*/
$ViewDirective.$inject = ['$state', '$injector', '$uiViewScroll', '$interpolate'];
function $ViewDirective( $state, $injector, $uiViewScroll, $interpolate) {
function getService() {
return ($injector.has) ? function(service) {
return $injector.has(service) ? $injector.get(service) : null;
} : function(service) {
try {
return $injector.get(service);
} catch (e) {
return null;
}
};
}
var service = getService(),
$animator = service('$animator'),
$animate = service('$animate');
// Returns a set of DOM manipulation functions based on which Angular version
// it should use
function getRenderer(attrs, scope) {
var statics = function() {
return {
enter: function (element, target, cb) { target.after(element); cb(); },
leave: function (element, cb) { element.remove(); cb(); }
};
};
if ($animate) {
return {
enter: function(element, target, cb) {
var promise = $animate.enter(element, null, target, cb);
if (promise && promise.then) promise.then(cb);
},
leave: function(element, cb) {
var promise = $animate.leave(element, cb);
if (promise && promise.then) promise.then(cb);
}
};
}
if ($animator) {
var animate = $animator && $animator(scope, attrs);
return {
enter: function(element, target, cb) {animate.enter(element, null, target); cb(); },
leave: function(element, cb) { animate.leave(element); cb(); }
};
}
return statics();
}
var directive = {
restrict: 'ECA',
terminal: true,
priority: 400,
transclude: 'element',
compile: function (tElement, tAttrs, $transclude) {
return function (scope, $element, attrs) {
var previousEl, currentEl, currentScope, latestLocals,
onloadExp = attrs.onload || '',
autoScrollExp = attrs.autoscroll,
renderer = getRenderer(attrs, scope);
scope.$on('$stateChangeSuccess', function() {
updateView(false);
});
scope.$on('$viewContentLoading', function() {
updateView(false);
});
updateView(true);
function cleanupLastView() {
if (previousEl) {
previousEl.remove();
previousEl = null;
}
if (currentScope) {
currentScope.$destroy();
currentScope = null;
}
if (currentEl) {
renderer.leave(currentEl, function() {
previousEl = null;
});
previousEl = currentEl;
currentEl = null;
}
}
function updateView(firstTime) {
var newScope,
name = getUiViewName(scope, attrs, $element, $interpolate),
previousLocals = name && $state.$current && $state.$current.locals[name];
if (!firstTime && previousLocals === latestLocals) return; // nothing to do
newScope = scope.$new();
latestLocals = $state.$current.locals[name];
var clone = $transclude(newScope, function(clone) {
renderer.enter(clone, $element, function onUiViewEnter() {
if(currentScope) {
currentScope.$emit('$viewContentAnimationEnded');
}
if (angular.isDefined(autoScrollExp) && !autoScrollExp || scope.$eval(autoScrollExp)) {
$uiViewScroll(clone);
}
});
cleanupLastView();
});
currentEl = clone;
currentScope = newScope;
/**
* @ngdoc event
* @name ui.router.state.directive:ui-view#$viewContentLoaded
* @eventOf ui.router.state.directive:ui-view
* @eventType emits on ui-view directive scope
* @description *
* Fired once the view is **loaded**, *after* the DOM is rendered.
*
* @param {Object} event Event object.
*/
currentScope.$emit('$viewContentLoaded');
currentScope.$eval(onloadExp);
}
};
}
};
return directive;
}
$ViewDirectiveFill.$inject = ['$compile', '$controller', '$state', '$interpolate'];
function $ViewDirectiveFill ( $compile, $controller, $state, $interpolate) {
return {
restrict: 'ECA',
priority: -400,
compile: function (tElement) {
var initial = tElement.html();
return function (scope, $element, attrs) {
var current = $state.$current,
name = getUiViewName(scope, attrs, $element, $interpolate),
locals = current && current.locals[name];
if (! locals) {
return;
}
$element.data('$uiView', { name: name, state: locals.$$state });
$element.html(locals.$template ? locals.$template : initial);
var link = $compile($element.contents());
if (locals.$$controller) {
locals.$scope = scope;
var controller = $controller(locals.$$controller, locals);
if (locals.$$controllerAs) {
scope[locals.$$controllerAs] = controller;
}
$element.data('$ngControllerController', controller);
$element.children().data('$ngControllerController', controller);
}
link(scope);
};
}
};
}
/**
* Shared ui-view code for both directives:
* Given scope, element, and its attributes, return the view's name
*/
function getUiViewName(scope, attrs, element, $interpolate) {
var name = $interpolate(attrs.uiView || attrs.name || '')(scope);
var inherited = element.inheritedData('$uiView');
return name.indexOf('@') >= 0 ? name : (name + '@' + (inherited ? inherited.state.name : ''));
}
angular.module('ui.router.state').directive('uiView', $ViewDirective);
angular.module('ui.router.state').directive('uiView', $ViewDirectiveFill);
================================================
FILE: client/components/angular-ui-router/src/viewScroll.js
================================================
/**
* @ngdoc object
* @name ui.router.state.$uiViewScrollProvider
*
* @description
* Provider that returns the {@link ui.router.state.$uiViewScroll} service function.
*/
function $ViewScrollProvider() {
var useAnchorScroll = false;
/**
* @ngdoc function
* @name ui.router.state.$uiViewScrollProvider#useAnchorScroll
* @methodOf ui.router.state.$uiViewScrollProvider
*
* @description
* Reverts back to using the core [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll) service for
* scrolling based on the url anchor.
*/
this.useAnchorScroll = function () {
useAnchorScroll = true;
};
/**
* @ngdoc object
* @name ui.router.state.$uiViewScroll
*
* @requires $anchorScroll
* @requires $timeout
*
* @description
* When called with a jqLite element, it scrolls the element into view (after a
* `$timeout` so the DOM has time to refresh).
*
* If you prefer to rely on `$anchorScroll` to scroll the view to the anchor,
* this can be enabled by calling {@link ui.router.state.$uiViewScrollProvider#methods_useAnchorScroll `$uiViewScrollProvider.useAnchorScroll()`}.
*/
this.$get = ['$anchorScroll', '$timeout', function ($anchorScroll, $timeout) {
if (useAnchorScroll) {
return $anchorScroll;
}
return function ($element) {
$timeout(function () {
$element[0].scrollIntoView();
}, 0, false);
};
}];
}
angular.module('ui.router.state').provider('$uiViewScroll', $ViewScrollProvider);
================================================
FILE: client/components/assert/.bower.json
================================================
{
"name": "assert",
"homepage": "https://github.com/angular/assert",
"_release": "6caafd2561",
"_resolution": {
"type": "branch",
"branch": "master",
"commit": "6caafd2561ece8cbfdabbe7357b50ce9192db18c"
},
"_source": "git@github.com:angular/assert.git",
"_target": "*",
"_originalSource": "git@github.com:angular/assert.git",
"_direct": true
}
================================================
FILE: client/components/assert/API.md
================================================
// Asserting APIs:
// - generated by Traceur (based on type annotations)
// - can be also used in tests for instance
assert.type(something, Type);
assert.returnType(returnValue, Type);
assert.argumentTypes(firstArg, Type, secondArg, Type);
// this can be used anywhere in the code
// (useful inside test, when we don't wanna define an interface)
assert(value).is(...)
// Custom type assert:
// - i have a custom type
// - adding an assert methos
assert.define(MyUser, function(value) {
assert(value).is(Type, Type2); // or
assert(value, 'name').is(assert.string);
assert(value, 'contact').is(assert.structure({
email: assert.string,
cell: assert.string
}));
assert(value, 'contacts').is(assert.arrayOf(assert.structure({email: assert.string})));
});
// Define interface (an empty type with assert method)
// - returns an empty class with assert method
var Email = assert.define('IEmail', function(value) {
assert(value).is(String);
if (value.indexOf('@') !== -1) {
assert.fail('has to contain "@"');
}
});
// Predefined types
assert.string
assert.number
assert.boolean
assert.arrayOf(...types)
assert.structure(object)
================================================
FILE: client/components/assert/README.md
================================================
http://angular.github.io/assert/
================================================
FILE: client/components/assert/gulpfile.js
================================================
var gulp = require('gulp');
var pipe = require('pipe/gulp');
var traceur = require('gulp-traceur');
var path = {
src: './src/**/*.js',
};
// TRANSPILE ES6
gulp.task('build_source_amd', function() {
gulp.src(path.src)
.pipe(traceur(pipe.traceur()))
.pipe(gulp.dest('dist/amd'));
});
gulp.task('build_source_cjs', function() {
gulp.src(path.src)
.pipe(traceur(pipe.traceur({modules: 'commonjs'})))
.pipe(gulp.dest('dist/cjs'));
});
gulp.task('build_source_es6', function() {
gulp.src(path.src)
.pipe(traceur(pipe.traceur({outputLanguage: 'es6'})))
.pipe(gulp.dest('dist/es6'));
});
gulp.task('build_dist', ['build_source_cjs', 'build_source_amd', 'build_source_es6']);
gulp.task('build', ['build_dist']);
// WATCH FILES FOR CHANGES
gulp.task('watch', function() {
gulp.watch(path.src, ['build']);
});
================================================
FILE: client/components/assert/karma.conf.js
================================================
var sharedConfig = require('pipe/karma');
module.exports = function(config) {
sharedConfig(config);
config.set({
// list of files / patterns to load in the browser
files: [
'test-main.js',
{pattern: 'src/**/*.js', included: false},
{pattern: 'test/**/*.js', included: false}
],
usePolling: true,
preprocessors: {
'src/**/*.js': ['traceur'],
'test/**/*.js': ['traceur']
}
});
config.sauceLabs.testName = 'assert';
};
================================================
FILE: client/components/assert/npm-shrinkwrap.json
================================================
{
"name": "rtts-assert",
"version": "0.0.0",
"dependencies": {
"gulp-traceur": {
"version": "0.4.0",
"from": "gulp-traceur@0.4.0",
"dependencies": {
"gulp-util": {
"version": "2.2.5",
"from": "gulp-util@2.2.5"
},
"through2": {
"version": "0.4.0",
"from": "through2@0.4.0"
},
"traceur": {
"version": "0.0..0",
"from": "git://github.com/vojtajina/traceur-compiler#add-es6-pure-transformer-dist"
}
}
}
}
}
================================================
FILE: client/components/assert/package.json
================================================
{
"name": "rtts-assert",
"version": "0.0.1",
"description": "A type assertion library for Traceur.",
"main": "./dist/cjs/assert.js",
"homepage": "https://github.com/angular/assert",
"repository": {
"type": "git",
"url": "git://github.com/angular/assert.git"
},
"bugs": {
"url": "https://github.com/angular/assert/issues"
},
"dependencies": {},
"devDependencies": {
"gulp": "^3.5.6",
"gulp-connect": "~1.0.5",
"gulp-traceur": "~0.4.0",
"karma": "^0.12.1",
"karma-chrome-launcher": "^0.1.2",
"karma-jasmine": "^0.2.2",
"karma-requirejs": "^0.2.1",
"karma-traceur-preprocessor": "^0.2.2",
"pipe": "git://github.com/angular/pipe#remove-transitive-deps"
},
"scripts": {
"test": "karma start --single-run"
},
"author": "Vojta Jína ",
"license": "Apache-2.0"
}
================================================
FILE: client/components/assert/src/assert.js
================================================
// TODO(vojta):
// - extract into multiple files
// - different error types
// - simplify/humanize error messages
// - throw when invalid input (such as odd number of args into assert.argumentTypes)
var POSITION_NAME = ['', '1st', '2nd', '3rd'];
function argPositionName(i) {
var position = (i / 2) + 1;
return POSITION_NAME[position] || (position + 'th');
}
var primitives = $traceurRuntime.type;
function assertArgumentTypes(...params) {
var actual, type;
var currentArgErrors;
var errors = [];
var msg;
for (var i = 0, l = params.length; i < l; i = i + 2) {
actual = params[i];
type = params[i + 1];
currentArgErrors = [];
// currentStack = [];
//
if (!isType(actual, type, currentArgErrors)) {
// console.log(JSON.stringify(errors, null, ' '));
// TODO(vojta): print "an instance of" only if T starts with uppercase.
errors.push(argPositionName(i) + ' argument has to be an instance of ' + prettyPrint(type) + ', got ' + prettyPrint(actual));
if (currentArgErrors.length) {
errors.push(currentArgErrors);
}
}
}
if (errors.length) {
throw new Error('Invalid arguments given!\n' + formatErrors(errors));
}
}
function prettyPrint(value) {
if (typeof value === 'undefined') {
return 'undefined';
}
if (typeof value === 'string') {
return '"' + value + '"';
}
if (typeof value === 'boolean') {
return value.toString();
}
if (value === null) {
return 'null';
}
if (typeof value === 'object') {
if (value.map) {
return '[' + value.map(prettyPrint).join(', ') + ']';
}
var properties = Object.keys(value);
return '{' + properties.map((p) => p + ': ' + prettyPrint(value[p])).join(', ') + '}';
}
return value.__assertName || value.name || value.toString();
}
function isType(value, T, errors) {
if (T === primitives.void) {
return typeof value === 'undefined';
}
if (T === primitives.any || value === null) {
return true;
}
if (T === primitives.string) {
return typeof value === 'string';
}
if (T === primitives.number) {
return typeof value === 'number';
}
if (T === primitives.boolean) {
return typeof value === 'boolean';
}
// var parentStack = currentStack;
// currentStack = [];
// shouldnt this create new stack?
if (typeof T.assert === 'function') {
var parentStack = currentStack;
var isValid;
currentStack = errors;
try {
isValid = T.assert(value) ;
} catch (e) {
fail(e.message);
isValid = false;
}
currentStack = parentStack;
if (typeof isValid === 'undefined') {
isValid = errors.length === 0;
}
return isValid;
// if (!currentStack.length) {
// currentStack = parentStack;
// return [];
// }
// var res = currentStack;
// currentStack = parentStack;
// return ['not instance of ' + prettyPrint(T), res];
}
return value instanceof T;
// if (!(value instanceof T)) {
// fail('not instance of ' + prettyPrint(T));
// }
// var res = currentStack;
// currentStack = parentStack;
// return res;
}
function formatErrors(errors, indent = ' ') {
return errors.map((e) => {
if (typeof e === 'string') return indent + '- ' + e;
return formatErrors(e, indent + ' ');
}).join('\n');
}
// assert a type of given value and throw if does not pass
function type(actual, T) {
var errors = [];
// currentStack = [];
if (!isType(actual, T, errors)) {
// console.log(JSON.stringify(errors, null, ' '));
// TODO(vojta): print "an instance of" only if T starts with uppercase.
var msg = 'Expected an instance of ' + prettyPrint(T) + ', got ' + prettyPrint(actual) + '!';
if (errors.length) {
msg += '\n' + formatErrors(errors);
}
throw new Error(msg);
}
}
function returnType(actual, T) {
var errors = [];
// currentStack = [];
if (!isType(actual, T, errors)) {
// console.log(JSON.stringify(errors, null, ' '));
// TODO(vojta): print "an instance of" only if T starts with uppercase.
var msg = 'Expected to return an instance of ' + prettyPrint(T) + ', got ' + prettyPrint(actual) + '!';
if (errors.length) {
msg += '\n' + formatErrors(errors);
}
throw new Error(msg);
}
return actual;
}
// TODO(vojta): define these with DSL?
var string = define('string', function(value) {
return typeof value === 'string';
});
// function string() {}
// string.assert = function(value) {
// return typeof value === 'string';
// };
var boolean = define('boolean', function(value) {
return typeof value === 'boolean';
});
// function boolean() {}
// boolean.assert = function(value) {
// return typeof value === 'boolean';
// };
var number = define('number', function(value) {
return typeof value === 'number';
});
// function number() {}
// number.assert = function(value) {
// return typeof value === 'number';
// };
function arrayOf(...types) {
return assert.define('array of ' + types.map(prettyPrint).join('/'), function(value) {
if (assert(value).is(Array)) {
for (var item of value) {
assert(item).is(...types);
}
}
});
}
function structure(definition) {
var properties = Object.keys(definition);
return assert.define('object with properties ' + properties.join(', '), function(value) {
if (assert(value).is(Object)) {
for (var property of properties) {
assert(value[property]).is(definition[property]);
}
}
})
}
// I'm sorry, bad global state... to make the API nice ;-)
var currentStack = [];
function fail(message) {
currentStack.push(message);
}
function define(classOrName, check) {
var cls = classOrName;
if (typeof classOrName === 'string') {
cls = function() {};
cls.__assertName = classOrName;
}
cls.assert = function(value) {
// var parentStack = currentStack;
// currentStack = [];
return check(value);
// if (currentStack.length) {
// parentStack.push(currentStack)
// }
// currentStack = parentStack;
};
return cls;
}
function assert(value) {
return {
is: function is(...types) {
// var errors = []
var allErrors = [];
var errors;
for (var type of types) {
errors = [];
if (isType(value, type, errors)) {
return true;
}
// if no errors, merge multiple "is not instance of " into x/y/z ?
allErrors.push(prettyPrint(value) + ' is not instance of ' + prettyPrint(type))
if (errors.length) {
allErrors.push(errors);
}
}
// if (types.length > 1) {
// currentStack.push(['has to be ' + types.map(prettyPrint).join(' or '), ...allErrors]);
// } else {
currentStack.push(...allErrors);
// }
return false;
}
};
}
// PUBLIC API
// asserting API
// throw if no type provided
assert.type = type;
// throw if odd number of args
assert.argumentTypes = assertArgumentTypes;
assert.returnType = returnType;
// define AP;
assert.define = define;
assert.fail = fail;
// primitive value type;
assert.string = string;
assert.number = number;
assert.boolean = boolean;
// custom types
assert.arrayOf = arrayOf;
assert.structure = structure;
export {assert}
================================================
FILE: client/components/assert/test/assert.spec.js
================================================
// # Assert.js
// A run-time type assertion library for JavaScript. Designed to be used with [Traceur](https://github.com/google/traceur-compiler).
// - [Basic Type Check](#basic-type-check)
// - [Custom Check](#custom-check)
// - [Primitive Values](#primitive-values)
// - [Describing more complex types](#describing-more-complex-types)
// - [assert.arrayOf](#assert-arrayof)
// - [assert.structure](#assert-structure)
// - [Integrating with Traceur](#integrating-with-traceur)
import {assert} from 'assert';
// ## Basic Type Check
// By default, `instanceof` is used to check the type.
//
// Note that you can use `assert.type()` in unit tests or anywhere in your code.
// Most of the time, you will use it with Traceur.
// Jump to the [Traceur section](#integrating-with-traceur) to see an example of that.
describe('basic type check', function() {
class Type {}
it('should pass', function() {
assert.type(new Type(), Type);
});
it('should fail', function() {
expect(() => assert.type(123, Type))
.toThrowError('Expected an instance of Type, got 123!');
});
it('should allow null', function() {
assert.type(null, Type);
});
});
// ## Custom Check
// Often, `instanceof` is not flexible enough.
// In that case, your type can define its own `assert` method which will be used instead.
//
// See [Describing More Complex Types](#describing-more-complex-types) for examples how to
// define custom checks using `assert.define()`.
describe('custom check', function() {
class Type {}
// the basic check can just return true/false, without specifying any reason
it('should pass when returns true', function() {
Type.assert = function(value) {
return true;
};
assert.type({}, Type);
});
it('should fail when returns false', function() {
Type.assert = function(value) {
return false;
};
expect(() => assert.type({}, Type))
.toThrowError('Expected an instance of Type, got {}!');
});
// Using `assert.fail()` allows to report even multiple errors.
it('should fail when calls assert.fail()', function() {
Type.assert = function(value) {
assert.fail('not smart enough');
assert.fail('not blue enough');
};
expect(() => assert.type({}, Type))
.toThrowError('Expected an instance of Type, got {}!\n' +
' - not smart enough\n' +
' - not blue enough');
});
it('should fail when throws an exception', function() {
Type.assert = function(value) {
throw new Error('not long enough');
};
expect(function() {
assert.type(12345, Type);
}).toThrowError('Expected an instance of Type, got 12345!\n' +
' - not long enough');
});
});
// ## Primitive Values
// You don't want to check primitive values (such as strings, numbers, or booleans) using `typeof` rather than
// `instanceof`.
//
// Again, you probably won't write this code and rather use Traceur to do it for you, simply based on type annotations.
describe('primitive value check', function() {
var primitive = $traceurRuntime.type;
describe('string', function() {
it('should pass', function() {
assert.type('xxx', primitive.string);
});
it('should fail', function() {
expect(() => assert.type(12345, primitive.string))
.toThrowError('Expected an instance of string, got 12345!');
});
it('should allow null', function() {
assert.type(null, primitive.string);
});
});
describe('number', function() {
it('should pass', function() {
assert.type(123, primitive.number);
});
it('should fail', function() {
expect(() => assert.type(false, primitive.number))
.toThrowError('Expected an instance of number, got false!');
});
it('should allow null', function() {
assert.type(null, primitive.number);
});
});
describe('boolean', function() {
it('should pass', function() {
assert.type(true, primitive.boolean);
assert.type(false, primitive.boolean);
});
it('should fail', function() {
expect(() => assert.type(123, primitive.boolean))
.toThrowError('Expected an instance of boolean, got 123!');
});
it('should allow null', function() {
assert.type(null, primitive.boolean);
});
});
});
// ## Describing more complex types
//
// Often, a simple type check using `instanceof` or `typeof` is not enough.
// That's why you can define custom checks using this DSL.
// The goal was to make them easy to compose and as descriptive as possible.
// Of course you can write your own DSL on the top of this.
describe('define', function() {
// If the first argument to `assert.define()` is a type (function), it will define `assert` method on that function.
//
// In this example, being a type of Type means being a either a function or object.
it('should define assert for an existing type', function() {
class Type {}
assert.define(Type, function(value) {
assert(value).is(Function, Object);
});
assert.type({}, Type);
assert.type(function() {}, Type);
expect(() => assert.type('str', Type))
.toThrowError('Expected an instance of Type, got "str"!\n' +
' - "str" is not instance of Function\n' +
' - "str" is not instance of Object');
});
// If the first argument to `assert.define()` is a string,
// it will create an interface - basically an empty class with `assert` method.
it('should define an interface', function() {
var User = assert.define('MyUser', function(user) {
assert(user).is(Object);
});
assert.type({}, User);
expect(() => assert.type(12345, User))
.toThrowError('Expected an instance of MyUser, got 12345!\n' +
' - 12345 is not instance of Object');
});
// Here are a couple of more APIs to describe your custom types...
//
// ### assert.arrayOf
// Checks if the value is an array and if so, it checks whether all the items are one the given types.
// These types can be composed types, not just simple ones.
describe('arrayOf', function() {
var Titles = assert.define('ListOfTitles', function(value) {
assert(value).is(assert.arrayOf(assert.string, assert.number));
});
it('should pass', function () {
assert.type(['one', 55, 'two'], Titles);
});
it('should fail when non-array given', function () {
expect(() => assert.type('foo', Titles))
.toThrowError('Expected an instance of ListOfTitles, got "foo"!\n' +
' - "foo" is not instance of array of string/number\n' +
' - "foo" is not instance of Array');
});
it('should fail when an invalid item in the array', function () {
expect(() => assert.type(['aaa', true], Titles))
.toThrowError('Expected an instance of ListOfTitles, got ["aaa", true]!\n' +
' - ["aaa", true] is not instance of array of string/number\n' +
' - true is not instance of string\n' +
' - true is not instance of number');
});
});
// ### assert.structure
// Similar to `assert.arrayOf` which checks a content of an array,
// `assert.structure` checks if the value is an object with specific properties.
describe('structure', function() {
var User = assert.define('MyUser', function(value) {
assert(value).is(assert.structure({
name: assert.string,
age: assert.number
}));
});
it('should pass', function () {
assert.type({name: 'Vojta', age: 28}, User);
});
it('should fail when non-object given', function () {
expect(() => assert.type(123, User))
.toThrowError('Expected an instance of MyUser, got 123!\n' +
' - 123 is not instance of object with properties name, age\n' +
' - 123 is not instance of Object');
});
it('should fail when an invalid property', function () {
expect(() => assert.type({name: 'Vojta', age: true}, User))
.toThrowError('Expected an instance of MyUser, got {name: "Vojta", age: true}!\n' +
' - {name: "Vojta", age: true} is not instance of object with properties name, age\n' +
' - true is not instance of number');
});
});
});
// ## Integrating with Traceur
//
// Manually calling `assert.type()` in your code is cumbersome. Most of the time, you'll want to
// have Traceur add the calls to `assert.type()` to your code based on type annotations.
//
// This has several advantages:
// - it's shorter and nicer,
// - you can easily ignore it when generating production code.
//
// You'll need to run Traceur with `--types=true --type-assertions=true --type-assertion-module="path/to/assert"`.
describe('Traceur', function() {
describe('arguments', function() {
function reverse(str: string) {
return str ? reverse(str.substring(1)) + str[0] : ''
}
it('should pass', function() {
expect(reverse('angular')).toBe('ralugna');
});
it('should fail', function() {
expect(() => reverse(123))
.toThrowError('Invalid arguments given!\n' +
' - 1st argument has to be an instance of string, got 123');
});
});
describe('return value', function() {
function foo(bar): number {
return bar;
}
it('should pass', function() {
expect(foo(123)).toBe(123);
});
it('should fail', function() {
expect(() => foo('bar'))
.toThrowError('Expected to return an instance of number, got "bar"!');
});
});
describe('variables', function() {
it('should pass', function() {
var count:number = 1;
});
it('should fail', function() {
expect(() => {
var count: number = true;
}).toThrowError('Expected an instance of number, got true!');
});
});
describe('void', function() {
function foo(bar): void {
return bar;
}
it('should pass when not defined', function() {
function nonReturn(): void {}
function returnNothing(): void { return; }
function returnUndefined(): void { return undefined; }
foo();
foo(undefined);
nonReturn();
returnNothing();
returnUndefined();
});
it('should fail when a value returned', function() {
expect(() => foo('bar'))
.toThrowError('Expected to return an instance of voidType, got "bar"!');
});
it('should fail when null returned', function() {
expect(() => foo(null))
.toThrowError('Expected to return an instance of voidType, got null!');
});
});
});
//
// This documentation was generated from [assert.spec.js](https://github.com/vojtajina/assert/blob/master/test/assert.spec.js) using [Docco](http://jashkenas.github.io/docco/).
//
================================================
FILE: client/components/assert/test-main.js
================================================
var allTestFiles = [];
var TEST_REGEXP = /\.spec\.js$/;
var pathToModule = function(path) {
return path.replace(/^\/base\//, '').replace(/\.js$/, '');
};
Object.keys(window.__karma__.files).forEach(function(file) {
if (TEST_REGEXP.test(file)) {
// Normalize paths to RequireJS module names.
allTestFiles.push(pathToModule(file));
}
});
require.config({
// Karma serves files under /base, which is the basePath from your config file
baseUrl: '/base',
paths: {
'assert': 'src/assert'
},
// Dynamically load all test files and ES6 polyfill.
deps: allTestFiles,
// we have to kickoff jasmine, as it is asynchronous
callback: window.__karma__.start
});
================================================
FILE: client/components/es6-module-loader/.bower.json
================================================
{
"name": "es6-module-loader",
"version": "0.10.0",
"description": "An ES6 Module Loader polyfill based on the latest spec.",
"homepage": "https://github.com/ModuleLoader/es6-module-loader",
"main": "dist/es6-module-loader-sans-promises.js",
"dependencies": {
"traceur": "0.0.74"
},
"keywords": [
"es6",
"harmony",
"polyfill",
"modules"
],
"ignore": [
"demo",
"lib",
"test",
"grunt.js",
"package.json"
],
"repository": {
"type": "git",
"url": "https://github.com/ModuleLoader/es6-module-loader.git"
},
"licenses": [
{
"type": "MIT"
}
],
"_release": "0.10.0",
"_resolution": {
"type": "version",
"tag": "v0.10.0",
"commit": "5f8a11f84dacdc4f43efb8409ebc836a33f14a85"
},
"_source": "git://github.com/ModuleLoader/es6-module-loader.git",
"_target": "~0.10.0",
"_originalSource": "es6-module-loader"
}
================================================
FILE: client/components/es6-module-loader/.gitignore
================================================
node_modules
bower_components
tmp
================================================
FILE: client/components/es6-module-loader/.jshintrc
================================================
{
"curly": true,
"eqeqeq": true,
"immed": true,
"latedef": true,
"newcap": true,
"noarg": true,
"sub": true,
"undef": true,
"boss": true,
"eqnull": true
}
================================================
FILE: client/components/es6-module-loader/Gruntfile.js
================================================
'use strict';
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
meta: {
banner: '/*\n * <%= pkg.name %> v<%= pkg.version %>\n' +
'<%= pkg.homepage ? " * " + pkg.homepage + "\\n" : "" %>' +
' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %>\n */'
},
jshint: {
options: {
jshintrc: '.jshintrc'
},
dist: [
'lib/index.js',
'lib/loader.js',
'lib/system.js'
]
},
concat: {
dist: {
files: {
'dist/<%= pkg.name %>.src.js': [
'node_modules/when/es6-shim/Promise.js',
'src/polyfill-wrapper-start.js',
'dist/<%= pkg.name %>.js',
'src/polyfill-wrapper-end.js'
],
'dist/<%= pkg.name %>-sans-promises.src.js': [
'src/polyfill-wrapper-start.js',
'dist/<%= pkg.name %>.js',
'src/polyfill-wrapper-end.js'
]
}
}
},
esnext: {
dist: {
src: [
'src/loader.js',
'src/system.js'
],
dest: 'dist/<%= pkg.name %>.js'
}
},
'string-replace': {
dist: {
files: {
'dist/<%= pkg.name %>.js': 'dist/<%= pkg.name %>.js'
},
options: {
replacements:[{
pattern: 'var $__Object$getPrototypeOf = Object.getPrototypeOf;\n' +
'var $__Object$defineProperty = Object.defineProperty;\n' +
'var $__Object$create = Object.create;',
replacement: ''
}, {
pattern: '$__Object$getPrototypeOf(SystemLoader.prototype).constructor',
replacement: '$__super'
}]
}
}
},
uglify: {
options: {
banner: '<%= meta.banner %>\n',
compress: {
drop_console: true
},
sourceMap: true
},
dist: {
options: {
banner: '<%= meta.banner %>\n'
},
src: 'dist/<%= pkg.name %>.src.js',
dest: 'dist/<%= pkg.name %>.js'
},
polyfillOnly: {
src: 'dist/<%= pkg.name %>-sans-promises.src.js',
dest: 'dist/<%= pkg.name %>-sans-promises.js'
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-esnext');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-string-replace');
grunt.registerTask('lint', ['jshint']);
grunt.registerTask('compile', ['esnext', 'string-replace', 'concat']);
grunt.registerTask('default', [/*'jshint', */'esnext', 'string-replace',
'concat', 'uglify']);
};
================================================
FILE: client/components/es6-module-loader/LICENSE-MIT
================================================
Copyright (c) 2013-2014 Guy Bedford, Luke Hoban, Addy Osmani
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.
================================================
FILE: client/components/es6-module-loader/README.md
================================================
# ES6 Module Loader Polyfill
Dynamically loads ES6 modules in NodeJS and current browsers.
* Implemented exactly to the July 18 2014 ES6 specification draft.
* Provides an asynchronous loader (`System.import`) to [dynamically load ES6 modules](#basic-use).
* Uses [Traceur](https://github.com/google/traceur-compiler) for compiling ES6 modules and syntax into ES5 in the browser with source map support.
* Fully supports [ES6 circular references and bindings](#circular-references--bindings).
* Polyfills ES6 Promises in the browser with an optionally bundled ES6 promise implementation.
* [Compatible with NodeJS](#nodejs-usage) allowing for server-side module loading and tracing extensions.
* Supports ES6 module loading in IE8+. Other ES6 features only supported by Traceur in IE9+.
* The complete combined polyfill, including ES6 promises, comes to 9KB minified and gzipped, making it suitable for production use, provided that modules are [built into ES5 making them independent of Traceur](#moving-to-production).
For an overview of build workflows, [see the production guide](#moving-to-production).
See the [demo folder](https://github.com/ModuleLoader/es6-module-loader/blob/master/demo/index.html) in this repo for a working example demonstrating both module loading the module tag in the browser.
For an example of a universal module loader based on this polyfill for loading AMD, CommonJS and globals, see [SystemJS](https://github.com/systemjs/systemjs).
_The current version is tested against **[Traceur 0.0.72](https://github.com/google/traceur-compiler/tree/0.0.72)**._
_Note the ES6 module specification is still in draft, and subject to change._
### Basic Use
Download both [es6-module-loader.js](https://raw.githubusercontent.com/ModuleLoader/es6-module-loader/v0.9.4/dist/es6-module-loader.js) and traceur.js into the same folder.
If using ES6 syntax (optional), include [`traceur.js`](https://raw.githubusercontent.com/jmcriffey/bower-traceur/0.0.72/traceur.js) in the page first then include `es6-module-loader.js`:
```html
```
Write an ES6 module:
mymodule.js:
```javascript
export class q {
constructor() {
console.log('this is an es6 class!');
}
}
```
We can then load the module with the dynamic loader:
```html
```
The dynamic loader returns a `Module` object, which contains getters for the named exports (in this case, `q`).
[Read the wiki on overview of ES6 modules and syntax](https://github.com/ModuleLoader/es6-module-loader/wiki/A-Brief-ES6-Modules-Overview).
### Custom Compilation Options
Custom [Traceur compilation options](https://github.com/google/traceur-compiler/blob/master/src/Options.js#L25) can be set through `System.traceurOptions`, eg:
```javascript
System.traceurOptions.annotations = true;
```
### Module Tag
A simple analog to the module tag is provided with:
```html
```
Ideally this should be based on polyfilling the `` tag, as `
```
* Note that `app-build.js` must be at the base-level for this to work.
* Also, the name we import, `app/app` must be the same name given to Traceur's compiler.
#### Building into separate files
We can also build separate files with:
```
traceur --dir app app-build --modules=instantiate
```
With the above, we can load from the separate files identical to loading ES6.
### NodeJS Usage
```
npm install es6-module-loader
```
For use in NodeJS, the `Loader` and `System` globals are provided as exports:
index.js:
```javascript
var System = require('es6-module-loader').System;
System.import('some-module').then(function(m) {
console.log(m.p);
});
```
some-module.js:
```javascript
export var p = 'NodeJS test';
```
Running the application:
```
> node index.js
NodeJS test
```
### Tracing API
This is not in the specification, but is provided since it is such a natural extension of loading and not much code at all.
Enable tracing and start importing modules:
```javascript
loader.trace = true;
loader.execute = true; // optional, disables execution of module bodies
loader.import('some/module').then(function() {
/*
Now we have:
loader.loads['some/module'] == {
name: 'some/module',
deps: ['./unnormalized', 'deps'],
depMap: {
'./unnormalized': 'normalized',
'deps': 'deps'
},
address: '/resolvedURL',
metadata: { metadata object from load },
source: 'translated source code string',
kind: 'dynamic' (instantiated) or 'declarative' (ES6 module pipeline)
}
With the dependency load records
loader.loads['normalized']
loader.loads['deps']
also set.
*/
});
```
Then start importing modules
### Extending the Loader
The loader in its default state provides only ES6 loading.
We can extend it to load AMD, CommonJS and global scripts as well as various other custom functionality through the loader hooks.
[Read the wiki on extending the loader here](https://github.com/ModuleLoader/es6-module-loader/wiki/Extending-the-ES6-Loader).
### Specification Notes
See the source of https://github.com/ModuleLoader/es6-module-loader/blob/master/lib/es6-module-loader.js, which contains comments detailing the exact specification notes and design decisions.
To follow the current the specification changes, see the marked issues https://github.com/ModuleLoader/es6-module-loader/issues?labels=specification&page=1&state=open.
## Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [grunt](https://github.com/cowboy/grunt).
_Also, please don't edit files in the "dist" subdirectory as they are generated via grunt. You'll find source code in the "lib" subdirectory!_
## Credit
Copyright (c) 2014 Luke Hoban, Addy Osmani, Guy Bedford
## License
Licensed under the MIT license.
================================================
FILE: client/components/es6-module-loader/bower.json
================================================
{
"name": "es6-module-loader",
"version": "0.10.0",
"description": "An ES6 Module Loader polyfill based on the latest spec.",
"homepage": "https://github.com/ModuleLoader/es6-module-loader",
"main": "dist/es6-module-loader-sans-promises.js",
"dependencies": {
"traceur": "0.0.74"
},
"keywords": [
"es6",
"harmony",
"polyfill",
"modules"
],
"ignore": [
"demo",
"lib",
"test",
"grunt.js",
"package.json"
],
"repository": {
"type": "git",
"url": "https://github.com/ModuleLoader/es6-module-loader.git"
},
"licenses": [
{
"type": "MIT"
}
]
}
================================================
FILE: client/components/es6-module-loader/dist/es6-module-loader-sans-promises.js
================================================
/*
* es6-module-loader v0.9.4
* https://github.com/ModuleLoader/es6-module-loader
* Copyright (c) 2014 Guy Bedford, Luke Hoban, Addy Osmani; Licensed MIT
*/
!function(__global){function __eval(__source,__global,load){var __curRegister=System.register;System.register=function(a,b,c){"string"!=typeof a&&(c=b,b=a),load.declare=c,load.depsList=b};try{eval('(function() { var __moduleName = "'+(load.name||"").replace('"','"')+'"; '+__source+" \n }).call(__global);")}catch(e){throw("SyntaxError"==e.name||"TypeError"==e.name)&&(e.message="Evaluating "+(load.name||load.address)+"\n "+e.message),e}System.register=__curRegister}$__Object$getPrototypeOf=Object.getPrototypeOf||function(a){return a.__proto__};var $__Object$defineProperty;!function(){try{Object.defineProperty({},"a",{})&&($__Object$defineProperty=Object.defineProperty)}catch(a){$__Object$defineProperty=function(a,b,c){try{a[b]=c.value||c.get.call(a)}catch(d){}}}}(),$__Object$create=Object.create||function(a,b){function c(){}if(c.prototype=a,"object"==typeof b)for(prop in b)b.hasOwnProperty(prop)&&(c[prop]=b[prop]);return new c},function(){function a(a){return{status:"loading",name:a,linkSets:[],dependencies:[],metadata:{}}}function b(a,b,c){return new A(g({step:c.address?"fetch":"locate",loader:a,moduleName:b,moduleMetadata:c&&c.metadata||{},moduleSource:c.source,moduleAddress:c.address}))}function c(b,c,e,f){return new A(function(a){a(b.loaderObj.normalize(c,e,f))}).then(function(c){var e;if(b.modules[c])return e=a(c),e.status="linked",e;for(var f=0,g=b.loads.length;g>f;f++)if(e=b.loads[f],e.name==c)return e;return e=a(c),b.loads.push(e),d(b,e),e})}function d(a,b){e(a,b,A.resolve().then(function(){return a.loaderObj.locate({name:b.name,metadata:b.metadata})}))}function e(a,b,c){f(a,b,c.then(function(c){return"loading"==b.status?(b.address=c,a.loaderObj.fetch({name:b.name,metadata:b.metadata,address:c})):void 0}))}function f(a,b,d){d.then(function(c){return"loading"==b.status?a.loaderObj.translate({name:b.name,metadata:b.metadata,address:b.address,source:c}):void 0}).then(function(c){return"loading"==b.status?(b.source=c,a.loaderObj.instantiate({name:b.name,metadata:b.metadata,address:b.address,source:c})):void 0}).then(function(d){if("loading"==b.status){if(void 0===d)b.address=b.address||"",b.isDeclarative=!0,a.loaderObj.parse(b);else{if("object"!=typeof d)throw TypeError("Invalid instantiate return value");b.depsList=d.deps||[],b.execute=d.execute,b.isDeclarative=!1}b.dependencies=[];for(var e=b.depsList,f=[],g=0,h=e.length;h>g;g++)(function(d,e){f.push(c(a,d,b.name,b.address).then(function(a){if(b.dependencies[e]={key:d,value:a.name},"linked"!=a.status)for(var c=b.linkSets.concat([]),f=0,g=c.length;g>f;f++)i(c[f],a)}))})(e[g],g);return A.all(f)}}).then(function(){b.status="loaded";for(var a=b.linkSets.concat([]),c=0,d=a.length;d>c;c++)k(a[c],b)})["catch"](function(a){b.status="failed",b.exception=a;for(var c=b.linkSets.concat([]),d=0,e=c.length;e>d;d++)l(c[d],b,a)})}function g(b){return function(c){var g=b.loader,i=b.moduleName,j=b.step;if(g.modules[i])throw new TypeError('"'+i+'" already exists in the module table');for(var k=0,l=g.loads.length;l>k;k++)if(g.loads[k].name==i)throw new TypeError('"'+i+'" already loading');var m=a(i);m.metadata=b.moduleMetadata;var n=h(g,m);g.loads.push(m),c(n.done),"locate"==j?d(g,m):"fetch"==j?e(g,m,A.resolve(b.moduleAddress)):(m.address=b.moduleAddress,f(g,m,A.resolve(b.moduleSource)))}}function h(a,b){var c={loader:a,loads:[],startingLoad:b,loadingCount:0};return c.done=new A(function(a,b){c.resolve=a,c.reject=b}),i(c,b),c}function i(a,b){for(var c=0,d=a.loads.length;d>c;c++)if(a.loads[c]==b)return;a.loads.push(b),b.linkSets.push(a),"loaded"!=b.status&&a.loadingCount++;for(var e=a.loader,c=0,d=b.dependencies.length;d>c;c++){var f=b.dependencies[c].value;if(!e.modules[f])for(var g=0,h=e.loads.length;h>g;g++)if(e.loads[g].name==f){i(a,e.loads[g]);break}}}function j(a){var b=!1;try{p(a,function(c,d){l(a,c,d),b=!0})}catch(c){l(a,null,c),b=!0}return b}function k(a,b){if(a.loadingCount--,!(a.loadingCount>0)){var c=a.startingLoad;if(a.loader.loaderObj.execute===!1){for(var d=[].concat(a.loads),e=0,f=d.length;f>e;e++){var b=d[e];b.module=b.isDeclarative?{name:b.name,module:E({}),evaluated:!0}:{module:E({})},b.status="linked",m(a.loader,b)}return a.resolve(c)}var g=j(a);g||a.resolve(c)}}function l(a,b,c){var d=a.loader;a.loads[0].name!=b.name&&(c=w(c,'Error loading "'+b.name+'" from "'+a.loads[0].name+'" at '+(a.loads[0].address||"")+"\n")),c=w(c,'Error loading "'+b.name+'" at '+(b.address||"")+"\n");for(var e=a.loads.concat([]),f=0,g=e.length;g>f;f++){var b=e[f];d.loaderObj.failed=d.loaderObj.failed||[],-1==B.call(d.loaderObj.failed,b)&&d.loaderObj.failed.push(b);var h=B.call(b.linkSets,a);if(b.linkSets.splice(h,1),0==b.linkSets.length){var i=B.call(a.loader.loads,b);-1!=i&&a.loader.loads.splice(i,1)}}a.reject(c)}function m(a,b){if(a.loaderObj.trace){a.loaderObj.loads||(a.loaderObj.loads={});var c={};b.dependencies.forEach(function(a){c[a.key]=a.value}),a.loaderObj.loads[b.name]={name:b.name,deps:b.dependencies.map(function(a){return a.key}),depMap:c,address:b.address,metadata:b.metadata,source:b.source,kind:b.isDeclarative?"declarative":"dynamic"}}b.name&&(a.modules[b.name]=b.module);var d=B.call(a.loads,b);-1!=d&&a.loads.splice(d,1);for(var e=0,f=b.linkSets.length;f>e;e++)d=B.call(b.linkSets[e].loads,b),-1!=d&&b.linkSets[e].loads.splice(d,1);b.linkSets.splice(0,b.linkSets.length)}function n(a,b,c,d){if(c[a.groupIndex]=c[a.groupIndex]||[],-1==B.call(c[a.groupIndex],a)){c[a.groupIndex].push(a);for(var e=0,f=b.length;f>e;e++)for(var g=b[e],h=0;h=0;g--){for(var h=d[g],i=0;ic;c++){var g=d.importers[c];if(!g.locked){var h=B.call(g.dependencies,d);g.setters[h](e)}}return d.locked=!1,b});d.setters=f.setters,d.execute=f.execute;for(var g=0,h=a.dependencies.length;h>g;g++){var i=a.dependencies[g].value,j=c.modules[i];if(!j)for(var k=0;kf;f++){var h=e[f];if(h&&-1==B.call(b,h)&&(d=v(h,b,c)))return d=w(d,"Error evaluating "+h.name+"\n")}if(a.failed)return new Error("Module failed execution.");if(!a.evaluated)return a.evaluated=!0,d=t(a),d?a.failed=!0:Object.preventExtensions&&Object.preventExtensions(a.module),a.execute=void 0,d}}function w(a,b){return a instanceof Error?a.message=b+a.message:a=b+a,a}function x(a){if("object"!=typeof a)throw new TypeError("Options must be an object");a.normalize&&(this.normalize=a.normalize),a.locate&&(this.locate=a.locate),a.fetch&&(this.fetch=a.fetch),a.translate&&(this.translate=a.translate),a.instantiate&&(this.instantiate=a.instantiate),this._loader={loaderObj:this,loads:[],modules:{},importPromises:{},moduleRecords:{}},C(this,"global",{get:function(){return __global}})}function y(){}function z(a,b,c){var d=a._loader.importPromises;return d[b]=c.then(function(a){return d[b]=void 0,a},function(a){throw d[b]=void 0,a})}var A=__global.Promise||require("when/es6-shim/Promise");console.assert=console.assert||function(){};var B=Array.prototype.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},C=$__Object$defineProperty,D=0;x.prototype={constructor:x,define:function(a,b,c){if(this._loader.importPromises[a])throw new TypeError("Module is already loading.");return z(this,a,new A(g({step:"translate",loader:this._loader,moduleName:a,moduleMetadata:c&&c.metadata||{},moduleSource:b,moduleAddress:c&&c.address})))},"delete":function(a){return this._loader.modules[a]?delete this._loader.modules[a]:!1},get:function(a){return this._loader.modules[a]?(u(this._loader.modules[a],[],this),this._loader.modules[a].module):void 0},has:function(a){return!!this._loader.modules[a]},"import":function(a,c){var d=this;return A.resolve(d.normalize(a,c&&c.name,c&&c.address)).then(function(a){var e=d._loader;return e.modules[a]?(u(e.modules[a],[],e._loader),e.modules[a].module):e.importPromises[a]||z(d,a,b(e,a,c||{}).then(function(b){return delete e.importPromises[a],s(e,b)}))})},load:function(a){return this._loader.modules[a]?(u(this._loader.modules[a],[],this._loader),A.resolve(this._loader.modules[a].module)):this._loader.importPromises[a]||z(this,a,b(this._loader,a,{}))},module:function(b,c){var d=a();d.address=c&&c.address;var e=h(this._loader,d),g=A.resolve(b),i=this._loader,j=e.done.then(function(){return s(i,d)});return f(i,d,g),j},newModule:function(a){if("object"!=typeof a)throw new TypeError("Expected object");var b=new y;for(var c in a)!function(c){C(b,c,{configurable:!1,enumerable:!0,get:function(){return a[c]}})}(c);return Object.preventExtensions&&Object.preventExtensions(b),b},set:function(a,b){if(!(b instanceof y))throw new TypeError("Loader.set("+a+", module) must be a module");this._loader.modules[a]={module:b}},normalize:function(a){return a},locate:function(a){return a.name},fetch:function(){throw new TypeError("Fetch not implemented")},translate:function(a){return a.source},parse:function(){throw new TypeError("Loader.parse is not implemented")},instantiate:function(){}};var E=x.prototype.newModule;!function(){function a(a,b,c){try{return b.compile(a,c)}catch(d){throw d[0]}}var b;x.prototype.parse=function(c){if(!b)if("undefined"==typeof window&&"undefined"==typeof WorkerGlobalScope)b=require("traceur");else{if(!__global.traceur)throw new TypeError("Include Traceur for module syntax support");b=__global.traceur}c.isDeclarative=!0;var d=this.traceurOptions||{};d.modules="instantiate",d.script=!1,d.sourceMaps=!0,d.filename=c.address;var e=new b.Compiler(d),f=a(c.source,e,d.filename);if(!f)throw new Error("Error evaluating module "+c.address);var g=e.getSourceMap();__global.btoa&&g&&(f+="\n//# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(g)))+"\n"),f='var __moduleAddress = "'+c.address+'";'+f,__eval(f,__global,c)}}(),"object"==typeof exports&&(module.exports=x),__global.Reflect=__global.Reflect||{},__global.Reflect.Loader=__global.Reflect.Loader||x,__global.Reflect.global=__global.Reflect.global||__global,__global.LoaderPolyfill=x}(),function(){function a(a){var b=String(a).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@\/?#]*(?::[^:@\/?#]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return b?{href:b[0]||"",protocol:b[1]||"",authority:b[2]||"",host:b[3]||"",hostname:b[4]||"",port:b[5]||"",pathname:b[6]||"",search:b[7]||"",hash:b[8]||""}:null}function b(a){var b=[];return a.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(a){"/.."===a?b.pop():b.push(a)}),b.join("").replace(/^\//,"/"===a.charAt(0)?"/":"")}function c(c,d){return d=a(d||""),c=a(c||""),d&&c?(d.protocol||c.protocol)+(d.protocol||d.authority?d.authority:c.authority)+b(d.protocol||d.authority||"/"===d.pathname.charAt(0)?d.pathname:d.pathname?(c.authority&&!c.pathname?"/":"")+c.pathname.slice(0,c.pathname.lastIndexOf("/")+1)+d.pathname:c.pathname)+(d.protocol||d.authority||d.pathname?d.search:d.search||c.search)+d.hash:null}function d(){document.removeEventListener("DOMContentLoaded",d,!1),window.removeEventListener("load",d,!1),e()}function e(){for(var a=document.getElementsByTagName("script"),b=0;b2)throw new TypeError("Only one wildcard in a path is permitted");if(1==g.length){if(d==f&&f.length>e.length){e=f;break}}else d.substr(0,g[0].length)==g[0]&&d.substr(d.length-g[1].length)==g[1]&&(e=f,b=d.substr(g[0].length,d.length-g[1].length-g[0].length))}var i=this.paths[e];return b&&(i=i.replace("*",b)),h&&(i=i.replace(/#/g,"%23")),c(this.baseURL,i)},enumerable:!1,writable:!0}),$__Object$defineProperty(b.prototype,"fetch",{value:function(a){var b=this;return new j(function(d,e){f(c(b.baseURL,a.address),function(a){d(a)},e)})},enumerable:!1,writable:!0}),b}(__global.LoaderPolyfill),m=new l;if("object"==typeof exports&&(module.exports=m),__global.System=m,h&&"undefined"!=typeof document.getElementsByTagName){var n=document.getElementsByTagName("script");n=n[n.length-1],"complete"===document.readyState?setTimeout(e):document.addEventListener&&(document.addEventListener("DOMContentLoaded",d,!1),window.addEventListener("load",d,!1)),n.getAttribute("data-init")&&window[n.getAttribute("data-init")]()}}()}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope?self:global);
//# sourceMappingURL=es6-module-loader-sans-promises.js.map
================================================
FILE: client/components/es6-module-loader/dist/es6-module-loader-sans-promises.src.js
================================================
(function(__global) {
$__Object$getPrototypeOf = Object.getPrototypeOf || function(obj) {
return obj.__proto__;
};
var $__Object$defineProperty;
(function () {
try {
if (!!Object.defineProperty({}, 'a', {})) {
$__Object$defineProperty = Object.defineProperty;
}
} catch (e) {
$__Object$defineProperty = function (obj, prop, opt) {
try {
obj[prop] = opt.value || opt.get.call(obj);
}
catch(e) {}
}
}
}());
$__Object$create = Object.create || function(o, props) {
function F() {}
F.prototype = o;
if (typeof(props) === "object") {
for (prop in props) {
if (props.hasOwnProperty((prop))) {
F[prop] = props[prop];
}
}
}
return new F();
};
/*
*********************************************************************************************
Loader Polyfill
- Implemented exactly to the 2014-07-18 Specification Draft.
- Functions are commented with their spec numbers, with spec differences commented.
- Spec bugs are commented in this code with links.
- Abstract functions have been combined where possible, and their associated functions
commented.
- Realm implementation is entirely omitted.
- Loader module table iteration currently not yet implemented.
*********************************************************************************************
*/
// Some Helpers
// logs a linkset snapshot for debugging
/* function snapshot(loader) {
console.log('---Snapshot---');
for (var i = 0; i < loader.loads.length; i++) {
var load = loader.loads[i];
var linkSetLog = ' ' + load.name + ' (' + load.status + '): ';
for (var j = 0; j < load.linkSets.length; j++) {
linkSetLog += '{' + logloads(load.linkSets[j].loads) + '} ';
}
console.log(linkSetLog);
}
console.log('');
}
function logloads(loads) {
var log = '';
for (var k = 0; k < loads.length; k++)
log += loads[k].name + (k != loads.length - 1 ? ' ' : '');
return log;
} */
/* function checkInvariants() {
// see https://bugs.ecmascript.org/show_bug.cgi?id=2603#c1
var loads = System._loader.loads;
var linkSets = [];
for (var i = 0; i < loads.length; i++) {
var load = loads[i];
console.assert(load.status == 'loading' || load.status == 'loaded', 'Each load is loading or loaded');
for (var j = 0; j < load.linkSets.length; j++) {
var linkSet = load.linkSets[j];
for (var k = 0; k < linkSet.loads.length; k++)
console.assert(loads.indexOf(linkSet.loads[k]) != -1, 'linkSet loads are a subset of loader loads');
if (linkSets.indexOf(linkSet) == -1)
linkSets.push(linkSet);
}
}
for (var i = 0; i < loads.length; i++) {
var load = loads[i];
for (var j = 0; j < linkSets.length; j++) {
var linkSet = linkSets[j];
if (linkSet.loads.indexOf(load) != -1)
console.assert(load.linkSets.indexOf(linkSet) != -1, 'linkSet contains load -> load contains linkSet');
if (load.linkSets.indexOf(linkSet) != -1)
console.assert(linkSet.loads.indexOf(load) != -1, 'load contains linkSet -> linkSet contains load');
}
}
for (var i = 0; i < linkSets.length; i++) {
var linkSet = linkSets[i];
for (var j = 0; j < linkSet.loads.length; j++) {
var load = linkSet.loads[j];
for (var k = 0; k < load.dependencies.length; k++) {
var depName = load.dependencies[k].value;
var depLoad;
for (var l = 0; l < loads.length; l++) {
if (loads[l].name != depName)
continue;
depLoad = loads[l];
break;
}
// loading records are allowed not to have their dependencies yet
// if (load.status != 'loading')
// console.assert(depLoad, 'depLoad found');
// console.assert(linkSet.loads.indexOf(depLoad) != -1, 'linkset contains all dependencies');
}
}
}
} */
(function() {
var Promise = __global.Promise || require('when/es6-shim/Promise');
console.assert = console.assert || function() {};
// IE8 support
var indexOf = Array.prototype.indexOf || function(item) {
for (var i = 0, thisLen = this.length; i < thisLen; i++) {
if (this[i] === item) {
return i;
}
}
return -1;
};
var defineProperty = $__Object$defineProperty;
// 15.2.3 - Runtime Semantics: Loader State
// 15.2.3.11
function createLoaderLoad(object) {
return {
// modules is an object for ES5 implementation
modules: {},
loads: [],
loaderObj: object
};
}
// 15.2.3.2 Load Records and LoadRequest Objects
// 15.2.3.2.1
function createLoad(name) {
return {
status: 'loading',
name: name,
linkSets: [],
dependencies: [],
metadata: {}
};
}
// 15.2.3.2.2 createLoadRequestObject, absorbed into calling functions
// 15.2.4
// 15.2.4.1
function loadModule(loader, name, options) {
return new Promise(asyncStartLoadPartwayThrough({
step: options.address ? 'fetch' : 'locate',
loader: loader,
moduleName: name,
// allow metadata for import https://bugs.ecmascript.org/show_bug.cgi?id=3091
moduleMetadata: options && options.metadata || {},
moduleSource: options.source,
moduleAddress: options.address
}));
}
// 15.2.4.2
function requestLoad(loader, request, refererName, refererAddress) {
// 15.2.4.2.1 CallNormalize
return new Promise(function(resolve, reject) {
resolve(loader.loaderObj.normalize(request, refererName, refererAddress));
})
// 15.2.4.2.2 GetOrCreateLoad
.then(function(name) {
var load;
if (loader.modules[name]) {
load = createLoad(name);
load.status = 'linked';
// https://bugs.ecmascript.org/show_bug.cgi?id=2795
// load.module = loader.modules[name];
return load;
}
for (var i = 0, l = loader.loads.length; i < l; i++) {
load = loader.loads[i];
if (load.name != name)
continue;
console.assert(load.status == 'loading' || load.status == 'loaded', 'loading or loaded');
return load;
}
load = createLoad(name);
loader.loads.push(load);
proceedToLocate(loader, load);
return load;
});
}
// 15.2.4.3
function proceedToLocate(loader, load) {
proceedToFetch(loader, load,
Promise.resolve()
// 15.2.4.3.1 CallLocate
.then(function() {
return loader.loaderObj.locate({ name: load.name, metadata: load.metadata });
})
);
}
// 15.2.4.4
function proceedToFetch(loader, load, p) {
proceedToTranslate(loader, load,
p
// 15.2.4.4.1 CallFetch
.then(function(address) {
// adjusted, see https://bugs.ecmascript.org/show_bug.cgi?id=2602
if (load.status != 'loading')
return;
load.address = address;
return loader.loaderObj.fetch({ name: load.name, metadata: load.metadata, address: address });
})
);
}
var anonCnt = 0;
// 15.2.4.5
function proceedToTranslate(loader, load, p) {
p
// 15.2.4.5.1 CallTranslate
.then(function(source) {
if (load.status != 'loading')
return;
return loader.loaderObj.translate({ name: load.name, metadata: load.metadata, address: load.address, source: source });
})
// 15.2.4.5.2 CallInstantiate
.then(function(source) {
if (load.status != 'loading')
return;
load.source = source;
return loader.loaderObj.instantiate({ name: load.name, metadata: load.metadata, address: load.address, source: source });
})
// 15.2.4.5.3 InstantiateSucceeded
.then(function(instantiateResult) {
if (load.status != 'loading')
return;
if (instantiateResult === undefined) {
load.address = load.address || '';
// NB instead of load.kind, use load.isDeclarative
load.isDeclarative = true;
// parse sets load.declare, load.depsList
loader.loaderObj.parse(load);
}
else if (typeof instantiateResult == 'object') {
load.depsList = instantiateResult.deps || [];
load.execute = instantiateResult.execute;
load.isDeclarative = false;
}
else
throw TypeError('Invalid instantiate return value');
// 15.2.4.6 ProcessLoadDependencies
load.dependencies = [];
var depsList = load.depsList;
var loadPromises = [];
for (var i = 0, l = depsList.length; i < l; i++) (function(request, index) {
loadPromises.push(
requestLoad(loader, request, load.name, load.address)
// 15.2.4.6.1 AddDependencyLoad (load is parentLoad)
.then(function(depLoad) {
console.assert(!load.dependencies.some(function(dep) {
return dep.key == request;
}), 'not already a dependency');
// adjusted from spec to maintain dependency order
// this is due to the System.register internal implementation needs
load.dependencies[index] = {
key: request,
value: depLoad.name
};
if (depLoad.status != 'linked') {
var linkSets = load.linkSets.concat([]);
for (var i = 0, l = linkSets.length; i < l; i++)
addLoadToLinkSet(linkSets[i], depLoad);
}
// console.log('AddDependencyLoad ' + depLoad.name + ' for ' + load.name);
// snapshot(loader);
})
);
})(depsList[i], i);
return Promise.all(loadPromises);
})
// 15.2.4.6.2 LoadSucceeded
.then(function() {
// console.log('LoadSucceeded ' + load.name);
// snapshot(loader);
console.assert(load.status == 'loading', 'is loading');
load.status = 'loaded';
var linkSets = load.linkSets.concat([]);
for (var i = 0, l = linkSets.length; i < l; i++)
updateLinkSetOnLoad(linkSets[i], load);
})
// 15.2.4.5.4 LoadFailed
['catch'](function(exc) {
console.assert(load.status == 'loading', 'is loading on fail');
load.status = 'failed';
load.exception = exc;
var linkSets = load.linkSets.concat([]);
for (var i = 0, l = linkSets.length; i < l; i++) {
linkSetFailed(linkSets[i], load, exc);
}
console.assert(load.linkSets.length == 0, 'linkSets not removed');
});
}
// 15.2.4.7 PromiseOfStartLoadPartwayThrough absorbed into calling functions
// 15.2.4.7.1
function asyncStartLoadPartwayThrough(stepState) {
return function(resolve, reject) {
var loader = stepState.loader;
var name = stepState.moduleName;
var step = stepState.step;
if (loader.modules[name])
throw new TypeError('"' + name + '" already exists in the module table');
// NB this still seems wrong for LoadModule as we may load a dependency
// of another module directly before it has finished loading.
// see https://bugs.ecmascript.org/show_bug.cgi?id=2994
for (var i = 0, l = loader.loads.length; i < l; i++)
if (loader.loads[i].name == name)
throw new TypeError('"' + name + '" already loading');
var load = createLoad(name);
load.metadata = stepState.moduleMetadata;
var linkSet = createLinkSet(loader, load);
loader.loads.push(load);
resolve(linkSet.done);
if (step == 'locate')
proceedToLocate(loader, load);
else if (step == 'fetch')
proceedToFetch(loader, load, Promise.resolve(stepState.moduleAddress));
else {
console.assert(step == 'translate', 'translate step');
load.address = stepState.moduleAddress;
proceedToTranslate(loader, load, Promise.resolve(stepState.moduleSource));
}
}
}
// Declarative linking functions run through alternative implementation:
// 15.2.5.1.1 CreateModuleLinkageRecord not implemented
// 15.2.5.1.2 LookupExport not implemented
// 15.2.5.1.3 LookupModuleDependency not implemented
// 15.2.5.2.1
function createLinkSet(loader, startingLoad) {
var linkSet = {
loader: loader,
loads: [],
startingLoad: startingLoad, // added see spec bug https://bugs.ecmascript.org/show_bug.cgi?id=2995
loadingCount: 0
};
linkSet.done = new Promise(function(resolve, reject) {
linkSet.resolve = resolve;
linkSet.reject = reject;
});
addLoadToLinkSet(linkSet, startingLoad);
return linkSet;
}
// 15.2.5.2.2
function addLoadToLinkSet(linkSet, load) {
console.assert(load.status == 'loading' || load.status == 'loaded', 'loading or loaded on link set');
for (var i = 0, l = linkSet.loads.length; i < l; i++)
if (linkSet.loads[i] == load)
return;
linkSet.loads.push(load);
load.linkSets.push(linkSet);
// adjustment, see https://bugs.ecmascript.org/show_bug.cgi?id=2603
if (load.status != 'loaded') {
linkSet.loadingCount++;
}
var loader = linkSet.loader;
for (var i = 0, l = load.dependencies.length; i < l; i++) {
var name = load.dependencies[i].value;
if (loader.modules[name])
continue;
for (var j = 0, d = loader.loads.length; j < d; j++) {
if (loader.loads[j].name != name)
continue;
addLoadToLinkSet(linkSet, loader.loads[j]);
break;
}
}
// console.log('add to linkset ' + load.name);
// snapshot(linkSet.loader);
}
// linking errors can be generic or load-specific
// this is necessary for debugging info
function doLink(linkSet) {
var error = false;
try {
link(linkSet, function(load, exc) {
linkSetFailed(linkSet, load, exc);
error = true;
});
}
catch(e) {
linkSetFailed(linkSet, null, e);
error = true;
}
return error;
}
// 15.2.5.2.3
function updateLinkSetOnLoad(linkSet, load) {
// console.log('update linkset on load ' + load.name);
// snapshot(linkSet.loader);
console.assert(load.status == 'loaded' || load.status == 'linked', 'loaded or linked');
linkSet.loadingCount--;
if (linkSet.loadingCount > 0)
return;
// adjusted for spec bug https://bugs.ecmascript.org/show_bug.cgi?id=2995
var startingLoad = linkSet.startingLoad;
// non-executing link variation for loader tracing
// on the server. Not in spec.
/***/
if (linkSet.loader.loaderObj.execute === false) {
var loads = [].concat(linkSet.loads);
for (var i = 0, l = loads.length; i < l; i++) {
var load = loads[i];
load.module = !load.isDeclarative ? {
module: _newModule({})
} : {
name: load.name,
module: _newModule({}),
evaluated: true
};
load.status = 'linked';
finishLoad(linkSet.loader, load);
}
return linkSet.resolve(startingLoad);
}
/***/
var abrupt = doLink(linkSet);
if (abrupt)
return;
console.assert(linkSet.loads.length == 0, 'loads cleared');
linkSet.resolve(startingLoad);
}
// 15.2.5.2.4
function linkSetFailed(linkSet, load, exc) {
var loader = linkSet.loader;
if (linkSet.loads[0].name != load.name)
exc = addToError(exc, 'Error loading "' + load.name + '" from "' + linkSet.loads[0].name + '" at ' + (linkSet.loads[0].address || '') + '\n');
exc = addToError(exc, 'Error loading "' + load.name + '" at ' + (load.address || '') + '\n');
var loads = linkSet.loads.concat([]);
for (var i = 0, l = loads.length; i < l; i++) {
var load = loads[i];
// store all failed load records
loader.loaderObj.failed = loader.loaderObj.failed || [];
if (indexOf.call(loader.loaderObj.failed, load) == -1)
loader.loaderObj.failed.push(load);
var linkIndex = indexOf.call(load.linkSets, linkSet);
console.assert(linkIndex != -1, 'link not present');
load.linkSets.splice(linkIndex, 1);
if (load.linkSets.length == 0) {
var globalLoadsIndex = indexOf.call(linkSet.loader.loads, load);
if (globalLoadsIndex != -1)
linkSet.loader.loads.splice(globalLoadsIndex, 1);
}
}
linkSet.reject(exc);
}
// 15.2.5.2.5
function finishLoad(loader, load) {
// add to global trace if tracing
if (loader.loaderObj.trace) {
if (!loader.loaderObj.loads)
loader.loaderObj.loads = {};
var depMap = {};
load.dependencies.forEach(function(dep) {
depMap[dep.key] = dep.value;
});
loader.loaderObj.loads[load.name] = {
name: load.name,
deps: load.dependencies.map(function(dep){ return dep.key }),
depMap: depMap,
address: load.address,
metadata: load.metadata,
source: load.source,
kind: load.isDeclarative ? 'declarative' : 'dynamic'
};
}
// if not anonymous, add to the module table
if (load.name) {
console.assert(!loader.modules[load.name], 'load not in module table');
loader.modules[load.name] = load.module;
}
var loadIndex = indexOf.call(loader.loads, load);
if (loadIndex != -1)
loader.loads.splice(loadIndex, 1);
for (var i = 0, l = load.linkSets.length; i < l; i++) {
loadIndex = indexOf.call(load.linkSets[i].loads, load);
if (loadIndex != -1)
load.linkSets[i].loads.splice(loadIndex, 1);
}
load.linkSets.splice(0, load.linkSets.length);
}
// 15.2.5.3 Module Linking Groups
// 15.2.5.3.2 BuildLinkageGroups alternative implementation
// Adjustments (also see https://bugs.ecmascript.org/show_bug.cgi?id=2755)
// 1. groups is an already-interleaved array of group kinds
// 2. load.groupIndex is set when this function runs
// 3. load.groupIndex is the interleaved index ie 0 declarative, 1 dynamic, 2 declarative, ... (or starting with dynamic)
function buildLinkageGroups(load, loads, groups, loader) {
groups[load.groupIndex] = groups[load.groupIndex] || [];
// if the load already has a group index and its in its group, its already been done
// this logic naturally handles cycles
if (indexOf.call(groups[load.groupIndex], load) != -1)
return;
// now add it to the group to indicate its been seen
groups[load.groupIndex].push(load);
for (var i = 0, l = loads.length; i < l; i++) {
var loadDep = loads[i];
// dependencies not found are already linked
for (var j = 0; j < load.dependencies.length; j++) {
if (loadDep.name == load.dependencies[j].value) {
// by definition all loads in linkset are loaded, not linked
console.assert(loadDep.status == 'loaded', 'Load in linkSet not loaded!');
// if it is a group transition, the index of the dependency has gone up
// otherwise it is the same as the parent
var loadDepGroupIndex = load.groupIndex + (loadDep.isDeclarative != load.isDeclarative);
// the group index of an entry is always the maximum
if (loadDep.groupIndex === undefined || loadDep.groupIndex < loadDepGroupIndex) {
// if already in a group, remove from the old group
if (loadDep.groupIndex) {
groups[loadDep.groupIndex].splice(indexOf.call(groups[loadDep.groupIndex], loadDep), 1);
// if the old group is empty, then we have a mixed depndency cycle
if (groups[loadDep.groupIndex].length == 0)
throw new TypeError("Mixed dependency cycle detected");
}
loadDep.groupIndex = loadDepGroupIndex;
}
buildLinkageGroups(loadDep, loads, groups, loader);
}
}
}
}
function doDynamicExecute(linkSet, load, linkError) {
try {
var module = load.execute();
}
catch(e) {
linkError(load, e);
return;
}
if (!module || !(module instanceof Module))
linkError(load, new TypeError('Execution must define a Module instance'));
else
return module;
}
// 15.2.5.4
function link(linkSet, linkError) {
var loader = linkSet.loader;
if (!linkSet.loads.length)
return;
// console.log('linking {' + logloads(linkSet.loads) + '}');
// snapshot(loader);
// 15.2.5.3.1 LinkageGroups alternative implementation
// build all the groups
// because the first load represents the top of the tree
// for a given linkset, we can work down from there
var groups = [];
var startingLoad = linkSet.loads[0];
startingLoad.groupIndex = 0;
buildLinkageGroups(startingLoad, linkSet.loads, groups, loader);
// determine the kind of the bottom group
var curGroupDeclarative = startingLoad.isDeclarative == groups.length % 2;
// run through the groups from bottom to top
for (var i = groups.length - 1; i >= 0; i--) {
var group = groups[i];
for (var j = 0; j < group.length; j++) {
var load = group[j];
// 15.2.5.5 LinkDeclarativeModules adjusted
if (curGroupDeclarative) {
linkDeclarativeModule(load, linkSet.loads, loader);
}
// 15.2.5.6 LinkDynamicModules adjusted
else {
var module = doDynamicExecute(linkSet, load, linkError);
if (!module)
return;
load.module = {
name: load.name,
module: module
};
load.status = 'linked';
}
finishLoad(loader, load);
}
// alternative current kind for next loop
curGroupDeclarative = !curGroupDeclarative;
}
}
// custom module records for binding graph
// store linking module records in a separate table
function getOrCreateModuleRecord(name, loader) {
var moduleRecords = loader.moduleRecords;
return moduleRecords[name] || (moduleRecords[name] = {
name: name,
dependencies: [],
module: new Module(), // start from an empty module and extend
importers: []
});
}
// custom declarative linking function
function linkDeclarativeModule(load, loads, loader) {
if (load.module)
return;
var module = load.module = getOrCreateModuleRecord(load.name, loader);
var moduleObj = load.module.module;
var registryEntry = load.declare.call(__global, function(name, value) {
// NB This should be an Object.defineProperty, but that is very slow.
// By disaling this module write-protection we gain performance.
// It could be useful to allow an option to enable or disable this.
module.locked = true;
moduleObj[name] = value;
for (var i = 0, l = module.importers.length; i < l; i++) {
var importerModule = module.importers[i];
if (!importerModule.locked) {
var importerIndex = indexOf.call(importerModule.dependencies, module);
importerModule.setters[importerIndex](moduleObj);
}
}
module.locked = false;
return value;
});
// setup our setters and execution function
module.setters = registryEntry.setters;
module.execute = registryEntry.execute;
// now link all the module dependencies
// amending the depMap as we go
for (var i = 0, l = load.dependencies.length; i < l; i++) {
var depName = load.dependencies[i].value;
var depModule = loader.modules[depName];
// if dependency not already in the module registry
// then try and link it now
if (!depModule) {
// get the dependency load record
for (var j = 0; j < loads.length; j++) {
if (loads[j].name != depName)
continue;
// only link if already not already started linking (stops at circular / dynamic)
if (!loads[j].module) {
linkDeclarativeModule(loads[j], loads, loader);
depModule = loads[j].module;
}
// if circular, create the module record
else {
depModule = getOrCreateModuleRecord(depName, loader);
}
}
}
// only declarative modules have dynamic bindings
if (depModule.importers) {
module.dependencies.push(depModule);
depModule.importers.push(module);
}
else {
// track dynamic records as null module records as already linked
module.dependencies.push(null);
}
// run the setter for this dependency
if (module.setters[i])
module.setters[i](depModule.module);
}
load.status = 'linked';
}
// 15.2.5.5.1 LinkImports not implemented
// 15.2.5.7 ResolveExportEntries not implemented
// 15.2.5.8 ResolveExports not implemented
// 15.2.5.9 ResolveExport not implemented
// 15.2.5.10 ResolveImportEntries not implemented
// 15.2.6.1
function evaluateLoadedModule(loader, load) {
console.assert(load.status == 'linked', 'is linked ' + load.name);
doEnsureEvaluated(load.module, [], loader);
return load.module.module;
}
/*
* Module Object non-exotic for ES5:
*
* module.module bound module object
* module.execute execution function for module
* module.dependencies list of module objects for dependencies
* See getOrCreateModuleRecord for all properties
*
*/
function doExecute(module) {
try {
module.execute.call(__global);
}
catch(e) {
return e;
}
}
// propogate execution errors
// see https://bugs.ecmascript.org/show_bug.cgi?id=2993
function doEnsureEvaluated(module, seen, loader) {
var err = ensureEvaluated(module, seen, loader);
if (err)
throw err;
}
// 15.2.6.2 EnsureEvaluated adjusted
function ensureEvaluated(module, seen, loader) {
if (module.evaluated || !module.dependencies)
return;
seen.push(module);
var deps = module.dependencies;
var err;
for (var i = 0, l = deps.length; i < l; i++) {
var dep = deps[i];
// dynamic dependencies are empty in module.dependencies
// as they are already linked
if (!dep)
continue;
if (indexOf.call(seen, dep) == -1) {
err = ensureEvaluated(dep, seen, loader);
// stop on error, see https://bugs.ecmascript.org/show_bug.cgi?id=2996
if (err) {
err = addToError(err, 'Error evaluating ' + dep.name + '\n');
return err;
}
}
}
if (module.failed)
return new Error('Module failed execution.');
if (module.evaluated)
return;
module.evaluated = true;
err = doExecute(module);
if (err) {
module.failed = true;
}
else if (Object.preventExtensions) {
// spec variation
// we don't create a new module here because it was created and ammended
// we just disable further extensions instead
Object.preventExtensions(module.module);
}
module.execute = undefined;
return err;
}
function addToError(err, msg) {
if (err instanceof Error)
err.message = msg + err.message;
else
err = msg + err;
return err;
}
// 26.3 Loader
// 26.3.1.1
function Loader(options) {
if (typeof options != 'object')
throw new TypeError('Options must be an object');
if (options.normalize)
this.normalize = options.normalize;
if (options.locate)
this.locate = options.locate;
if (options.fetch)
this.fetch = options.fetch;
if (options.translate)
this.translate = options.translate;
if (options.instantiate)
this.instantiate = options.instantiate;
this._loader = {
loaderObj: this,
loads: [],
modules: {},
importPromises: {},
moduleRecords: {}
};
// 26.3.3.6
defineProperty(this, 'global', {
get: function() {
return __global;
}
});
// 26.3.3.13 realm not implemented
}
function Module() {}
// importPromises adds ability to import a module twice without error - https://bugs.ecmascript.org/show_bug.cgi?id=2601
function createImportPromise(loader, name, promise) {
var importPromises = loader._loader.importPromises;
return importPromises[name] = promise.then(function(m) {
importPromises[name] = undefined;
return m;
}, function(e) {
importPromises[name] = undefined;
throw e;
});
}
Loader.prototype = {
// 26.3.3.1
constructor: Loader,
// 26.3.3.2
define: function(name, source, options) {
// check if already defined
if (this._loader.importPromises[name])
throw new TypeError('Module is already loading.');
return createImportPromise(this, name, new Promise(asyncStartLoadPartwayThrough({
step: 'translate',
loader: this._loader,
moduleName: name,
moduleMetadata: options && options.metadata || {},
moduleSource: source,
moduleAddress: options && options.address
})));
},
// 26.3.3.3
'delete': function(name) {
return this._loader.modules[name] ? delete this._loader.modules[name] : false;
},
// 26.3.3.4 entries not implemented
// 26.3.3.5
get: function(key) {
if (!this._loader.modules[key])
return;
doEnsureEvaluated(this._loader.modules[key], [], this);
return this._loader.modules[key].module;
},
// 26.3.3.7
has: function(name) {
return !!this._loader.modules[name];
},
// 26.3.3.8
'import': function(name, options) {
// run normalize first
var loaderObj = this;
// added, see https://bugs.ecmascript.org/show_bug.cgi?id=2659
return Promise.resolve(loaderObj.normalize(name, options && options.name, options && options.address))
.then(function(name) {
var loader = loaderObj._loader;
if (loader.modules[name]) {
doEnsureEvaluated(loader.modules[name], [], loader._loader);
return loader.modules[name].module;
}
return loader.importPromises[name] || createImportPromise(loaderObj, name,
loadModule(loader, name, options || {})
.then(function(load) {
delete loader.importPromises[name];
return evaluateLoadedModule(loader, load);
}));
});
},
// 26.3.3.9 keys not implemented
// 26.3.3.10
load: function(name, options) {
if (this._loader.modules[name]) {
doEnsureEvaluated(this._loader.modules[name], [], this._loader);
return Promise.resolve(this._loader.modules[name].module);
}
return this._loader.importPromises[name] || createImportPromise(this, name, loadModule(this._loader, name, {}));
},
// 26.3.3.11
module: function(source, options) {
var load = createLoad();
load.address = options && options.address;
var linkSet = createLinkSet(this._loader, load);
var sourcePromise = Promise.resolve(source);
var loader = this._loader;
var p = linkSet.done.then(function() {
return evaluateLoadedModule(loader, load);
});
proceedToTranslate(loader, load, sourcePromise);
return p;
},
// 26.3.3.12
newModule: function (obj) {
if (typeof obj != 'object')
throw new TypeError('Expected object');
// we do this to be able to tell if a module is a module privately in ES5
// by doing m instanceof Module
var m = new Module();
for (var key in obj) {
(function (key) {
defineProperty(m, key, {
configurable: false,
enumerable: true,
get: function () {
return obj[key];
}
});
})(key);
}
if (Object.preventExtensions)
Object.preventExtensions(m);
return m;
},
// 26.3.3.14
set: function(name, module) {
if (!(module instanceof Module))
throw new TypeError('Loader.set(' + name + ', module) must be a module');
this._loader.modules[name] = {
module: module
};
},
// 26.3.3.15 values not implemented
// 26.3.3.16 @@iterator not implemented
// 26.3.3.17 @@toStringTag not implemented
// 26.3.3.18.1
normalize: function(name, referrerName, referrerAddress) {
return name;
},
// 26.3.3.18.2
locate: function(load) {
return load.name;
},
// 26.3.3.18.3
fetch: function(load) {
throw new TypeError('Fetch not implemented');
},
// 26.3.3.18.4
translate: function(load) {
return load.source;
},
parse: function(load) {
throw new TypeError('Loader.parse is not implemented');
},
// 26.3.3.18.5
instantiate: function(load) {
}
};
var _newModule = Loader.prototype.newModule;
/*
* Traceur-specific Parsing Code for Loader
*/
(function() {
// parse function is used to parse a load record
// Returns an array of ModuleSpecifiers
var traceur;
function doCompile(source, compiler, filename) {
try {
return compiler.compile(source, filename);
}
catch(e) {
// traceur throws an error array
throw e[0];
}
}
Loader.prototype.parse = function(load) {
if (!traceur) {
if (typeof window == 'undefined' &&
typeof WorkerGlobalScope == 'undefined')
traceur = require('traceur');
else if (__global.traceur)
traceur = __global.traceur;
else
throw new TypeError('Include Traceur for module syntax support');
}
console.assert(load.source, 'Non-empty source');
var depsList;
load.isDeclarative = true;
var options = this.traceurOptions || {};
options.modules = 'instantiate';
options.script = false;
options.sourceMaps = true;
options.filename = load.address;
var compiler = new traceur.Compiler(options);
var source = doCompile(load.source, compiler, options.filename);
if (!source)
throw new Error('Error evaluating module ' + load.address);
var sourceMap = compiler.getSourceMap();
if (__global.btoa && sourceMap)
source += '\n//# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(sourceMap))) + '\n';
source = 'var __moduleAddress = "' + load.address + '";' + source;
__eval(source, __global, load);
}
})();
if (typeof exports === 'object')
module.exports = Loader;
__global.Reflect = __global.Reflect || {};
__global.Reflect.Loader = __global.Reflect.Loader || Loader;
__global.Reflect.global = __global.Reflect.global || __global;
__global.LoaderPolyfill = Loader;
})();
/*
*********************************************************************************************
System Loader Implementation
- Implemented to https://github.com/jorendorff/js-loaders/blob/master/browser-loader.js
-
================================================
FILE: client/components/plugin-text/.bower.json
================================================
{
"name": "plugin-text",
"homepage": "https://github.com/systemjs/plugin-text",
"version": "0.0.2",
"_release": "0.0.2",
"_resolution": {
"type": "version",
"tag": "0.0.2",
"commit": "3f05122b725d091a193b679946efbac23effebf4"
},
"_source": "git@github.com:systemjs/plugin-text.git",
"_target": "*",
"_originalSource": "git@github.com:systemjs/plugin-text.git"
}
================================================
FILE: client/components/plugin-text/LICENSE
================================================
The MIT License (MIT)
Copyright (c) 2013 jspm
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.
================================================
FILE: client/components/plugin-text/README.md
================================================
plugin-text
===========
Text plugin
================================================
FILE: client/components/plugin-text/package.json
================================================
{
"main": "text"
}
================================================
FILE: client/components/plugin-text/test.html
================================================
================================================
FILE: client/components/plugin-text/text.js
================================================
/*
Text plugin
*/
exports.translate = function(load) {
return 'module.exports = "' + load.source
.replace(/(["\\])/g, '\\$1')
.replace(/[\f]/g, "\\f")
.replace(/[\b]/g, "\\b")
.replace(/[\n]/g, "\\n")
.replace(/[\t]/g, "\\t")
.replace(/[\r]/g, "\\r")
.replace(/[\u2028]/g, "\\u2028")
.replace(/[\u2029]/g, "\\u2029")
+ '";';
}
================================================
FILE: client/components/plugin-text/text.txt
================================================
This is
Some text
"yay"
================================================
FILE: client/components/system.js/.bower.json
================================================
{
"name": "system.js",
"version": "0.10.2",
"main": "dist/system.js",
"dependencies": {
"es6-module-loader": "~0.10.0"
},
"devDependencies": {
"qunit": "~1.12.0"
},
"ignore": [
"test",
"Makefile",
"package.json"
],
"homepage": "https://github.com/systemjs/systemjs",
"_release": "0.10.2",
"_resolution": {
"type": "version",
"tag": "0.10.2",
"commit": "ba271aa257bb0f8270197720c0dba15b0012ea42"
},
"_source": "git://github.com/systemjs/systemjs.git",
"_target": "~0.10.2",
"_originalSource": "system.js"
}
================================================
FILE: client/components/system.js/.gitignore
================================================
node_modules
bower_components
================================================
FILE: client/components/system.js/LICENSE
================================================
MIT License
-----------
Copyright (C) 2013 Guy Bedford
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.
================================================
FILE: client/components/system.js/README.md
================================================
SystemJS
========
Spec-compliant universal module loader - loads ES6 modules, AMD, CommonJS and global scripts.
Designed as a collection of small extensions to the ES6 specification System loader, which can also be applied individually.
* Loads any module format, by detecting the format automatically. Modules can also [specify their format with meta config](#meta-configuration).
* Provides comprehensive and exact replications of AMD, CommonJS and ES6 circular reference handling.
* Loads [ES6 modules compiled into the `System.register` form for production](#es6-systemregister-compilation), maintaining full circular references support.
* Supports RequireJS-style [map](#map-configuration), [paths](https://github.com/ModuleLoader/es6-module-loader#paths-implementation), [bundles](#bundles), [shim](#global-module-format-support) and [plugins](#plugins).
* Tracks package versions, and resolves semver-compatibile requests through [package version syntax](#versions) - `package@x.y.z`, `package^@x.y.z`.
* [Loader plugins](#plugins) allow loading assets through the module naming system such as CSS, JSON or images.
Designed to work with the [ES6 Module Loader polyfill](https://github.com/ModuleLoader/es6-module-loader) (9KB) for a combined total footprint of 16KB minified and gzipped. In future, with native implementations, the ES6 Module Loader polyfill should no longer be necessary. As jQuery provides for the DOM, this library can smooth over inconsistiencies and missing practical functionality provided by the native System loader.
Runs in IE8+ and NodeJS.
For discussion, [see the Google Group](https://groups.google.com/group/systemjs).
Basic Configuration
---
### Setup
Download [`es6-module-loader.js`](https://github.com/ModuleLoader/es6-module-loader/blob/v0.9.4/dist/es6-module-loader.js) and [`traceur.js`](https://raw.githubusercontent.com/jmcriffey/bower-traceur/0.0.72/traceur.js) and locate them in the same folder as `system.js` from this repo.
We then include `dist/system.js` with a script tag in the page.
`es6-module-loader.js` will then be included from the same folder automatically and [Traceur](https://github.com/google/traceur-compiler) is dynamically included from `traceur.js` when loading an ES6 module only.
Alternatively, `es6-module-loader.js` or `traceur.js` can be included before `system.js` with a script tag in the page.
### Simple Application Structure
The standard application structure would be something like the following:
index.html:
```html
```
app/app.js:
```javascript
// relative require for within the package
require('./local-dep'); // -> /app/local-dep.js
// library resource
var $ = require('jquery'); // -> /lib/jquery.js
// format detected automatically
console.log('loaded CommonJS');
```
Module format detection happens in the order System.register, ES6, AMD, then CommonJS and falls back to global modules.
Named defines are also supported, with the return value for a module containing named defines being its last named define.
> _Note that when running locally, ensure you are running from a local server or a browser with local XHR requests enabled. If not you will get an error message._
> _For Chrome on Mac, you can run it with: `/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --allow-file-access-from-files &> /dev/null &`_
> _In Firefox this requires navigating to `about:config`, entering `security.fileuri.strict_origin_policy` in the filter box and toggling the option to false._
### Loading ES6
app/es6-file.js:
```javascript
export class q {
constructor() {
this.es6 = 'yay';
}
}
```
```html
```
ES6 modules define named exports, provided as getters on a special immutable `Module` object.
To build for production, see the [System.register build workflow](#es6-systemregister-compilation).
For further infomation on ES6 module loading, see the [ES6 Module Loader polyfill documentation](https://github.com/ModuleLoader/es6-module-loader).
### Loading Other Formats
When loading from CommonJS, AMD or globals, SystemJS will detect the format automatically.
Any module type can be loaded from any other type.
When loading CommonJS, AMD or globals from ES6, use the `default` import syntax:
app/es6-loading-commonjs:
```javascript
import _ from './underscore';
```
Where underscore.js is located in the same folder.
Features
---
### Map Configuration
Map configuration alters the module name at the normalization stage. It is useful for creating aliases:
```javascript
System.map['jquery'] = 'location/for/jquery';
System.import('jquery') // -> 'location/for/jquery'
System.import('jquery/submodule') // -> `location/for/jquery/submodule'
```
Contexual map configuration can also be used to provide maps only for certain modules, which is useful for version mappings:
```javascript
System.map['some-module'] = {
jquery: 'jquery@2.0.3'
};
// some-module.js now gets 'jquery@2.0.3'
// everything else still gets 'location/for/jquery'
```
Contextual maps apply from the most specific module name match only.
### Meta Configuration
The ES6 module loader uses a special `metadata` object that is passed between hooks.
An example of meta config is the module format of a module, which is stored at `metadata.format`.
The meta extension opens up this object for setting defaults through `System.meta` as well as inline module syntax.
In this way, we can specify the module format of a module through config:
```javascript
System.meta['some/module'] = {
format: 'amd'
};
System.import('some/module') // always loaded as AMD even if it is a UMD module
```
Or the module can even specify its own meta:
some/module.js
```javascript
"format amd";
if (typeof module != 'undefined' && module.exports)
module.exports = 'cjs';
else
define(function() { return 'amd' });
```
Since it is impossible to write 100% accurate module detection, this inline `format` hint provides a useful way of informing the module format of a module.
The format options are - `register`, `es6`, `amd`, `cjs`, `global`.
### Global Module Format Support
When a module is loaded as a global, the global object is detected automatically from the change in the `window` properties:
app/sample-global.js
```javascript
hello = 'world';
```
```javascript
System.import('app/sample-global').then(function(m) {
m == 'world';
});
```
When multiple global properties are detected, the module object becomes the collection of those objects:
app/multi-global.js
```javascript
first = 'global1';
var second = 'global2';
```
```javascript
System.import('app/multi-global').then(function(m) {
m.first == 'global1';
m.second == 'global2';
});
```
Global dependencies can be specified with the `deps` [meta config](#meta-configuration):
app/another-global.js
```javascript
$(document).fn();
this.is = 'a global dependent on jQuery';
```
```javascript
System.meta['app/another-global'] = { deps: ['jquery'] };
```
Note that the name used in `System.meta` must be the fully normalized name that is returned by `Promise.resolve(System.normalize('module-name')).then(console.log.bind(console))`.
The `exports` meta config can also be set (using inline meta as an example):
app/more-global.js
```javascript
"format global";
"deps jquery";
"exports my.export";
(function(global) {
global.my = {
export: 'value'
};
$(document).fn();
})(typeof window != 'undefined' ? window : global);
```
There is also supports for the `init` function meta config just like RequireJS as well.
**IE8 Support**
In IE8, automatic global detection does not work for globals declared as variables or implicitly:
```javascript
var someGlobal = 'IE8 wont detect this';
anotherGlobal = 'unless using an explicit shim';
```
IF IE8 support is needed, these exports will need to be declared manually with configuration.
### Versions
An optional syntax for version support can be used: `moduleName@version`.
For example, consider an app which wants to specify the jQuery version through config:
```javascript
System.versions['jquery'] = '2.0.3';
```
Now an import of the form:
```javascript
System.import('jquery');
```
will load a load will be made to the file `/lib/jquery@2.0.3.js`.
This centralises the version management to the configuration file, which is key to handling versions with correct caching.
For multi-version support, provide an array of versions:
```javascript
System.versions['jquery'] = ['2.0.3', '1.8.3'];
```
These correspond to `/lib/jquery@2.0.3.js` and `/lib/jquery@1.8.3.js`.
Semver-compatible requires of any of the following forms can be used:
```javascript
System.import('jquery') // -> /lib/jquery@2.0.3.js
System.import('jquery@2') // -> /lib/jquery@2.0.3.js
System.import('jquery@2.0') // -> /lib/jquery@2.0.3.js
System.import('jquery@1') // -> /lib/jquery@1.8.3.js
System.import('jquery@1.8') // -> /lib/jquery@1.8.3.js
System.import('jquery@1.8.2') // -> /lib/jquery@1.8.2.js
// semver compatible form (caret operator ^)
System.import('jquery@^2') // -> /lib/jquery@2.0.3.js
System.import('jquery@^1.8.2') // -> /lib/jquery@1.8.3.js
System.import('jquery@^1.8') // -> /lib/jquery@1.8.3.js
```
### Relative Dynamic Loading
Modules can check their own name from the global variable `__moduleName`. `__moduleAddress` is also available.
This allows easy relative dynamic loading, allowing modules to load additional functionality after the initial load:
```javascript
export function moreFunctionality() {
return System.import('./extrafunctionality', { name: __moduleName });
}
```
This can be useful for modules that may only know during runtime which functionality they need to load.
### Plugins
Plugins handle alternative loading scenarios, including loading assets such as CSS or images, and providing custom transpilation scenarios.
Plugins are indicated by `!` syntax, which unlike RequireJS is appended at the end of the module name, not the beginning.
The plugin name is just a module name itself, and if not specified, is assumed to be the extension name of the module.
Supported Plugins:
* [CSS](https://github.com/systemjs/plugin-css) `System.import('my/file.css!')`
* [Image](https://github.com/systemjs/plugin-image) `System.import('some/image.png!image')`
* [JSON](https://github.com/systemjs/plugin-json) `System.import('some/data.json!').then(function(json){})`
* [Text](https://github.com/systemjs/plugin-text) `System.import('some/text.txt!text').then(function(text) {})`
Additional Plugins:
* [Markdown](https://github.com/guybedford/plugin-md) `System.import('app/some/project/README.md!').then(function(html) {})`
* [WebFont](https://github.com/guybedford/plugin-font) `System.import('google Port Lligat Slab, Droid Sans !font')`
Creating custom plugins can be quite simple. See the plugins above, and [read the guide here](https://github.com/systemjs/systemjs/wiki/Creating-a-Plugin).
### ES6 System.register Compilation
If writing an application in ES6, we can compile into ES5 with Traceur:
```
npm install traceur -g
```
```
traceur --dir app app-built --modules=instantiate
```
This will compile all ES6 files in the directory `app` into corresponding ES5 `System.register` files in `app-built`.
The `instantiate` modules option writes the modules out using a `System.register` call, which is supported by SystemJS.
Then include [`traceur-runtime.js`](https://raw.githubusercontent.com/jmcriffey/bower-traceur/0.0.72/traceur-runtimr.js) (also found inside traceur's `bin` folder when installed via npm) before es6-module-loader.js:
```html
```
We can then use map or paths config to ensure that `app/main` gets directed to the new folder. Alternatively rename `app-built` to replace `app`.
Now the application will continue to behave identically without needing to compile ES6 in the browser.
### Compiling ES6 to ES5 and AMD
The same method above can also be used to compile ES6 into AMD with `--modules=amd`.
We can then use the r.js optimizer to create a bundle with named defines, which are supported by SystemJS.
Note that the ES6 live bindings and circular references don't work in AMD, although circular references still work in many cases.
### Bundles
Bundles configuration allows a single bundle file to be loaded in place of separate module files.
```javascript
System.bundles['build/core'] = ['jquery', 'app/app', 'app/dep', 'lib/third-party'];
// loads "app/app" from the module "build/core".
System.import('app/app');
// a request to any one of 'jquery', 'app/app', 'app/dep', 'lib/third-party'
// would delegate to the "build/core" module
```
A built file must contain the exact named defines or named `System.register` statements for the modules
it contains. Mismatched names will result in separate requests still being made.
We can create a custom bundle with Traceur by combining together a module with all its dependencies into a single file:
```
traceur --out build.js app/main.js app/core.js app/another.js
```
Each file will be traced and all its dependencies included in the final build file.
We can also just include this bundle with a `
```
To make all module formats work with CSP, we need to ensure everything is built with a suitable wrapper.
See [SystemJS Builder](https://github.com/systemjs/builder) for a single-file build workflow that can wrap up all module formats.
### RequireJS Support
To use SystemJS side-by-side in a RequireJS project, make sure to include RequireJS after ES6 Module Loader but before SystemJS.
Conversely, to have SystemJS provide a RequireJS-like API in an application set:
```javascript
window.define = loader.amdDefine;
window.require = window.requirejs = loader.amdRequire;
```
### NodeJS Usage
To load modules in NodeJS, install SystemJS with:
```
npm install systemjs
```
We can then load modules equivalently to in the browser:
```javascript
var System = require('systemjs');
// loads './app.js' from the current directory
System.import('./app').then(function(m) {
console.log(m);
});
```
## Contributing
Contributions are welcome. The goal of SystemJS is to encourage loaders made out of small self-contained features.
Since different builds can be created for different use cases, new builds or new features are welcome to be submitted for
consideration with pull requests.
#### Running the tests
To install the dependencies correctly, run `bower install` from the root of the repo, then open `test/test.html` in a browser with a local server
or file access flags enabled.
License
---
MIT
================================================
FILE: client/components/system.js/bower.json
================================================
{
"name": "system.js",
"version": "0.10.1",
"main": "dist/system.js",
"dependencies": {
"es6-module-loader": "~0.10.0"
},
"devDependencies": {
"qunit": "~1.12.0"
},
"ignore": [
"test",
"Makefile",
"package.json"
]
}
================================================
FILE: client/components/system.js/dist/system-csp.js
================================================
!function($__global){$__global.upgradeSystemLoader=function(){function e(e){var t=String(e).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@\/?#]*(?::[^:@\/?#]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return t?{href:t[0]||"",protocol:t[1]||"",authority:t[2]||"",host:t[3]||"",hostname:t[4]||"",port:t[5]||"",pathname:t[6]||"",search:t[7]||"",hash:t[8]||""}:null}function t(t,a){function r(e){var t=[];return e.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(e){"/.."===e?t.pop():t.push(e)}),t.join("").replace(/^\//,"/"===e.charAt(0)?"/":"")}return a=e(a||""),t=e(t||""),a&&t?(a.protocol||t.protocol)+(a.protocol||a.authority?a.authority:t.authority)+r(a.protocol||a.authority||"/"===a.pathname.charAt(0)?a.pathname:a.pathname?(t.authority&&!t.pathname?"/":"")+t.pathname.slice(0,t.pathname.lastIndexOf("/")+1)+a.pathname:t.pathname)+(a.protocol||a.authority||a.pathname?a.search:a.search||t.search)+a.hash:null}function a(e){"undefined"==typeof h&&(h=Array.prototype.indexOf);var t=document.getElementsByTagName("head")[0];e.onScriptLoad=function(){},e.fetch=function(a){return new Promise(function(r,n){function o(){l.readyState&&"loaded"!=l.readyState&&"complete"!=l.readyState||(s(),e.onScriptLoad(a),a.metadata.registered||n(a.address+" did not call System.register or AMD define"),r(""))}function i(e){s(),n(e)}function s(){l.detachEvent?l.detachEvent("onreadystatechange",o):(l.removeEventListener("load",o,!1),l.removeEventListener("error",i,!1)),t.removeChild(l)}var l=document.createElement("script");l.async=!0,l.attachEvent?l.attachEvent("onreadystatechange",o):(l.addEventListener("load",o,!1),l.addEventListener("error",i,!1)),l.src=a.address,t.appendChild(l)})},e.scriptLoader=!0}function r(e){function t(e,t){var a=e.meta&&e.meta[t.name];if(a)for(var r in a)t.metadata[r]=t.metadata[r]||a[r]}var a=/^(\s*\/\*.*\*\/|\s*\/\/[^\n]*|\s*"[^"]+"\s*;?|\s*'[^']+'\s*;?)+/,r=/\/\*.*\*\/|\/\/[^\n]*|"[^"]+"\s*;?|'[^']+'\s*;?/g;e.meta={};var n=e.locate;e.locate=function(e){return t(this,e),n.call(this,e)};var o=e.translate;e.translate=function(e){var n=e.source.match(a);if(n)for(var i=n[0].match(r),s=0;sa;a++)-1==h.call(t,e[a])&&t.push(e[a]);return t}function n(t,a,r,n){"string"!=typeof t&&(n=r,r=a,a=t,t=null),g=!0;var o;if(o="boolean"==typeof r?{declarative:!1,deps:a,execute:n,executingRequire:r}:{declarative:!0,deps:a,declare:r},t)o.name=t,e.defined[t]||(e.defined[t]=o);else if(o.declarative){if(v)throw new TypeError("Multiple anonymous System.register calls in the same module file.");v=o}}function o(e){if(!e.register){e.register=n,e.defined||(e.defined={});var t=e.onScriptLoad;e.onScriptLoad=function(e){t(e),v&&(e.metadata.entry=v),g&&(e.metadata.format=e.metadata.format||"register",e.metadata.registered=!0)}}}function i(e,t,a){if(a[e.groupIndex]=a[e.groupIndex]||[],-1==h.call(a[e.groupIndex],e)){a[e.groupIndex].push(e);for(var r=0,n=e.normalizedDeps.length;n>r;r++){var o=e.normalizedDeps[r],s=t.defined[o];if(s&&!s.evaluated){var l=e.groupIndex+(s.declarative!=e.declarative);if(void 0===s.groupIndex||s.groupIndex=0;o--){for(var s=r[o],l=0;ln;n++){var i=a.importers[n];if(!i.locked){var s=h.call(i.dependencies,a);i.setters[s](r)}}return a.locked=!1,t});if(a.setters=n.setters,a.execute=n.execute,!a.setters||!a.execute)throw new TypeError("Invalid System.register form for "+e.name);for(var o=0,i=e.normalizedDeps.length;i>o;o++){var s,d=e.normalizedDeps[o],c=t.defined[d],f=b[d];f?s=f.exports:c&&!c.declarative?s={"default":c.module.exports,__useDefault:!0}:c?(u(c,t),f=c.module,s=f.exports):s=t.get(d),f&&f.importers?(f.importers.push(a),a.dependencies.push(f)):a.dependencies.push(null),a.setters[o]&&a.setters[o](s)}}}function d(e,t){var a,r=t.defined[e];if(r)r.declarative?f(e,[],t):r.evaluated||c(r,t),a=r.module.exports;else if(a=t.get(e),!a)throw new Error("Unable to load dependency "+e+".");return(!r||r.declarative)&&a&&a.__useDefault?a["default"]:a}function c(e,t){if(!e.module){var a={},r=e.module={exports:a,id:e.name};if(!e.executingRequire)for(var n=0,o=e.normalizedDeps.length;o>n;n++){var i=e.normalizedDeps[n],s=t.defined[i];s&&c(s,t)}e.evaluated=!0;var l=e.execute.call(t.global,function(a){for(var r=0,n=e.deps.length;n>r;r++)if(e.deps[r]==a)return d(e.normalizedDeps[r],t);throw new TypeError("Module "+a+" not declared as a dependency.")},a,r);l&&(r.exports=l)}}function f(e,t,a){var r=a.defined[e];if(!r.evaluated&&r.declarative){t.push(e);for(var n=0,o=r.normalizedDeps.length;o>n;n++){var i=r.normalizedDeps[n];-1==h.call(t,i)&&(a.defined[i]?f(i,t,a):a.get(i))}r.evaluated||(r.evaluated=!0,r.module.execute.call(a.global))}}"undefined"==typeof h&&(h=Array.prototype.indexOf),"undefined"==typeof __eval&&(__eval=0||eval);var m;e.__exec=a;var v,g;o(e);var b={},y=/System\.register/,x=e.fetch;e.fetch=function(e){var t=this;return o(t),t.defined[e.name]?(e.metadata.format="defined",""):(v=null,g=!1,x.call(t,e))};var _=e.translate;e.translate=function(e){return this.register=n,this.__exec=a,e.metadata.deps=e.metadata.deps||[],Promise.resolve(_.call(this,e)).then(function(t){return(e.metadata.init||e.metadata.exports)&&(e.metadata.format=e.metadata.format||"global"),("register"==e.metadata.format||!e.metadata.format&&e.source.match(y))&&(e.metadata.format="register"),t})};var w=e.instantiate;e.instantiate=function(e){var t,a=this;if(a.defined[e.name])t=a.defined[e.name],t.deps=t.deps.concat(e.metadata.deps);else if(e.metadata.entry)t=e.metadata.entry;else if(e.metadata.execute)t={declarative:!1,deps:e.metadata.deps||[],execute:e.metadata.execute,executingRequire:e.metadata.executingRequire};else if("register"==e.metadata.format){v=null,g=!1;var o=a.global.System=a.global.System||a,i=o.register;if(o.register=n,a.__exec(e),o.register=i,v&&(t=v),!t&&o.defined[e.name]&&(t=o.defined[e.name]),!g&&!e.metadata.registered)throw new TypeError(e.name+" detected as System.register but didn't execute.")}if(!t&&"es6"!=e.metadata.format)return{deps:[],execute:function(){return a.newModule({})}};if(!t)return w.call(this,e);a.defined[e.name]=t,t.deps=r(t.deps),t.name=e.name;for(var l=[],u=0,d=t.deps.length;d>u;u++)l.push(Promise.resolve(a.normalize(t.deps[u],e.name)));return Promise.all(l).then(function(r){return t.normalizedDeps=r,{deps:t.deps,execute:function(){s(e.name,a),f(e.name,[],a),a.defined[e.name]=void 0;var r=a.newModule(t.declarative?t.module.exports:{"default":t.module.exports,__useDefault:!0});return r}}})}}function o(e){var a=e["import"];e["import"]=function(e,t){return a.call(this,e,t).then(function(e){return e.__useDefault?e["default"]:e})},e.set("@empty",e.newModule({})),"undefined"!=typeof require&&(e._nodeRequire=require),e.config=function(e){for(var t in e){var a=e[t];if("object"!=typeof a||a instanceof Array)this[t]=a;else{this[t]=this[t]||{};for(var r in a)this[t][r]=a[r]}}};var r;if("undefined"==typeof window&&"undefined"==typeof WorkerGlobalScope)r="file:"+process.cwd()+"/";else if("undefined"==typeof window)r=e.global.location.href;else if(r=document.baseURI,!r){var n=document.getElementsByTagName("base");r=n[0]&&n[0].href||window.location.href}var o,i=e.locate;e.locate=function(e){return this.baseURL!=o&&(o=t(r,this.baseURL),"/"!=o.substr(o.length-1,1)&&(o+="/"),this.baseURL=o),Promise.resolve(i.call(this,e))};var s=/(^\s*|[}\);\n]\s*)(import\s+(['"]|(\*\s+as\s+)?[^"'\(\)\n;]+\s+from\s+['"]|\{)|export\s+\*\s+from\s+["']|export\s+(\{|default|function|class|var|const|let))/,l=e.translate;e.translate=function(e){var t=this;return"@traceur"==e.name?l.call(t,e):"es6"!=e.metadata.format&&(e.metadata.format||!e.source.match(s))||(e.metadata.format="es6",t.global.traceur)?l.call(t,e):t["import"]("@traceur").then(function(){return l.call(t,e)})};var u=e.instantiate;e.instantiate=function(e){var t=this;return"@traceur"==e.name?(t.__exec(e),{deps:[],execute:function(){return t.newModule({})}}):u.call(t,e)}}function i(e){function t(e,t){for(var a=e.split(".");a.length;)t=t[a.shift()];return t}function a(e){if(!e.has("@@global-helpers")){var a,r,n=e.global.hasOwnProperty,o={};e.set("@@global-helpers",e.newModule({prepareGlobal:function(t,i){for(var s=0;sa;a++)"/"===e[a]&&t++;return t}function r(e,t,a){return a+e.substr(t)}function n(e,n,o){var i,s,l,u,d=0,c=0;if(n)for(var f in o.map){var m=o.map[f];if("object"==typeof m&&t(n,f)&&(l=a(f),!(c>=l)))for(var p in m)t(e,p)&&(u=a(p),d>=u||(i=p,d=u,s=f,c=l))}if(i)return r(e,i.length,o.map[s][i]);for(var f in o.map){var m=o.map[f];if("string"==typeof m&&t(e,f)){var u=a(f);d>=u||(i=f,d=u)}}return i?r(e,i.length,o.map[i]):e}e.map=e.map||{};var o=e.normalize;e.normalize=function(e,t,a){var r=this;r.map||(r.map={});var i=!1;return"/"==e.substr(e.length-1,1)&&(i=!0,e+="#"),Promise.resolve(o.call(r,e,t,a)).then(function(e){if(e=n(e,t,r),i){var a=e.split("/");a.pop();var o=a.pop();a.push(o),a.push(o),e=a.join("/")}return e})}}function d(e){"undefined"==typeof h&&(h=Array.prototype.indexOf);var t=e.normalize;e.normalize=function(e,a,r){var n,o=this;return a&&-1!=(n=a.indexOf("!"))&&(a=a.substr(0,n)),Promise.resolve(t.call(o,e,a,r)).then(function(e){var t=e.lastIndexOf("!");if(-1!=t){var n=e.substr(0,t),i=e.substr(t+1)||n.substr(n.lastIndexOf(".")+1);return new Promise(function(e){e(o.normalize(i,a,r))}).then(function(e){return i=e,o.normalize(n,a,r)}).then(function(e){return e+"!"+i})}return e})};var a=e.locate;e.locate=function(e){var t=this,r=e.name;if(this.defined&&this.defined[r])return a.call(this,e);var n=r.lastIndexOf("!");if(-1!=n){var o=r.substr(n+1);e.name=r.substr(0,n);var i=t.pluginLoader||t;return i["import"](o).then(function(){var a=i.get(o);return a=a["default"]||a,a.build===!1&&t.pluginLoader&&(e.metadata.build=!1),e.metadata.plugin=a,e.metadata.pluginName=o,e.metadata.pluginArgument=e.name,a.locate?a.locate.call(t,e):Promise.resolve(t.locate(e)).then(function(e){return e.substr(0,e.length-3)})})}return a.call(this,e)};var r=e.fetch;e.fetch=function(e){var t=this;return e.metadata.build===!1?"":e.metadata.plugin&&e.metadata.plugin.fetch&&!e.metadata.pluginFetchCalled?(e.metadata.pluginFetchCalled=!0,e.metadata.plugin.fetch.call(t,e,r)):r.call(t,e)};var n=e.translate;e.translate=function(e){var t=this;return e.metadata.plugin&&e.metadata.plugin.translate?Promise.resolve(e.metadata.plugin.translate.call(t,e)).then(function(a){return a&&(e.source=a),n.call(t,e)}):n.call(t,e)};var o=e.instantiate;e.instantiate=function(e){var t=this;return e.metadata.plugin&&e.metadata.plugin.instantiate?Promise.resolve(e.metadata.plugin.instantiate.call(t,e)).then(function(a){return e.metadata.format="defined",e.metadata.execute=function(){return a},o.call(t,e)}):e.metadata.plugin&&e.metadata.plugin.build===!1?(e.metadata.format="defined",e.metadata.deps.push(e.metadata.pluginName),e.metadata.execute=function(){return t.newModule({})},o.call(t,e)):o.call(t,e)}}function c(e){"undefined"==typeof h&&(h=Array.prototype.indexOf),e.bundles=e.bundles||{};var t=e.fetch;e.fetch=function(e){var a=this;if(a.trace)return t.call(this,e);a.bundles||(a.bundles={});for(var r in a.bundles)if(-1!=h.call(a.bundles[r],e.name))return Promise.resolve(a.normalize(r)).then(function(e){return a.bundles[e]=a.bundles[e]||a.bundles[r],a.meta=a.meta||{},a.meta[e]=a.meta[e]||{},a.meta[e].bundle=!0,a.load(e)}).then(function(){return""});return t.call(this,e)}}function f(e){function t(e){return parseInt(e,10)}function a(e){var a=e.match(s);return a?{major:t(a[1]),minor:t(a[2]),patch:t(a[3]),pre:a[4]&&a[4].split(".")}:{tag:e}}function r(e,a){if(e.tag&&a.tag)return 0;if(e.tag)return-1;if(a.tag)return 1;for(var r=0;ri?1:-1}if(!e.pre&&!a.pre)return 0;if(!e.pre)return 1;if(!a.pre)return-1;for(var r=0,s=Math.min(e.pre.length,a.pre.length);s>r;r++)if(e.pre[r]!=a.pre[r]){var d=e.pre[r].match(l),c=a.pre[r].match(l);return d&&!c?-1:c&&!d?1:d&&c?t(e.pre[r])>t(a.pre[r])?1:-1:e.pre[r]>a.pre[r]?1:-1}return e.pre.length==a.pre.length?0:e.pre.length>a.pre.length?1:-1}function n(e,t){var a=e.version;return a.tag?a.tag==t.tag:1==r(a,t)?!1:isNaN(t.minor)||isNaN(t.patch)?!1:t.pre?a.major!=t.major||a.minor!=t.minor||a.patch!=t.patch?!1:e.semver||e.fuzzy||a.pre.join(".")==t.pre.join("."):e.semver?0==a.major&&isNaN(a.minor)?t.major<1:a.major>=1?a.major==t.major:a.minor>=1?a.minor==t.minor:(a.patch||0)==t.patch:e.fuzzy?t.major==a.major&&t.minor<(a.minor||0)+1:!a.pre&&a.major==t.major&&a.minor==t.minor&&a.patch==t.patch}function o(e){var t={};((t.semver="^"==e.substr(0,1))||(t.fuzzy="~"==e.substr(0,1)))&&(e=e.substr(1));var r=t.version=a(e);return r.tag?t:(t.fuzzy||t.semver||!isNaN(r.minor)&&!isNaN(r.patch)||(t.fuzzy=!0),t.fuzzy&&isNaN(r.minor)&&(t.semver=!0,t.fuzzy=!1),t.semver&&!isNaN(r.minor)&&isNaN(r.patch)&&(t.semver=!1,t.fuzzy=!0),t)}function i(e,t){return r(a(e),a(t))}"undefined"==typeof h&&(h=Array.prototype.indexOf);var s=/^(\d+)(?:\.(\d+)(?:\.(\d+)(?:-([\da-z-]+(?:\.[\da-z-]+)*)(?:\+([\da-z-]+(?:\.[\da-z-]+)*))?)?)?)?$/i,l=/^\d+$/,u=["major","minor","patch"];e.versions=e.versions||{};var d=e.normalize;e.normalize=function(t,r,s){e.versions||(e.versions={});var l,u,c=this.versions;if(t.indexOf("@")>0){var f=t.lastIndexOf("@"),m=t.substr(f+1,t.length-f-1).split("/");l=m[0],u=m.length,t=t.substr(0,f)+t.substr(f+l.length+1,t.length-f-l.length-1)}return Promise.resolve(d.call(this,t,r,s)).then(function(e){var t=e.indexOf("@");if(l&&(-1==t||0==t)){var r=e.split("/");r[r.length-u]+="@"+l,e=r.join("/"),t=e.indexOf("@")}var s,d;if(-1==t||0==t){for(var f in c)if(d=c[f],e.substr(0,f.length)==f&&(s=e.substr(f.length,1),!s||"/"==s))return f+"@"+("string"==typeof d?d:d[d.length-1])+e.substr(f.length);return e}var m=e.substr(0,t),p=e.substr(t+1).split("/")[0],h=p.length,v=o(e.substr(t+1).split("/")[0]);d=c[e.substr(0,t)]||[],"string"==typeof d&&(d=[d]);for(var g=d.length-1;g>=0;g--)if(n(v,a(d[g])))return m+"@"+d[g]+e.substr(t+h+1);var b;return v.semver?b=0!=v.version.major||isNaN(v.version.minor)?v.version.major:"0."+v.version.minor:v.fuzzy?b=v.version.major+"."+v.version.minor:(b=p,d.push(p),d.sort(i),c[m]=1==d.length?d[0]:d),m+"@"+b+e.substr(t+h+1)})}}function m(e){e.depCache=e.depCache||{},loaderLocate=e.locate,e.locate=function(e){var t=this;t.depCache||(t.depCache={});var a=t.depCache[e.name];if(a)for(var r=0;rt;t++)if(this[t]===e)return t;return-1};!function(){var e=$__global.System;p=$__global.System=new LoaderPolyfill(e),p.baseURL=e.baseURL,p.paths={"*":"*.js"},p.originalSystem=e}(),p.noConflict=function(){$__global.SystemJS=p,$__global.System=p.originalSystem},a(p),r(p),n(p),o(p),i(p),s(p),l(p),u(p),d(p),c(p),f(p),m(p),p.paths["@traceur"]||(p.paths["@traceur"]=$__curScript&&$__curScript.getAttribute("data-traceur-src")||($__curScript&&$__curScript.src?$__curScript.src.substr(0,$__curScript.src.lastIndexOf("/")+1):p.baseURL+(p.baseURL.lastIndexOf("/")==p.baseURL.length-1?"":"/"))+"traceur.js")};var $__curScript,__eval;!function(){var doEval;__eval=function(e,t,a){e+="\n//# sourceURL="+t+(a?"\n//# sourceMappingURL="+a:"");try{doEval(e)}catch(r){var n="Error evaluating "+t+"\n";throw r instanceof Error?r.message=n+r.message:r=n+r,r}};var isWorker="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,isBrowser="undefined"!=typeof window;if(isBrowser){var head,scripts=document.getElementsByTagName("script");if($__curScript=scripts[scripts.length-1],doEval=function(e){head||(head=document.head||document.body||document.documentElement);var t=document.createElement("script");t.text=e;var a,r=window.onerror;if(window.onerror=function(e){a=e},head.appendChild(t),head.removeChild(t),window.onerror=r,a)throw a},$__global.System&&$__global.LoaderPolyfill)$__global.upgradeSystemLoader();else{var curPath=$__curScript.src,basePath=curPath.substr(0,curPath.lastIndexOf("/")+1);document.write('
```
## License
Copyright 2012 Traceur Authors.
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.
================================================
FILE: client/components/traceur/bower.json
================================================
{
"name": "traceur",
"version": "0.0.74",
"main": "./traceur.js",
"ignore": [
"node_modules",
"Gruntfile.js",
"*.json",
".*"
]
}
================================================
FILE: client/components/traceur/traceur.js
================================================
(function(global) {
'use strict';
if (global.$traceurRuntime) {
return;
}
var $Object = Object;
var $TypeError = TypeError;
var $create = $Object.create;
var $defineProperties = $Object.defineProperties;
var $defineProperty = $Object.defineProperty;
var $freeze = $Object.freeze;
var $getOwnPropertyDescriptor = $Object.getOwnPropertyDescriptor;
var $getOwnPropertyNames = $Object.getOwnPropertyNames;
var $keys = $Object.keys;
var $hasOwnProperty = $Object.prototype.hasOwnProperty;
var $toString = $Object.prototype.toString;
var $preventExtensions = Object.preventExtensions;
var $seal = Object.seal;
var $isExtensible = Object.isExtensible;
function nonEnum(value) {
return {
configurable: true,
enumerable: false,
value: value,
writable: true
};
}
var method = nonEnum;
var counter = 0;
function newUniqueString() {
return '__$' + Math.floor(Math.random() * 1e9) + '$' + ++counter + '$__';
}
var symbolInternalProperty = newUniqueString();
var symbolDescriptionProperty = newUniqueString();
var symbolDataProperty = newUniqueString();
var symbolValues = $create(null);
var privateNames = $create(null);
function isPrivateName(s) {
return privateNames[s];
}
function createPrivateName() {
var s = newUniqueString();
privateNames[s] = true;
return s;
}
function isShimSymbol(symbol) {
return typeof symbol === 'object' && symbol instanceof SymbolValue;
}
function typeOf(v) {
if (isShimSymbol(v))
return 'symbol';
return typeof v;
}
function Symbol(description) {
var value = new SymbolValue(description);
if (!(this instanceof Symbol))
return value;
throw new TypeError('Symbol cannot be new\'ed');
}
$defineProperty(Symbol.prototype, 'constructor', nonEnum(Symbol));
$defineProperty(Symbol.prototype, 'toString', method(function() {
var symbolValue = this[symbolDataProperty];
if (!getOption('symbols'))
return symbolValue[symbolInternalProperty];
if (!symbolValue)
throw TypeError('Conversion from symbol to string');
var desc = symbolValue[symbolDescriptionProperty];
if (desc === undefined)
desc = '';
return 'Symbol(' + desc + ')';
}));
$defineProperty(Symbol.prototype, 'valueOf', method(function() {
var symbolValue = this[symbolDataProperty];
if (!symbolValue)
throw TypeError('Conversion from symbol to string');
if (!getOption('symbols'))
return symbolValue[symbolInternalProperty];
return symbolValue;
}));
function SymbolValue(description) {
var key = newUniqueString();
$defineProperty(this, symbolDataProperty, {value: this});
$defineProperty(this, symbolInternalProperty, {value: key});
$defineProperty(this, symbolDescriptionProperty, {value: description});
freeze(this);
symbolValues[key] = this;
}
$defineProperty(SymbolValue.prototype, 'constructor', nonEnum(Symbol));
$defineProperty(SymbolValue.prototype, 'toString', {
value: Symbol.prototype.toString,
enumerable: false
});
$defineProperty(SymbolValue.prototype, 'valueOf', {
value: Symbol.prototype.valueOf,
enumerable: false
});
var hashProperty = createPrivateName();
var hashPropertyDescriptor = {value: undefined};
var hashObjectProperties = {
hash: {value: undefined},
self: {value: undefined}
};
var hashCounter = 0;
function getOwnHashObject(object) {
var hashObject = object[hashProperty];
if (hashObject && hashObject.self === object)
return hashObject;
if ($isExtensible(object)) {
hashObjectProperties.hash.value = hashCounter++;
hashObjectProperties.self.value = object;
hashPropertyDescriptor.value = $create(null, hashObjectProperties);
$defineProperty(object, hashProperty, hashPropertyDescriptor);
return hashPropertyDescriptor.value;
}
return undefined;
}
function freeze(object) {
getOwnHashObject(object);
return $freeze.apply(this, arguments);
}
function preventExtensions(object) {
getOwnHashObject(object);
return $preventExtensions.apply(this, arguments);
}
function seal(object) {
getOwnHashObject(object);
return $seal.apply(this, arguments);
}
freeze(SymbolValue.prototype);
function isSymbolString(s) {
return symbolValues[s] || privateNames[s];
}
function toProperty(name) {
if (isShimSymbol(name))
return name[symbolInternalProperty];
return name;
}
function removeSymbolKeys(array) {
var rv = [];
for (var i = 0; i < array.length; i++) {
if (!isSymbolString(array[i])) {
rv.push(array[i]);
}
}
return rv;
}
function getOwnPropertyNames(object) {
return removeSymbolKeys($getOwnPropertyNames(object));
}
function keys(object) {
return removeSymbolKeys($keys(object));
}
function getOwnPropertySymbols(object) {
var rv = [];
var names = $getOwnPropertyNames(object);
for (var i = 0; i < names.length; i++) {
var symbol = symbolValues[names[i]];
if (symbol) {
rv.push(symbol);
}
}
return rv;
}
function getOwnPropertyDescriptor(object, name) {
return $getOwnPropertyDescriptor(object, toProperty(name));
}
function hasOwnProperty(name) {
return $hasOwnProperty.call(this, toProperty(name));
}
function getOption(name) {
return global.traceur && global.traceur.options[name];
}
function defineProperty(object, name, descriptor) {
if (isShimSymbol(name)) {
name = name[symbolInternalProperty];
}
$defineProperty(object, name, descriptor);
return object;
}
function polyfillObject(Object) {
$defineProperty(Object, 'defineProperty', {value: defineProperty});
$defineProperty(Object, 'getOwnPropertyNames', {value: getOwnPropertyNames});
$defineProperty(Object, 'getOwnPropertyDescriptor', {value: getOwnPropertyDescriptor});
$defineProperty(Object.prototype, 'hasOwnProperty', {value: hasOwnProperty});
$defineProperty(Object, 'freeze', {value: freeze});
$defineProperty(Object, 'preventExtensions', {value: preventExtensions});
$defineProperty(Object, 'seal', {value: seal});
$defineProperty(Object, 'keys', {value: keys});
}
function exportStar(object) {
for (var i = 1; i < arguments.length; i++) {
var names = $getOwnPropertyNames(arguments[i]);
for (var j = 0; j < names.length; j++) {
var name = names[j];
if (isSymbolString(name))
continue;
(function(mod, name) {
$defineProperty(object, name, {
get: function() {
return mod[name];
},
enumerable: true
});
})(arguments[i], names[j]);
}
}
return object;
}
function isObject(x) {
return x != null && (typeof x === 'object' || typeof x === 'function');
}
function toObject(x) {
if (x == null)
throw $TypeError();
return $Object(x);
}
function checkObjectCoercible(argument) {
if (argument == null) {
throw new TypeError('Value cannot be converted to an Object');
}
return argument;
}
var path = typeof require !== 'undefined' && require('path');
function relativeRequire(callerPath, requiredPath) {
function isDirectory(path) {
return (path.slice(-1) === '/');
}
function isAbsolute(path) {
return (path.charAt(0) === '/');
}
function isRelative(path) {
return (path.charAt(0) === '.');
}
if (isDirectory(requiredPath) || isAbsolute(requiredPath))
return;
return isRelative(requiredPath) ? require(path.resolve(path.dirname(callerPath), requiredPath)) : require(requiredPath);
}
function polyfillSymbol(global, Symbol) {
if (!global.Symbol) {
global.Symbol = Symbol;
Object.getOwnPropertySymbols = getOwnPropertySymbols;
}
if (!global.Symbol.iterator) {
global.Symbol.iterator = Symbol('Symbol.iterator');
}
}
function setupGlobals(global) {
polyfillSymbol(global, Symbol);
global.Reflect = global.Reflect || {};
global.Reflect.global = global.Reflect.global || global;
polyfillObject(global.Object);
}
setupGlobals(global);
global.$traceurRuntime = {
checkObjectCoercible: checkObjectCoercible,
createPrivateName: createPrivateName,
defineProperties: $defineProperties,
defineProperty: $defineProperty,
exportStar: exportStar,
getOwnHashObject: getOwnHashObject,
getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
getOwnPropertyNames: $getOwnPropertyNames,
isObject: isObject,
isPrivateName: isPrivateName,
isSymbolString: isSymbolString,
keys: $keys,
setupGlobals: setupGlobals,
require: relativeRequire,
toObject: toObject,
toProperty: toProperty,
typeof: typeOf
};
})(typeof global !== 'undefined' ? global : this);
(function() {
'use strict';
var path = typeof require !== 'undefined' && require('path');
function relativeRequire(callerPath, requiredPath) {
function isDirectory(path) {
return path.slice(-1) === '/';
}
function isAbsolute(path) {
return path[0] === '/';
}
function isRelative(path) {
return path[0] === '.';
}
if (isDirectory(requiredPath) || isAbsolute(requiredPath))
return;
return isRelative(requiredPath) ? require(path.resolve(path.dirname(callerPath), requiredPath)) : require(requiredPath);
}
$traceurRuntime.require = relativeRequire;
})();
(function() {
'use strict';
function spread() {
var rv = [],
j = 0,
iterResult;
for (var i = 0; i < arguments.length; i++) {
var valueToSpread = $traceurRuntime.checkObjectCoercible(arguments[i]);
if (typeof valueToSpread[$traceurRuntime.toProperty(Symbol.iterator)] !== 'function') {
throw new TypeError('Cannot spread non-iterable object.');
}
var iter = valueToSpread[$traceurRuntime.toProperty(Symbol.iterator)]();
while (!(iterResult = iter.next()).done) {
rv[j++] = iterResult.value;
}
}
return rv;
}
$traceurRuntime.spread = spread;
})();
(function() {
'use strict';
var $Object = Object;
var $TypeError = TypeError;
var $create = $Object.create;
var $defineProperties = $traceurRuntime.defineProperties;
var $defineProperty = $traceurRuntime.defineProperty;
var $getOwnPropertyDescriptor = $traceurRuntime.getOwnPropertyDescriptor;
var $getOwnPropertyNames = $traceurRuntime.getOwnPropertyNames;
var $getPrototypeOf = Object.getPrototypeOf;
var $__0 = Object,
getOwnPropertyNames = $__0.getOwnPropertyNames,
getOwnPropertySymbols = $__0.getOwnPropertySymbols;
function superDescriptor(homeObject, name) {
var proto = $getPrototypeOf(homeObject);
do {
var result = $getOwnPropertyDescriptor(proto, name);
if (result)
return result;
proto = $getPrototypeOf(proto);
} while (proto);
return undefined;
}
function superConstructor(ctor) {
return ctor.__proto__;
}
function superCall(self, homeObject, name, args) {
return superGet(self, homeObject, name).apply(self, args);
}
function superGet(self, homeObject, name) {
var descriptor = superDescriptor(homeObject, name);
if (descriptor) {
if (!descriptor.get)
return descriptor.value;
return descriptor.get.call(self);
}
return undefined;
}
function superSet(self, homeObject, name, value) {
var descriptor = superDescriptor(homeObject, name);
if (descriptor && descriptor.set) {
descriptor.set.call(self, value);
return value;
}
throw $TypeError(("super has no setter '" + name + "'."));
}
function getDescriptors(object) {
var descriptors = {};
var names = getOwnPropertyNames(object);
for (var i = 0; i < names.length; i++) {
var name = names[i];
descriptors[name] = $getOwnPropertyDescriptor(object, name);
}
var symbols = getOwnPropertySymbols(object);
for (var i = 0; i < symbols.length; i++) {
var symbol = symbols[i];
descriptors[$traceurRuntime.toProperty(symbol)] = $getOwnPropertyDescriptor(object, $traceurRuntime.toProperty(symbol));
}
return descriptors;
}
function createClass(ctor, object, staticObject, superClass) {
$defineProperty(object, 'constructor', {
value: ctor,
configurable: true,
enumerable: false,
writable: true
});
if (arguments.length > 3) {
if (typeof superClass === 'function')
ctor.__proto__ = superClass;
ctor.prototype = $create(getProtoParent(superClass), getDescriptors(object));
} else {
ctor.prototype = object;
}
$defineProperty(ctor, 'prototype', {
configurable: false,
writable: false
});
return $defineProperties(ctor, getDescriptors(staticObject));
}
function getProtoParent(superClass) {
if (typeof superClass === 'function') {
var prototype = superClass.prototype;
if ($Object(prototype) === prototype || prototype === null)
return superClass.prototype;
throw new $TypeError('super prototype must be an Object or null');
}
if (superClass === null)
return null;
throw new $TypeError(("Super expression must either be null or a function, not " + typeof superClass + "."));
}
function defaultSuperCall(self, homeObject, args) {
if ($getPrototypeOf(homeObject) !== null)
superCall(self, homeObject, 'constructor', args);
}
$traceurRuntime.createClass = createClass;
$traceurRuntime.defaultSuperCall = defaultSuperCall;
$traceurRuntime.superCall = superCall;
$traceurRuntime.superConstructor = superConstructor;
$traceurRuntime.superGet = superGet;
$traceurRuntime.superSet = superSet;
})();
(function() {
'use strict';
var createPrivateName = $traceurRuntime.createPrivateName;
var $defineProperties = $traceurRuntime.defineProperties;
var $defineProperty = $traceurRuntime.defineProperty;
var $create = Object.create;
var $TypeError = TypeError;
function nonEnum(value) {
return {
configurable: true,
enumerable: false,
value: value,
writable: true
};
}
var ST_NEWBORN = 0;
var ST_EXECUTING = 1;
var ST_SUSPENDED = 2;
var ST_CLOSED = 3;
var END_STATE = -2;
var RETHROW_STATE = -3;
function getInternalError(state) {
return new Error('Traceur compiler bug: invalid state in state machine: ' + state);
}
function GeneratorContext() {
this.state = 0;
this.GState = ST_NEWBORN;
this.storedException = undefined;
this.finallyFallThrough = undefined;
this.sent_ = undefined;
this.returnValue = undefined;
this.tryStack_ = [];
}
GeneratorContext.prototype = {
pushTry: function(catchState, finallyState) {
if (finallyState !== null) {
var finallyFallThrough = null;
for (var i = this.tryStack_.length - 1; i >= 0; i--) {
if (this.tryStack_[i].catch !== undefined) {
finallyFallThrough = this.tryStack_[i].catch;
break;
}
}
if (finallyFallThrough === null)
finallyFallThrough = RETHROW_STATE;
this.tryStack_.push({
finally: finallyState,
finallyFallThrough: finallyFallThrough
});
}
if (catchState !== null) {
this.tryStack_.push({catch: catchState});
}
},
popTry: function() {
this.tryStack_.pop();
},
get sent() {
this.maybeThrow();
return this.sent_;
},
set sent(v) {
this.sent_ = v;
},
get sentIgnoreThrow() {
return this.sent_;
},
maybeThrow: function() {
if (this.action === 'throw') {
this.action = 'next';
throw this.sent_;
}
},
end: function() {
switch (this.state) {
case END_STATE:
return this;
case RETHROW_STATE:
throw this.storedException;
default:
throw getInternalError(this.state);
}
},
handleException: function(ex) {
this.GState = ST_CLOSED;
this.state = END_STATE;
throw ex;
}
};
function nextOrThrow(ctx, moveNext, action, x) {
switch (ctx.GState) {
case ST_EXECUTING:
throw new Error(("\"" + action + "\" on executing generator"));
case ST_CLOSED:
if (action == 'next') {
return {
value: undefined,
done: true
};
}
throw x;
case ST_NEWBORN:
if (action === 'throw') {
ctx.GState = ST_CLOSED;
throw x;
}
if (x !== undefined)
throw $TypeError('Sent value to newborn generator');
case ST_SUSPENDED:
ctx.GState = ST_EXECUTING;
ctx.action = action;
ctx.sent = x;
var value = moveNext(ctx);
var done = value === ctx;
if (done)
value = ctx.returnValue;
ctx.GState = done ? ST_CLOSED : ST_SUSPENDED;
return {
value: value,
done: done
};
}
}
var ctxName = createPrivateName();
var moveNextName = createPrivateName();
function GeneratorFunction() {}
function GeneratorFunctionPrototype() {}
GeneratorFunction.prototype = GeneratorFunctionPrototype;
$defineProperty(GeneratorFunctionPrototype, 'constructor', nonEnum(GeneratorFunction));
GeneratorFunctionPrototype.prototype = {
constructor: GeneratorFunctionPrototype,
next: function(v) {
return nextOrThrow(this[ctxName], this[moveNextName], 'next', v);
},
throw: function(v) {
return nextOrThrow(this[ctxName], this[moveNextName], 'throw', v);
}
};
$defineProperties(GeneratorFunctionPrototype.prototype, {
constructor: {enumerable: false},
next: {enumerable: false},
throw: {enumerable: false}
});
Object.defineProperty(GeneratorFunctionPrototype.prototype, Symbol.iterator, nonEnum(function() {
return this;
}));
function createGeneratorInstance(innerFunction, functionObject, self) {
var moveNext = getMoveNext(innerFunction, self);
var ctx = new GeneratorContext();
var object = $create(functionObject.prototype);
object[ctxName] = ctx;
object[moveNextName] = moveNext;
return object;
}
function initGeneratorFunction(functionObject) {
functionObject.prototype = $create(GeneratorFunctionPrototype.prototype);
functionObject.__proto__ = GeneratorFunctionPrototype;
return functionObject;
}
function AsyncFunctionContext() {
GeneratorContext.call(this);
this.err = undefined;
var ctx = this;
ctx.result = new Promise(function(resolve, reject) {
ctx.resolve = resolve;
ctx.reject = reject;
});
}
AsyncFunctionContext.prototype = $create(GeneratorContext.prototype);
AsyncFunctionContext.prototype.end = function() {
switch (this.state) {
case END_STATE:
this.resolve(this.returnValue);
break;
case RETHROW_STATE:
this.reject(this.storedException);
break;
default:
this.reject(getInternalError(this.state));
}
};
AsyncFunctionContext.prototype.handleException = function() {
this.state = RETHROW_STATE;
};
function asyncWrap(innerFunction, self) {
var moveNext = getMoveNext(innerFunction, self);
var ctx = new AsyncFunctionContext();
ctx.createCallback = function(newState) {
return function(value) {
ctx.state = newState;
ctx.value = value;
moveNext(ctx);
};
};
ctx.errback = function(err) {
handleCatch(ctx, err);
moveNext(ctx);
};
moveNext(ctx);
return ctx.result;
}
function getMoveNext(innerFunction, self) {
return function(ctx) {
while (true) {
try {
return innerFunction.call(self, ctx);
} catch (ex) {
handleCatch(ctx, ex);
}
}
};
}
function handleCatch(ctx, ex) {
ctx.storedException = ex;
var last = ctx.tryStack_[ctx.tryStack_.length - 1];
if (!last) {
ctx.handleException(ex);
return;
}
ctx.state = last.catch !== undefined ? last.catch : last.finally;
if (last.finallyFallThrough !== undefined)
ctx.finallyFallThrough = last.finallyFallThrough;
}
$traceurRuntime.asyncWrap = asyncWrap;
$traceurRuntime.initGeneratorFunction = initGeneratorFunction;
$traceurRuntime.createGeneratorInstance = createGeneratorInstance;
})();
(function() {
function buildFromEncodedParts(opt_scheme, opt_userInfo, opt_domain, opt_port, opt_path, opt_queryData, opt_fragment) {
var out = [];
if (opt_scheme) {
out.push(opt_scheme, ':');
}
if (opt_domain) {
out.push('//');
if (opt_userInfo) {
out.push(opt_userInfo, '@');
}
out.push(opt_domain);
if (opt_port) {
out.push(':', opt_port);
}
}
if (opt_path) {
out.push(opt_path);
}
if (opt_queryData) {
out.push('?', opt_queryData);
}
if (opt_fragment) {
out.push('#', opt_fragment);
}
return out.join('');
}
;
var splitRe = new RegExp('^' + '(?:' + '([^:/?#.]+)' + ':)?' + '(?://' + '(?:([^/?#]*)@)?' + '([\\w\\d\\-\\u0100-\\uffff.%]*)' + '(?::([0-9]+))?' + ')?' + '([^?#]+)?' + '(?:\\?([^#]*))?' + '(?:#(.*))?' + '$');
var ComponentIndex = {
SCHEME: 1,
USER_INFO: 2,
DOMAIN: 3,
PORT: 4,
PATH: 5,
QUERY_DATA: 6,
FRAGMENT: 7
};
function split(uri) {
return (uri.match(splitRe));
}
function removeDotSegments(path) {
if (path === '/')
return '/';
var leadingSlash = path[0] === '/' ? '/' : '';
var trailingSlash = path.slice(-1) === '/' ? '/' : '';
var segments = path.split('/');
var out = [];
var up = 0;
for (var pos = 0; pos < segments.length; pos++) {
var segment = segments[pos];
switch (segment) {
case '':
case '.':
break;
case '..':
if (out.length)
out.pop();
else
up++;
break;
default:
out.push(segment);
}
}
if (!leadingSlash) {
while (up-- > 0) {
out.unshift('..');
}
if (out.length === 0)
out.push('.');
}
return leadingSlash + out.join('/') + trailingSlash;
}
function joinAndCanonicalizePath(parts) {
var path = parts[ComponentIndex.PATH] || '';
path = removeDotSegments(path);
parts[ComponentIndex.PATH] = path;
return buildFromEncodedParts(parts[ComponentIndex.SCHEME], parts[ComponentIndex.USER_INFO], parts[ComponentIndex.DOMAIN], parts[ComponentIndex.PORT], parts[ComponentIndex.PATH], parts[ComponentIndex.QUERY_DATA], parts[ComponentIndex.FRAGMENT]);
}
function canonicalizeUrl(url) {
var parts = split(url);
return joinAndCanonicalizePath(parts);
}
function resolveUrl(base, url) {
var parts = split(url);
var baseParts = split(base);
if (parts[ComponentIndex.SCHEME]) {
return joinAndCanonicalizePath(parts);
} else {
parts[ComponentIndex.SCHEME] = baseParts[ComponentIndex.SCHEME];
}
for (var i = ComponentIndex.SCHEME; i <= ComponentIndex.PORT; i++) {
if (!parts[i]) {
parts[i] = baseParts[i];
}
}
if (parts[ComponentIndex.PATH][0] == '/') {
return joinAndCanonicalizePath(parts);
}
var path = baseParts[ComponentIndex.PATH];
var index = path.lastIndexOf('/');
path = path.slice(0, index + 1) + parts[ComponentIndex.PATH];
parts[ComponentIndex.PATH] = path;
return joinAndCanonicalizePath(parts);
}
function isAbsolute(name) {
if (!name)
return false;
if (name[0] === '/')
return true;
var parts = split(name);
if (parts[ComponentIndex.SCHEME])
return true;
return false;
}
$traceurRuntime.canonicalizeUrl = canonicalizeUrl;
$traceurRuntime.isAbsolute = isAbsolute;
$traceurRuntime.removeDotSegments = removeDotSegments;
$traceurRuntime.resolveUrl = resolveUrl;
})();
(function() {
'use strict';
var types = {
any: {name: 'any'},
boolean: {name: 'boolean'},
number: {name: 'number'},
string: {name: 'string'},
symbol: {name: 'symbol'},
void: {name: 'void'}
};
var GenericType = function GenericType(type, argumentTypes) {
this.type = type;
this.argumentTypes = argumentTypes;
};
($traceurRuntime.createClass)(GenericType, {}, {});
function genericType(type) {
for (var argumentTypes = [],
$__1 = 1; $__1 < arguments.length; $__1++)
argumentTypes[$__1 - 1] = arguments[$__1];
return new GenericType(type, argumentTypes);
}
$traceurRuntime.GenericType = GenericType;
$traceurRuntime.genericType = genericType;
$traceurRuntime.type = types;
})();
(function(global) {
'use strict';
var $__2 = $traceurRuntime,
canonicalizeUrl = $__2.canonicalizeUrl,
resolveUrl = $__2.resolveUrl,
isAbsolute = $__2.isAbsolute;
var moduleInstantiators = Object.create(null);
var baseURL;
if (global.location && global.location.href)
baseURL = resolveUrl(global.location.href, './');
else
baseURL = '';
var UncoatedModuleEntry = function UncoatedModuleEntry(url, uncoatedModule) {
this.url = url;
this.value_ = uncoatedModule;
};
($traceurRuntime.createClass)(UncoatedModuleEntry, {}, {});
var ModuleEvaluationError = function ModuleEvaluationError(erroneousModuleName, cause) {
this.message = this.constructor.name + ': ' + this.stripCause(cause) + ' in ' + erroneousModuleName;
if (!(cause instanceof $ModuleEvaluationError) && cause.stack)
this.stack = this.stripStack(cause.stack);
else
this.stack = '';
};
var $ModuleEvaluationError = ModuleEvaluationError;
($traceurRuntime.createClass)(ModuleEvaluationError, {
stripError: function(message) {
return message.replace(/.*Error:/, this.constructor.name + ':');
},
stripCause: function(cause) {
if (!cause)
return '';
if (!cause.message)
return cause + '';
return this.stripError(cause.message);
},
loadedBy: function(moduleName) {
this.stack += '\n loaded by ' + moduleName;
},
stripStack: function(causeStack) {
var stack = [];
causeStack.split('\n').some((function(frame) {
if (/UncoatedModuleInstantiator/.test(frame))
return true;
stack.push(frame);
}));
stack[0] = this.stripError(stack[0]);
return stack.join('\n');
}
}, {}, Error);
var UncoatedModuleInstantiator = function UncoatedModuleInstantiator(url, func) {
$traceurRuntime.superConstructor($UncoatedModuleInstantiator).call(this, url, null);
this.func = func;
};
var $UncoatedModuleInstantiator = UncoatedModuleInstantiator;
($traceurRuntime.createClass)(UncoatedModuleInstantiator, {getUncoatedModule: function() {
if (this.value_)
return this.value_;
try {
return this.value_ = this.func.call(global);
} catch (ex) {
if (ex instanceof ModuleEvaluationError) {
ex.loadedBy(this.url);
throw ex;
}
throw new ModuleEvaluationError(this.url, ex);
}
}}, {}, UncoatedModuleEntry);
function getUncoatedModuleInstantiator(name) {
if (!name)
return;
var url = ModuleStore.normalize(name);
return moduleInstantiators[url];
}
;
var moduleInstances = Object.create(null);
var liveModuleSentinel = {};
function Module(uncoatedModule) {
var isLive = arguments[1];
var coatedModule = Object.create(null);
Object.getOwnPropertyNames(uncoatedModule).forEach((function(name) {
var getter,
value;
if (isLive === liveModuleSentinel) {
var descr = Object.getOwnPropertyDescriptor(uncoatedModule, name);
if (descr.get)
getter = descr.get;
}
if (!getter) {
value = uncoatedModule[name];
getter = function() {
return value;
};
}
Object.defineProperty(coatedModule, name, {
get: getter,
enumerable: true
});
}));
Object.preventExtensions(coatedModule);
return coatedModule;
}
var ModuleStore = {
normalize: function(name, refererName, refererAddress) {
if (typeof name !== "string")
throw new TypeError("module name must be a string, not " + typeof name);
if (isAbsolute(name))
return canonicalizeUrl(name);
if (/[^\.]\/\.\.\//.test(name)) {
throw new Error('module name embeds /../: ' + name);
}
if (name[0] === '.' && refererName)
return resolveUrl(refererName, name);
return canonicalizeUrl(name);
},
get: function(normalizedName) {
var m = getUncoatedModuleInstantiator(normalizedName);
if (!m)
return undefined;
var moduleInstance = moduleInstances[m.url];
if (moduleInstance)
return moduleInstance;
moduleInstance = Module(m.getUncoatedModule(), liveModuleSentinel);
return moduleInstances[m.url] = moduleInstance;
},
set: function(normalizedName, module) {
normalizedName = String(normalizedName);
moduleInstantiators[normalizedName] = new UncoatedModuleInstantiator(normalizedName, (function() {
return module;
}));
moduleInstances[normalizedName] = module;
},
get baseURL() {
return baseURL;
},
set baseURL(v) {
baseURL = String(v);
},
registerModule: function(name, func) {
var normalizedName = ModuleStore.normalize(name);
if (moduleInstantiators[normalizedName])
throw new Error('duplicate module named ' + normalizedName);
moduleInstantiators[normalizedName] = new UncoatedModuleInstantiator(normalizedName, func);
},
bundleStore: Object.create(null),
register: function(name, deps, func) {
if (!deps || !deps.length && !func.length) {
this.registerModule(name, func);
} else {
this.bundleStore[name] = {
deps: deps,
execute: function() {
var $__0 = arguments;
var depMap = {};
deps.forEach((function(dep, index) {
return depMap[dep] = $__0[index];
}));
var registryEntry = func.call(this, depMap);
registryEntry.execute.call(this);
return registryEntry.exports;
}
};
}
},
getAnonymousModule: function(func) {
return new Module(func.call(global), liveModuleSentinel);
},
getForTesting: function(name) {
var $__0 = this;
if (!this.testingPrefix_) {
Object.keys(moduleInstances).some((function(key) {
var m = /(traceur@[^\/]*\/)/.exec(key);
if (m) {
$__0.testingPrefix_ = m[1];
return true;
}
}));
}
return this.get(this.testingPrefix_ + name);
}
};
ModuleStore.set('@traceur/src/runtime/ModuleStore', new Module({ModuleStore: ModuleStore}));
var setupGlobals = $traceurRuntime.setupGlobals;
$traceurRuntime.setupGlobals = function(global) {
setupGlobals(global);
};
$traceurRuntime.ModuleStore = ModuleStore;
global.System = {
register: ModuleStore.register.bind(ModuleStore),
get: ModuleStore.get,
set: ModuleStore.set,
normalize: ModuleStore.normalize
};
$traceurRuntime.getModuleImpl = function(name) {
var instantiator = getUncoatedModuleInstantiator(name);
return instantiator && instantiator.getUncoatedModule();
};
})(typeof global !== 'undefined' ? global : this);
System.register("traceur@0.0.74/src/runtime/polyfills/utils", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/runtime/polyfills/utils";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/runtime/polyfills/utils", path);
}
var $ceil = Math.ceil;
var $floor = Math.floor;
var $isFinite = isFinite;
var $isNaN = isNaN;
var $pow = Math.pow;
var $min = Math.min;
var toObject = $traceurRuntime.toObject;
function toUint32(x) {
return x >>> 0;
}
function isObject(x) {
return x && (typeof x === 'object' || typeof x === 'function');
}
function isCallable(x) {
return typeof x === 'function';
}
function isNumber(x) {
return typeof x === 'number';
}
function toInteger(x) {
x = +x;
if ($isNaN(x))
return 0;
if (x === 0 || !$isFinite(x))
return x;
return x > 0 ? $floor(x) : $ceil(x);
}
var MAX_SAFE_LENGTH = $pow(2, 53) - 1;
function toLength(x) {
var len = toInteger(x);
return len < 0 ? 0 : $min(len, MAX_SAFE_LENGTH);
}
function checkIterable(x) {
return !isObject(x) ? undefined : x[Symbol.iterator];
}
function isConstructor(x) {
return isCallable(x);
}
function createIteratorResultObject(value, done) {
return {
value: value,
done: done
};
}
function maybeDefine(object, name, descr) {
if (!(name in object)) {
Object.defineProperty(object, name, descr);
}
}
function maybeDefineMethod(object, name, value) {
maybeDefine(object, name, {
value: value,
configurable: true,
enumerable: false,
writable: true
});
}
function maybeDefineConst(object, name, value) {
maybeDefine(object, name, {
value: value,
configurable: false,
enumerable: false,
writable: false
});
}
function maybeAddFunctions(object, functions) {
for (var i = 0; i < functions.length; i += 2) {
var name = functions[i];
var value = functions[i + 1];
maybeDefineMethod(object, name, value);
}
}
function maybeAddConsts(object, consts) {
for (var i = 0; i < consts.length; i += 2) {
var name = consts[i];
var value = consts[i + 1];
maybeDefineConst(object, name, value);
}
}
function maybeAddIterator(object, func, Symbol) {
if (!Symbol || !Symbol.iterator || object[Symbol.iterator])
return;
if (object['@@iterator'])
func = object['@@iterator'];
Object.defineProperty(object, Symbol.iterator, {
value: func,
configurable: true,
enumerable: false,
writable: true
});
}
var polyfills = [];
function registerPolyfill(func) {
polyfills.push(func);
}
function polyfillAll(global) {
polyfills.forEach((function(f) {
return f(global);
}));
}
return {
get toObject() {
return toObject;
},
get toUint32() {
return toUint32;
},
get isObject() {
return isObject;
},
get isCallable() {
return isCallable;
},
get isNumber() {
return isNumber;
},
get toInteger() {
return toInteger;
},
get toLength() {
return toLength;
},
get checkIterable() {
return checkIterable;
},
get isConstructor() {
return isConstructor;
},
get createIteratorResultObject() {
return createIteratorResultObject;
},
get maybeDefine() {
return maybeDefine;
},
get maybeDefineMethod() {
return maybeDefineMethod;
},
get maybeDefineConst() {
return maybeDefineConst;
},
get maybeAddFunctions() {
return maybeAddFunctions;
},
get maybeAddConsts() {
return maybeAddConsts;
},
get maybeAddIterator() {
return maybeAddIterator;
},
get registerPolyfill() {
return registerPolyfill;
},
get polyfillAll() {
return polyfillAll;
}
};
});
System.register("traceur@0.0.74/src/runtime/polyfills/Map", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/runtime/polyfills/Map";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/runtime/polyfills/Map", path);
}
var $__0 = System.get("traceur@0.0.74/src/runtime/polyfills/utils"),
isObject = $__0.isObject,
maybeAddIterator = $__0.maybeAddIterator,
registerPolyfill = $__0.registerPolyfill;
var getOwnHashObject = $traceurRuntime.getOwnHashObject;
var $hasOwnProperty = Object.prototype.hasOwnProperty;
var deletedSentinel = {};
function lookupIndex(map, key) {
if (isObject(key)) {
var hashObject = getOwnHashObject(key);
return hashObject && map.objectIndex_[hashObject.hash];
}
if (typeof key === 'string')
return map.stringIndex_[key];
return map.primitiveIndex_[key];
}
function initMap(map) {
map.entries_ = [];
map.objectIndex_ = Object.create(null);
map.stringIndex_ = Object.create(null);
map.primitiveIndex_ = Object.create(null);
map.deletedCount_ = 0;
}
var Map = function Map() {
var iterable = arguments[0];
if (!isObject(this))
throw new TypeError('Map called on incompatible type');
if ($hasOwnProperty.call(this, 'entries_')) {
throw new TypeError('Map can not be reentrantly initialised');
}
initMap(this);
if (iterable !== null && iterable !== undefined) {
for (var $__2 = iterable[$traceurRuntime.toProperty(Symbol.iterator)](),
$__3; !($__3 = $__2.next()).done; ) {
var $__4 = $__3.value,
key = $__4[0],
value = $__4[1];
{
this.set(key, value);
}
}
}
};
($traceurRuntime.createClass)(Map, {
get size() {
return this.entries_.length / 2 - this.deletedCount_;
},
get: function(key) {
var index = lookupIndex(this, key);
if (index !== undefined)
return this.entries_[index + 1];
},
set: function(key, value) {
var objectMode = isObject(key);
var stringMode = typeof key === 'string';
var index = lookupIndex(this, key);
if (index !== undefined) {
this.entries_[index + 1] = value;
} else {
index = this.entries_.length;
this.entries_[index] = key;
this.entries_[index + 1] = value;
if (objectMode) {
var hashObject = getOwnHashObject(key);
var hash = hashObject.hash;
this.objectIndex_[hash] = index;
} else if (stringMode) {
this.stringIndex_[key] = index;
} else {
this.primitiveIndex_[key] = index;
}
}
return this;
},
has: function(key) {
return lookupIndex(this, key) !== undefined;
},
delete: function(key) {
var objectMode = isObject(key);
var stringMode = typeof key === 'string';
var index;
var hash;
if (objectMode) {
var hashObject = getOwnHashObject(key);
if (hashObject) {
index = this.objectIndex_[hash = hashObject.hash];
delete this.objectIndex_[hash];
}
} else if (stringMode) {
index = this.stringIndex_[key];
delete this.stringIndex_[key];
} else {
index = this.primitiveIndex_[key];
delete this.primitiveIndex_[key];
}
if (index !== undefined) {
this.entries_[index] = deletedSentinel;
this.entries_[index + 1] = undefined;
this.deletedCount_++;
return true;
}
return false;
},
clear: function() {
initMap(this);
},
forEach: function(callbackFn) {
var thisArg = arguments[1];
for (var i = 0; i < this.entries_.length; i += 2) {
var key = this.entries_[i];
var value = this.entries_[i + 1];
if (key === deletedSentinel)
continue;
callbackFn.call(thisArg, value, key, this);
}
},
entries: $traceurRuntime.initGeneratorFunction(function $__5() {
var i,
key,
value;
return $traceurRuntime.createGeneratorInstance(function($ctx) {
while (true)
switch ($ctx.state) {
case 0:
i = 0;
$ctx.state = 12;
break;
case 12:
$ctx.state = (i < this.entries_.length) ? 8 : -2;
break;
case 4:
i += 2;
$ctx.state = 12;
break;
case 8:
key = this.entries_[i];
value = this.entries_[i + 1];
$ctx.state = 9;
break;
case 9:
$ctx.state = (key === deletedSentinel) ? 4 : 6;
break;
case 6:
$ctx.state = 2;
return [key, value];
case 2:
$ctx.maybeThrow();
$ctx.state = 4;
break;
default:
return $ctx.end();
}
}, $__5, this);
}),
keys: $traceurRuntime.initGeneratorFunction(function $__6() {
var i,
key,
value;
return $traceurRuntime.createGeneratorInstance(function($ctx) {
while (true)
switch ($ctx.state) {
case 0:
i = 0;
$ctx.state = 12;
break;
case 12:
$ctx.state = (i < this.entries_.length) ? 8 : -2;
break;
case 4:
i += 2;
$ctx.state = 12;
break;
case 8:
key = this.entries_[i];
value = this.entries_[i + 1];
$ctx.state = 9;
break;
case 9:
$ctx.state = (key === deletedSentinel) ? 4 : 6;
break;
case 6:
$ctx.state = 2;
return key;
case 2:
$ctx.maybeThrow();
$ctx.state = 4;
break;
default:
return $ctx.end();
}
}, $__6, this);
}),
values: $traceurRuntime.initGeneratorFunction(function $__7() {
var i,
key,
value;
return $traceurRuntime.createGeneratorInstance(function($ctx) {
while (true)
switch ($ctx.state) {
case 0:
i = 0;
$ctx.state = 12;
break;
case 12:
$ctx.state = (i < this.entries_.length) ? 8 : -2;
break;
case 4:
i += 2;
$ctx.state = 12;
break;
case 8:
key = this.entries_[i];
value = this.entries_[i + 1];
$ctx.state = 9;
break;
case 9:
$ctx.state = (key === deletedSentinel) ? 4 : 6;
break;
case 6:
$ctx.state = 2;
return value;
case 2:
$ctx.maybeThrow();
$ctx.state = 4;
break;
default:
return $ctx.end();
}
}, $__7, this);
})
}, {});
Object.defineProperty(Map.prototype, Symbol.iterator, {
configurable: true,
writable: true,
value: Map.prototype.entries
});
function polyfillMap(global) {
var $__4 = global,
Object = $__4.Object,
Symbol = $__4.Symbol;
if (!global.Map)
global.Map = Map;
var mapPrototype = global.Map.prototype;
if (mapPrototype.entries === undefined)
global.Map = Map;
if (mapPrototype.entries) {
maybeAddIterator(mapPrototype, mapPrototype.entries, Symbol);
maybeAddIterator(Object.getPrototypeOf(new global.Map().entries()), function() {
return this;
}, Symbol);
}
}
registerPolyfill(polyfillMap);
return {
get Map() {
return Map;
},
get polyfillMap() {
return polyfillMap;
}
};
});
System.get("traceur@0.0.74/src/runtime/polyfills/Map" + '');
System.register("traceur@0.0.74/src/runtime/polyfills/Set", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/runtime/polyfills/Set";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/runtime/polyfills/Set", path);
}
var $__0 = System.get("traceur@0.0.74/src/runtime/polyfills/utils"),
isObject = $__0.isObject,
maybeAddIterator = $__0.maybeAddIterator,
registerPolyfill = $__0.registerPolyfill;
var Map = System.get("traceur@0.0.74/src/runtime/polyfills/Map").Map;
var getOwnHashObject = $traceurRuntime.getOwnHashObject;
var $hasOwnProperty = Object.prototype.hasOwnProperty;
function initSet(set) {
set.map_ = new Map();
}
var Set = function Set() {
var iterable = arguments[0];
if (!isObject(this))
throw new TypeError('Set called on incompatible type');
if ($hasOwnProperty.call(this, 'map_')) {
throw new TypeError('Set can not be reentrantly initialised');
}
initSet(this);
if (iterable !== null && iterable !== undefined) {
for (var $__4 = iterable[$traceurRuntime.toProperty(Symbol.iterator)](),
$__5; !($__5 = $__4.next()).done; ) {
var item = $__5.value;
{
this.add(item);
}
}
}
};
($traceurRuntime.createClass)(Set, {
get size() {
return this.map_.size;
},
has: function(key) {
return this.map_.has(key);
},
add: function(key) {
this.map_.set(key, key);
return this;
},
delete: function(key) {
return this.map_.delete(key);
},
clear: function() {
return this.map_.clear();
},
forEach: function(callbackFn) {
var thisArg = arguments[1];
var $__2 = this;
return this.map_.forEach((function(value, key) {
callbackFn.call(thisArg, key, key, $__2);
}));
},
values: $traceurRuntime.initGeneratorFunction(function $__7() {
var $__8,
$__9;
return $traceurRuntime.createGeneratorInstance(function($ctx) {
while (true)
switch ($ctx.state) {
case 0:
$__8 = this.map_.keys()[Symbol.iterator]();
$ctx.sent = void 0;
$ctx.action = 'next';
$ctx.state = 12;
break;
case 12:
$__9 = $__8[$ctx.action]($ctx.sentIgnoreThrow);
$ctx.state = 9;
break;
case 9:
$ctx.state = ($__9.done) ? 3 : 2;
break;
case 3:
$ctx.sent = $__9.value;
$ctx.state = -2;
break;
case 2:
$ctx.state = 12;
return $__9.value;
default:
return $ctx.end();
}
}, $__7, this);
}),
entries: $traceurRuntime.initGeneratorFunction(function $__10() {
var $__11,
$__12;
return $traceurRuntime.createGeneratorInstance(function($ctx) {
while (true)
switch ($ctx.state) {
case 0:
$__11 = this.map_.entries()[Symbol.iterator]();
$ctx.sent = void 0;
$ctx.action = 'next';
$ctx.state = 12;
break;
case 12:
$__12 = $__11[$ctx.action]($ctx.sentIgnoreThrow);
$ctx.state = 9;
break;
case 9:
$ctx.state = ($__12.done) ? 3 : 2;
break;
case 3:
$ctx.sent = $__12.value;
$ctx.state = -2;
break;
case 2:
$ctx.state = 12;
return $__12.value;
default:
return $ctx.end();
}
}, $__10, this);
})
}, {});
Object.defineProperty(Set.prototype, Symbol.iterator, {
configurable: true,
writable: true,
value: Set.prototype.values
});
Object.defineProperty(Set.prototype, 'keys', {
configurable: true,
writable: true,
value: Set.prototype.values
});
function polyfillSet(global) {
var $__6 = global,
Object = $__6.Object,
Symbol = $__6.Symbol;
if (!global.Set)
global.Set = Set;
var setPrototype = global.Set.prototype;
if (setPrototype.values) {
maybeAddIterator(setPrototype, setPrototype.values, Symbol);
maybeAddIterator(Object.getPrototypeOf(new global.Set().values()), function() {
return this;
}, Symbol);
}
}
registerPolyfill(polyfillSet);
return {
get Set() {
return Set;
},
get polyfillSet() {
return polyfillSet;
}
};
});
System.get("traceur@0.0.74/src/runtime/polyfills/Set" + '');
System.register("traceur@0.0.74/node_modules/rsvp/lib/rsvp/asap", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/node_modules/rsvp/lib/rsvp/asap";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/node_modules/rsvp/lib/rsvp/asap", path);
}
var len = 0;
function asap(callback, arg) {
queue[len] = callback;
queue[len + 1] = arg;
len += 2;
if (len === 2) {
scheduleFlush();
}
}
var $__default = asap;
var browserGlobal = (typeof window !== 'undefined') ? window : {};
var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined';
function useNextTick() {
return function() {
process.nextTick(flush);
};
}
function useMutationObserver() {
var iterations = 0;
var observer = new BrowserMutationObserver(flush);
var node = document.createTextNode('');
observer.observe(node, {characterData: true});
return function() {
node.data = (iterations = ++iterations % 2);
};
}
function useMessageChannel() {
var channel = new MessageChannel();
channel.port1.onmessage = flush;
return function() {
channel.port2.postMessage(0);
};
}
function useSetTimeout() {
return function() {
setTimeout(flush, 1);
};
}
var queue = new Array(1000);
function flush() {
for (var i = 0; i < len; i += 2) {
var callback = queue[i];
var arg = queue[i + 1];
callback(arg);
queue[i] = undefined;
queue[i + 1] = undefined;
}
len = 0;
}
var scheduleFlush;
if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') {
scheduleFlush = useNextTick();
} else if (BrowserMutationObserver) {
scheduleFlush = useMutationObserver();
} else if (isWorker) {
scheduleFlush = useMessageChannel();
} else {
scheduleFlush = useSetTimeout();
}
return {get default() {
return $__default;
}};
});
System.register("traceur@0.0.74/src/runtime/polyfills/Promise", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/runtime/polyfills/Promise";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/runtime/polyfills/Promise", path);
}
var async = System.get("traceur@0.0.74/node_modules/rsvp/lib/rsvp/asap").default;
var registerPolyfill = System.get("traceur@0.0.74/src/runtime/polyfills/utils").registerPolyfill;
var promiseRaw = {};
function isPromise(x) {
return x && typeof x === 'object' && x.status_ !== undefined;
}
function idResolveHandler(x) {
return x;
}
function idRejectHandler(x) {
throw x;
}
function chain(promise) {
var onResolve = arguments[1] !== (void 0) ? arguments[1] : idResolveHandler;
var onReject = arguments[2] !== (void 0) ? arguments[2] : idRejectHandler;
var deferred = getDeferred(promise.constructor);
switch (promise.status_) {
case undefined:
throw TypeError;
case 0:
promise.onResolve_.push(onResolve, deferred);
promise.onReject_.push(onReject, deferred);
break;
case +1:
promiseEnqueue(promise.value_, [onResolve, deferred]);
break;
case -1:
promiseEnqueue(promise.value_, [onReject, deferred]);
break;
}
return deferred.promise;
}
function getDeferred(C) {
if (this === $Promise) {
var promise = promiseInit(new $Promise(promiseRaw));
return {
promise: promise,
resolve: (function(x) {
promiseResolve(promise, x);
}),
reject: (function(r) {
promiseReject(promise, r);
})
};
} else {
var result = {};
result.promise = new C((function(resolve, reject) {
result.resolve = resolve;
result.reject = reject;
}));
return result;
}
}
function promiseSet(promise, status, value, onResolve, onReject) {
promise.status_ = status;
promise.value_ = value;
promise.onResolve_ = onResolve;
promise.onReject_ = onReject;
return promise;
}
function promiseInit(promise) {
return promiseSet(promise, 0, undefined, [], []);
}
var Promise = function Promise(resolver) {
if (resolver === promiseRaw)
return;
if (typeof resolver !== 'function')
throw new TypeError;
var promise = promiseInit(this);
try {
resolver((function(x) {
promiseResolve(promise, x);
}), (function(r) {
promiseReject(promise, r);
}));
} catch (e) {
promiseReject(promise, e);
}
};
($traceurRuntime.createClass)(Promise, {
catch: function(onReject) {
return this.then(undefined, onReject);
},
then: function(onResolve, onReject) {
if (typeof onResolve !== 'function')
onResolve = idResolveHandler;
if (typeof onReject !== 'function')
onReject = idRejectHandler;
var that = this;
var constructor = this.constructor;
return chain(this, function(x) {
x = promiseCoerce(constructor, x);
return x === that ? onReject(new TypeError) : isPromise(x) ? x.then(onResolve, onReject) : onResolve(x);
}, onReject);
}
}, {
resolve: function(x) {
if (this === $Promise) {
if (isPromise(x)) {
return x;
}
return promiseSet(new $Promise(promiseRaw), +1, x);
} else {
return new this(function(resolve, reject) {
resolve(x);
});
}
},
reject: function(r) {
if (this === $Promise) {
return promiseSet(new $Promise(promiseRaw), -1, r);
} else {
return new this((function(resolve, reject) {
reject(r);
}));
}
},
all: function(values) {
var deferred = getDeferred(this);
var resolutions = [];
try {
var count = values.length;
if (count === 0) {
deferred.resolve(resolutions);
} else {
for (var i = 0; i < values.length; i++) {
this.resolve(values[i]).then(function(i, x) {
resolutions[i] = x;
if (--count === 0)
deferred.resolve(resolutions);
}.bind(undefined, i), (function(r) {
deferred.reject(r);
}));
}
}
} catch (e) {
deferred.reject(e);
}
return deferred.promise;
},
race: function(values) {
var deferred = getDeferred(this);
try {
for (var i = 0; i < values.length; i++) {
this.resolve(values[i]).then((function(x) {
deferred.resolve(x);
}), (function(r) {
deferred.reject(r);
}));
}
} catch (e) {
deferred.reject(e);
}
return deferred.promise;
}
});
var $Promise = Promise;
var $PromiseReject = $Promise.reject;
function promiseResolve(promise, x) {
promiseDone(promise, +1, x, promise.onResolve_);
}
function promiseReject(promise, r) {
promiseDone(promise, -1, r, promise.onReject_);
}
function promiseDone(promise, status, value, reactions) {
if (promise.status_ !== 0)
return;
promiseEnqueue(value, reactions);
promiseSet(promise, status, value);
}
function promiseEnqueue(value, tasks) {
async((function() {
for (var i = 0; i < tasks.length; i += 2) {
promiseHandle(value, tasks[i], tasks[i + 1]);
}
}));
}
function promiseHandle(value, handler, deferred) {
try {
var result = handler(value);
if (result === deferred.promise)
throw new TypeError;
else if (isPromise(result))
chain(result, deferred.resolve, deferred.reject);
else
deferred.resolve(result);
} catch (e) {
try {
deferred.reject(e);
} catch (e) {}
}
}
var thenableSymbol = '@@thenable';
function isObject(x) {
return x && (typeof x === 'object' || typeof x === 'function');
}
function promiseCoerce(constructor, x) {
if (!isPromise(x) && isObject(x)) {
var then;
try {
then = x.then;
} catch (r) {
var promise = $PromiseReject.call(constructor, r);
x[thenableSymbol] = promise;
return promise;
}
if (typeof then === 'function') {
var p = x[thenableSymbol];
if (p) {
return p;
} else {
var deferred = getDeferred(constructor);
x[thenableSymbol] = deferred.promise;
try {
then.call(x, deferred.resolve, deferred.reject);
} catch (r) {
deferred.reject(r);
}
return deferred.promise;
}
}
}
return x;
}
function polyfillPromise(global) {
if (!global.Promise)
global.Promise = Promise;
}
registerPolyfill(polyfillPromise);
return {
get Promise() {
return Promise;
},
get polyfillPromise() {
return polyfillPromise;
}
};
});
System.get("traceur@0.0.74/src/runtime/polyfills/Promise" + '');
System.register("traceur@0.0.74/src/runtime/polyfills/StringIterator", [], function() {
"use strict";
var $__2;
var __moduleName = "traceur@0.0.74/src/runtime/polyfills/StringIterator";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/runtime/polyfills/StringIterator", path);
}
var $__0 = System.get("traceur@0.0.74/src/runtime/polyfills/utils"),
createIteratorResultObject = $__0.createIteratorResultObject,
isObject = $__0.isObject;
var toProperty = $traceurRuntime.toProperty;
var hasOwnProperty = Object.prototype.hasOwnProperty;
var iteratedString = Symbol('iteratedString');
var stringIteratorNextIndex = Symbol('stringIteratorNextIndex');
var StringIterator = function StringIterator() {};
($traceurRuntime.createClass)(StringIterator, ($__2 = {}, Object.defineProperty($__2, "next", {
value: function() {
var o = this;
if (!isObject(o) || !hasOwnProperty.call(o, iteratedString)) {
throw new TypeError('this must be a StringIterator object');
}
var s = o[toProperty(iteratedString)];
if (s === undefined) {
return createIteratorResultObject(undefined, true);
}
var position = o[toProperty(stringIteratorNextIndex)];
var len = s.length;
if (position >= len) {
o[toProperty(iteratedString)] = undefined;
return createIteratorResultObject(undefined, true);
}
var first = s.charCodeAt(position);
var resultString;
if (first < 0xD800 || first > 0xDBFF || position + 1 === len) {
resultString = String.fromCharCode(first);
} else {
var second = s.charCodeAt(position + 1);
if (second < 0xDC00 || second > 0xDFFF) {
resultString = String.fromCharCode(first);
} else {
resultString = String.fromCharCode(first) + String.fromCharCode(second);
}
}
o[toProperty(stringIteratorNextIndex)] = position + resultString.length;
return createIteratorResultObject(resultString, false);
},
configurable: true,
enumerable: true,
writable: true
}), Object.defineProperty($__2, Symbol.iterator, {
value: function() {
return this;
},
configurable: true,
enumerable: true,
writable: true
}), $__2), {});
function createStringIterator(string) {
var s = String(string);
var iterator = Object.create(StringIterator.prototype);
iterator[toProperty(iteratedString)] = s;
iterator[toProperty(stringIteratorNextIndex)] = 0;
return iterator;
}
return {get createStringIterator() {
return createStringIterator;
}};
});
System.register("traceur@0.0.74/src/runtime/polyfills/String", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/runtime/polyfills/String";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/runtime/polyfills/String", path);
}
var createStringIterator = System.get("traceur@0.0.74/src/runtime/polyfills/StringIterator").createStringIterator;
var $__1 = System.get("traceur@0.0.74/src/runtime/polyfills/utils"),
maybeAddFunctions = $__1.maybeAddFunctions,
maybeAddIterator = $__1.maybeAddIterator,
registerPolyfill = $__1.registerPolyfill;
var $toString = Object.prototype.toString;
var $indexOf = String.prototype.indexOf;
var $lastIndexOf = String.prototype.lastIndexOf;
function startsWith(search) {
var string = String(this);
if (this == null || $toString.call(search) == '[object RegExp]') {
throw TypeError();
}
var stringLength = string.length;
var searchString = String(search);
var searchLength = searchString.length;
var position = arguments.length > 1 ? arguments[1] : undefined;
var pos = position ? Number(position) : 0;
if (isNaN(pos)) {
pos = 0;
}
var start = Math.min(Math.max(pos, 0), stringLength);
return $indexOf.call(string, searchString, pos) == start;
}
function endsWith(search) {
var string = String(this);
if (this == null || $toString.call(search) == '[object RegExp]') {
throw TypeError();
}
var stringLength = string.length;
var searchString = String(search);
var searchLength = searchString.length;
var pos = stringLength;
if (arguments.length > 1) {
var position = arguments[1];
if (position !== undefined) {
pos = position ? Number(position) : 0;
if (isNaN(pos)) {
pos = 0;
}
}
}
var end = Math.min(Math.max(pos, 0), stringLength);
var start = end - searchLength;
if (start < 0) {
return false;
}
return $lastIndexOf.call(string, searchString, start) == start;
}
function contains(search) {
if (this == null) {
throw TypeError();
}
var string = String(this);
var stringLength = string.length;
var searchString = String(search);
var searchLength = searchString.length;
var position = arguments.length > 1 ? arguments[1] : undefined;
var pos = position ? Number(position) : 0;
if (isNaN(pos)) {
pos = 0;
}
var start = Math.min(Math.max(pos, 0), stringLength);
return $indexOf.call(string, searchString, pos) != -1;
}
function repeat(count) {
if (this == null) {
throw TypeError();
}
var string = String(this);
var n = count ? Number(count) : 0;
if (isNaN(n)) {
n = 0;
}
if (n < 0 || n == Infinity) {
throw RangeError();
}
if (n == 0) {
return '';
}
var result = '';
while (n--) {
result += string;
}
return result;
}
function codePointAt(position) {
if (this == null) {
throw TypeError();
}
var string = String(this);
var size = string.length;
var index = position ? Number(position) : 0;
if (isNaN(index)) {
index = 0;
}
if (index < 0 || index >= size) {
return undefined;
}
var first = string.charCodeAt(index);
var second;
if (first >= 0xD800 && first <= 0xDBFF && size > index + 1) {
second = string.charCodeAt(index + 1);
if (second >= 0xDC00 && second <= 0xDFFF) {
return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
}
}
return first;
}
function raw(callsite) {
var raw = callsite.raw;
var len = raw.length >>> 0;
if (len === 0)
return '';
var s = '';
var i = 0;
while (true) {
s += raw[i];
if (i + 1 === len)
return s;
s += arguments[++i];
}
}
function fromCodePoint() {
var codeUnits = [];
var floor = Math.floor;
var highSurrogate;
var lowSurrogate;
var index = -1;
var length = arguments.length;
if (!length) {
return '';
}
while (++index < length) {
var codePoint = Number(arguments[index]);
if (!isFinite(codePoint) || codePoint < 0 || codePoint > 0x10FFFF || floor(codePoint) != codePoint) {
throw RangeError('Invalid code point: ' + codePoint);
}
if (codePoint <= 0xFFFF) {
codeUnits.push(codePoint);
} else {
codePoint -= 0x10000;
highSurrogate = (codePoint >> 10) + 0xD800;
lowSurrogate = (codePoint % 0x400) + 0xDC00;
codeUnits.push(highSurrogate, lowSurrogate);
}
}
return String.fromCharCode.apply(null, codeUnits);
}
function stringPrototypeIterator() {
var o = $traceurRuntime.checkObjectCoercible(this);
var s = String(o);
return createStringIterator(s);
}
function polyfillString(global) {
var String = global.String;
maybeAddFunctions(String.prototype, ['codePointAt', codePointAt, 'contains', contains, 'endsWith', endsWith, 'startsWith', startsWith, 'repeat', repeat]);
maybeAddFunctions(String, ['fromCodePoint', fromCodePoint, 'raw', raw]);
maybeAddIterator(String.prototype, stringPrototypeIterator, Symbol);
}
registerPolyfill(polyfillString);
return {
get startsWith() {
return startsWith;
},
get endsWith() {
return endsWith;
},
get contains() {
return contains;
},
get repeat() {
return repeat;
},
get codePointAt() {
return codePointAt;
},
get raw() {
return raw;
},
get fromCodePoint() {
return fromCodePoint;
},
get stringPrototypeIterator() {
return stringPrototypeIterator;
},
get polyfillString() {
return polyfillString;
}
};
});
System.get("traceur@0.0.74/src/runtime/polyfills/String" + '');
System.register("traceur@0.0.74/src/runtime/polyfills/ArrayIterator", [], function() {
"use strict";
var $__2;
var __moduleName = "traceur@0.0.74/src/runtime/polyfills/ArrayIterator";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/runtime/polyfills/ArrayIterator", path);
}
var $__0 = System.get("traceur@0.0.74/src/runtime/polyfills/utils"),
toObject = $__0.toObject,
toUint32 = $__0.toUint32,
createIteratorResultObject = $__0.createIteratorResultObject;
var ARRAY_ITERATOR_KIND_KEYS = 1;
var ARRAY_ITERATOR_KIND_VALUES = 2;
var ARRAY_ITERATOR_KIND_ENTRIES = 3;
var ArrayIterator = function ArrayIterator() {};
($traceurRuntime.createClass)(ArrayIterator, ($__2 = {}, Object.defineProperty($__2, "next", {
value: function() {
var iterator = toObject(this);
var array = iterator.iteratorObject_;
if (!array) {
throw new TypeError('Object is not an ArrayIterator');
}
var index = iterator.arrayIteratorNextIndex_;
var itemKind = iterator.arrayIterationKind_;
var length = toUint32(array.length);
if (index >= length) {
iterator.arrayIteratorNextIndex_ = Infinity;
return createIteratorResultObject(undefined, true);
}
iterator.arrayIteratorNextIndex_ = index + 1;
if (itemKind == ARRAY_ITERATOR_KIND_VALUES)
return createIteratorResultObject(array[index], false);
if (itemKind == ARRAY_ITERATOR_KIND_ENTRIES)
return createIteratorResultObject([index, array[index]], false);
return createIteratorResultObject(index, false);
},
configurable: true,
enumerable: true,
writable: true
}), Object.defineProperty($__2, Symbol.iterator, {
value: function() {
return this;
},
configurable: true,
enumerable: true,
writable: true
}), $__2), {});
function createArrayIterator(array, kind) {
var object = toObject(array);
var iterator = new ArrayIterator;
iterator.iteratorObject_ = object;
iterator.arrayIteratorNextIndex_ = 0;
iterator.arrayIterationKind_ = kind;
return iterator;
}
function entries() {
return createArrayIterator(this, ARRAY_ITERATOR_KIND_ENTRIES);
}
function keys() {
return createArrayIterator(this, ARRAY_ITERATOR_KIND_KEYS);
}
function values() {
return createArrayIterator(this, ARRAY_ITERATOR_KIND_VALUES);
}
return {
get entries() {
return entries;
},
get keys() {
return keys;
},
get values() {
return values;
}
};
});
System.register("traceur@0.0.74/src/runtime/polyfills/Array", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/runtime/polyfills/Array";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/runtime/polyfills/Array", path);
}
var $__0 = System.get("traceur@0.0.74/src/runtime/polyfills/ArrayIterator"),
entries = $__0.entries,
keys = $__0.keys,
values = $__0.values;
var $__1 = System.get("traceur@0.0.74/src/runtime/polyfills/utils"),
checkIterable = $__1.checkIterable,
isCallable = $__1.isCallable,
isConstructor = $__1.isConstructor,
maybeAddFunctions = $__1.maybeAddFunctions,
maybeAddIterator = $__1.maybeAddIterator,
registerPolyfill = $__1.registerPolyfill,
toInteger = $__1.toInteger,
toLength = $__1.toLength,
toObject = $__1.toObject;
function from(arrLike) {
var mapFn = arguments[1];
var thisArg = arguments[2];
var C = this;
var items = toObject(arrLike);
var mapping = mapFn !== undefined;
var k = 0;
var arr,
len;
if (mapping && !isCallable(mapFn)) {
throw TypeError();
}
if (checkIterable(items)) {
arr = isConstructor(C) ? new C() : [];
for (var $__2 = items[$traceurRuntime.toProperty(Symbol.iterator)](),
$__3; !($__3 = $__2.next()).done; ) {
var item = $__3.value;
{
if (mapping) {
arr[k] = mapFn.call(thisArg, item, k);
} else {
arr[k] = item;
}
k++;
}
}
arr.length = k;
return arr;
}
len = toLength(items.length);
arr = isConstructor(C) ? new C(len) : new Array(len);
for (; k < len; k++) {
if (mapping) {
arr[k] = typeof thisArg === 'undefined' ? mapFn(items[k], k) : mapFn.call(thisArg, items[k], k);
} else {
arr[k] = items[k];
}
}
arr.length = len;
return arr;
}
function of() {
for (var items = [],
$__4 = 0; $__4 < arguments.length; $__4++)
items[$__4] = arguments[$__4];
var C = this;
var len = items.length;
var arr = isConstructor(C) ? new C(len) : new Array(len);
for (var k = 0; k < len; k++) {
arr[k] = items[k];
}
arr.length = len;
return arr;
}
function fill(value) {
var start = arguments[1] !== (void 0) ? arguments[1] : 0;
var end = arguments[2];
var object = toObject(this);
var len = toLength(object.length);
var fillStart = toInteger(start);
var fillEnd = end !== undefined ? toInteger(end) : len;
fillStart = fillStart < 0 ? Math.max(len + fillStart, 0) : Math.min(fillStart, len);
fillEnd = fillEnd < 0 ? Math.max(len + fillEnd, 0) : Math.min(fillEnd, len);
while (fillStart < fillEnd) {
object[fillStart] = value;
fillStart++;
}
return object;
}
function find(predicate) {
var thisArg = arguments[1];
return findHelper(this, predicate, thisArg);
}
function findIndex(predicate) {
var thisArg = arguments[1];
return findHelper(this, predicate, thisArg, true);
}
function findHelper(self, predicate) {
var thisArg = arguments[2];
var returnIndex = arguments[3] !== (void 0) ? arguments[3] : false;
var object = toObject(self);
var len = toLength(object.length);
if (!isCallable(predicate)) {
throw TypeError();
}
for (var i = 0; i < len; i++) {
var value = object[i];
if (predicate.call(thisArg, value, i, object)) {
return returnIndex ? i : value;
}
}
return returnIndex ? -1 : undefined;
}
function polyfillArray(global) {
var $__5 = global,
Array = $__5.Array,
Object = $__5.Object,
Symbol = $__5.Symbol;
maybeAddFunctions(Array.prototype, ['entries', entries, 'keys', keys, 'values', values, 'fill', fill, 'find', find, 'findIndex', findIndex]);
maybeAddFunctions(Array, ['from', from, 'of', of]);
maybeAddIterator(Array.prototype, values, Symbol);
maybeAddIterator(Object.getPrototypeOf([].values()), function() {
return this;
}, Symbol);
}
registerPolyfill(polyfillArray);
return {
get from() {
return from;
},
get of() {
return of;
},
get fill() {
return fill;
},
get find() {
return find;
},
get findIndex() {
return findIndex;
},
get polyfillArray() {
return polyfillArray;
}
};
});
System.get("traceur@0.0.74/src/runtime/polyfills/Array" + '');
System.register("traceur@0.0.74/src/runtime/polyfills/Object", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/runtime/polyfills/Object";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/runtime/polyfills/Object", path);
}
var $__0 = System.get("traceur@0.0.74/src/runtime/polyfills/utils"),
maybeAddFunctions = $__0.maybeAddFunctions,
registerPolyfill = $__0.registerPolyfill;
var $__1 = $traceurRuntime,
defineProperty = $__1.defineProperty,
getOwnPropertyDescriptor = $__1.getOwnPropertyDescriptor,
getOwnPropertyNames = $__1.getOwnPropertyNames,
isPrivateName = $__1.isPrivateName,
keys = $__1.keys;
function is(left, right) {
if (left === right)
return left !== 0 || 1 / left === 1 / right;
return left !== left && right !== right;
}
function assign(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
var props = source == null ? [] : keys(source);
var p,
length = props.length;
for (p = 0; p < length; p++) {
var name = props[p];
if (isPrivateName(name))
continue;
target[name] = source[name];
}
}
return target;
}
function mixin(target, source) {
var props = getOwnPropertyNames(source);
var p,
descriptor,
length = props.length;
for (p = 0; p < length; p++) {
var name = props[p];
if (isPrivateName(name))
continue;
descriptor = getOwnPropertyDescriptor(source, props[p]);
defineProperty(target, props[p], descriptor);
}
return target;
}
function polyfillObject(global) {
var Object = global.Object;
maybeAddFunctions(Object, ['assign', assign, 'is', is, 'mixin', mixin]);
}
registerPolyfill(polyfillObject);
return {
get is() {
return is;
},
get assign() {
return assign;
},
get mixin() {
return mixin;
},
get polyfillObject() {
return polyfillObject;
}
};
});
System.get("traceur@0.0.74/src/runtime/polyfills/Object" + '');
System.register("traceur@0.0.74/src/runtime/polyfills/Number", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/runtime/polyfills/Number";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/runtime/polyfills/Number", path);
}
var $__0 = System.get("traceur@0.0.74/src/runtime/polyfills/utils"),
isNumber = $__0.isNumber,
maybeAddConsts = $__0.maybeAddConsts,
maybeAddFunctions = $__0.maybeAddFunctions,
registerPolyfill = $__0.registerPolyfill,
toInteger = $__0.toInteger;
var $abs = Math.abs;
var $isFinite = isFinite;
var $isNaN = isNaN;
var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1;
var MIN_SAFE_INTEGER = -Math.pow(2, 53) + 1;
var EPSILON = Math.pow(2, -52);
function NumberIsFinite(number) {
return isNumber(number) && $isFinite(number);
}
;
function isInteger(number) {
return NumberIsFinite(number) && toInteger(number) === number;
}
function NumberIsNaN(number) {
return isNumber(number) && $isNaN(number);
}
;
function isSafeInteger(number) {
if (NumberIsFinite(number)) {
var integral = toInteger(number);
if (integral === number)
return $abs(integral) <= MAX_SAFE_INTEGER;
}
return false;
}
function polyfillNumber(global) {
var Number = global.Number;
maybeAddConsts(Number, ['MAX_SAFE_INTEGER', MAX_SAFE_INTEGER, 'MIN_SAFE_INTEGER', MIN_SAFE_INTEGER, 'EPSILON', EPSILON]);
maybeAddFunctions(Number, ['isFinite', NumberIsFinite, 'isInteger', isInteger, 'isNaN', NumberIsNaN, 'isSafeInteger', isSafeInteger]);
}
registerPolyfill(polyfillNumber);
return {
get MAX_SAFE_INTEGER() {
return MAX_SAFE_INTEGER;
},
get MIN_SAFE_INTEGER() {
return MIN_SAFE_INTEGER;
},
get EPSILON() {
return EPSILON;
},
get isFinite() {
return NumberIsFinite;
},
get isInteger() {
return isInteger;
},
get isNaN() {
return NumberIsNaN;
},
get isSafeInteger() {
return isSafeInteger;
},
get polyfillNumber() {
return polyfillNumber;
}
};
});
System.get("traceur@0.0.74/src/runtime/polyfills/Number" + '');
System.register("traceur@0.0.74/src/runtime/polyfills/polyfills", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/runtime/polyfills/polyfills";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/runtime/polyfills/polyfills", path);
}
var polyfillAll = System.get("traceur@0.0.74/src/runtime/polyfills/utils").polyfillAll;
polyfillAll(this);
var setupGlobals = $traceurRuntime.setupGlobals;
$traceurRuntime.setupGlobals = function(global) {
setupGlobals(global);
polyfillAll(global);
};
return {};
});
System.get("traceur@0.0.74/src/runtime/polyfills/polyfills" + '');
System.register("traceur@0.0.74/src/Options", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/Options";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/Options", path);
}
function enumerableOnlyObject(obj) {
var result = Object.create(null);
Object.keys(obj).forEach(function(key) {
Object.defineProperty(result, key, {
enumerable: true,
value: obj[key]
});
});
return result;
}
var optionsV01 = enumerableOnlyObject({
annotations: false,
arrayComprehension: false,
arrowFunctions: true,
asyncFunctions: false,
blockBinding: true,
classes: true,
commentCallback: false,
computedPropertyNames: true,
debug: false,
defaultParameters: true,
destructuring: true,
exponentiation: false,
forOf: true,
freeVariableChecker: false,
generatorComprehension: false,
generators: true,
memberVariables: false,
moduleName: false,
modules: 'register',
numericLiterals: true,
outputLanguage: 'es5',
propertyMethods: true,
propertyNameShorthand: true,
referrer: '',
unicodeExpressions: true,
restParameters: true,
script: false,
sourceMaps: false,
spread: true,
symbols: false,
templateLiterals: true,
typeAssertionModule: null,
typeAssertions: false,
types: false,
unicodeEscapeSequences: true,
validate: false
});
var versionLockedOptions = optionsV01;
var parseOptions = Object.create(null);
var transformOptions = Object.create(null);
var defaultValues = Object.create(null);
var experimentalOptions = Object.create(null);
var moduleOptions = ['amd', 'commonjs', 'instantiate', 'inline', 'register'];
var Options = function Options() {
var options = arguments[0] !== (void 0) ? arguments[0] : Object.create(null);
this.reset();
Object.defineProperties(this, {
modules_: {
value: versionLockedOptions.modules,
writable: true,
enumerable: false
},
sourceMaps_: {
value: versionLockedOptions.sourceMaps,
writable: true,
enumerable: false
}
});
this.setFromObject(options);
};
($traceurRuntime.createClass)(Options, {
set experimental(v) {
var $__0 = this;
v = coerceOptionValue(v);
Object.keys(experimentalOptions).forEach((function(name) {
$__0[name] = v;
}));
},
get experimental() {
var $__0 = this;
var value;
Object.keys(experimentalOptions).every((function(name) {
var currentValue = $__0[name];
if (value === undefined) {
value = currentValue;
return true;
}
if (currentValue !== value) {
value = null;
return false;
}
return true;
}));
return value;
},
get modules() {
return this.modules_;
},
set modules(value) {
if (typeof value === 'boolean' && !value)
value = 'register';
if (moduleOptions.indexOf(value) === -1) {
throw new Error('Invalid \'modules\' option \'' + value + '\', not in ' + moduleOptions.join(', '));
}
this.modules_ = value;
},
get sourceMaps() {
return this.sourceMaps_;
},
set sourceMaps(value) {
if (value === null || typeof value === 'boolean') {
this.sourceMaps_ = value ? 'file' : false;
return;
}
if (value === 'file' || value === 'inline' || value === 'memory') {
this.sourceMaps_ = value;
} else {
throw new Error('Option sourceMaps should be ' + '[false|inline|file|memory], not ' + value);
}
},
reset: function() {
var allOff = arguments[0];
var $__0 = this;
var useDefault = allOff === undefined;
Object.keys(defaultValues).forEach((function(name) {
$__0[name] = useDefault && defaultValues[name];
}));
this.setDefaults();
},
setDefaults: function() {
this.modules = 'register';
this.moduleName = false;
this.outputLanguage = 'es5';
this.referrer = '';
this.sourceMaps = false;
this.typeAssertionModule = null;
},
setFromObject: function(object) {
var $__0 = this;
Object.keys(this).forEach((function(name) {
if (name in object)
$__0.setOption(name, object[name]);
}));
this.modules = object.modules || this.modules;
if (typeof object.sourceMaps === 'boolean' || typeof object.sourceMaps === 'string') {
this.sourceMaps = object.sourceMaps;
}
return this;
},
setOption: function(name, value) {
name = toCamelCase(name);
if (name in this) {
this[name] = value;
} else {
throw Error('Unknown option: ' + name);
}
},
diff: function(ref) {
var $__0 = this;
var mismatches = [];
Object.keys(options).forEach((function(key) {
if ($__0[key] !== ref[key]) {
mismatches.push({
key: key,
now: traceur.options[key],
v01: ref[key]
});
}
}));
return mismatches;
}
}, {});
;
var options = new Options();
var descriptions = {
experimental: 'Turns on all experimental features',
sourceMaps: 'Generate source map and (\'file\') write to .map' + ' or (\'inline\') append data URL'
};
var CommandOptions = function CommandOptions() {
$traceurRuntime.superConstructor($CommandOptions).apply(this, arguments);
};
var $CommandOptions = CommandOptions;
($traceurRuntime.createClass)(CommandOptions, {parseCommand: function(s) {
var re = /--([^=]+)(?:=(.+))?/;
var m = re.exec(s);
if (m) {
var value = true;
if (typeof m[2] !== 'undefined')
value = coerceOptionValue(m[2]);
this.setOption(m[1], value);
}
}}, {
fromString: function(s) {
return $CommandOptions.fromArgv(s.split(/\s+/));
},
fromArgv: function(args) {
var options = new $CommandOptions();
args.forEach((function(arg) {
return options.parseCommand(arg);
}));
return options;
}
}, Options);
function coerceOptionValue(v) {
switch (v) {
case 'false':
return false;
case 'true':
case true:
return true;
default:
return !!v && String(v);
}
}
function addOptions(flags, commandOptions) {
flags.option('--referrer ', 'Bracket output code with System.referrerName=', (function(name) {
commandOptions.setOption('referrer', name);
System.map = System.semverMap(name);
return name;
}));
flags.option('--type-assertion-module ', 'Absolute path to the type assertion module.', (function(path) {
commandOptions.setOption('type-assertion-module', path);
return path;
}));
flags.option('--modules <' + moduleOptions.join(', ') + '>', 'select the output format for modules', (function(moduleFormat) {
commandOptions.modules = moduleFormat;
}));
flags.option('--moduleName ', '__moduleName value, + sign to use source name, or empty to omit', (function(moduleName) {
if (moduleName === '+')
moduleName = true;
commandOptions.moduleName = moduleName;
}));
flags.option('--outputLanguage ', 'compilation target language', (function(outputLanguage) {
if (outputLanguage === 'es6' || outputLanguage === 'es5')
commandOptions.outputLanguage = outputLanguage;
else
throw new Error('outputLanguage must be one of es5, es6');
}));
flags.option('--source-maps [file|inline|memory]', 'sourceMaps generated to file or inline with data: URL', (function(to) {
return commandOptions.sourceMaps = to;
}));
flags.option('--experimental', 'Turns on all experimental features', (function() {
commandOptions.experimental = true;
}));
Object.keys(commandOptions).forEach(function(name) {
var dashedName = toDashCase(name);
if (flags.optionFor('--' + name) || flags.optionFor('--' + dashedName)) {
return;
} else if ((name in parseOptions) && (name in transformOptions)) {
flags.option('--' + dashedName + ' [true|false|parse]', descriptions[name]);
flags.on(dashedName, (function(value) {
return commandOptions.setOption(dashedName, value);
}));
} else if (commandOptions[name] !== null) {
flags.option('--' + dashedName, descriptions[name]);
flags.on(dashedName, (function() {
return commandOptions.setOption(dashedName, true);
}));
} else {
throw new Error('Unexpected null commandOption ' + name);
}
});
commandOptions.setDefaults();
}
function toCamelCase(s) {
return s.replace(/-\w/g, function(ch) {
return ch[1].toUpperCase();
});
}
function toDashCase(s) {
return s.replace(/[A-Z]/g, function(ch) {
return '-' + ch.toLowerCase();
});
}
var EXPERIMENTAL = 0;
var ON_BY_DEFAULT = 1;
function addFeatureOption(name, kind) {
if (kind === EXPERIMENTAL)
experimentalOptions[name] = true;
Object.defineProperty(parseOptions, name, {
get: function() {
return !!options[name];
},
enumerable: true,
configurable: true
});
Object.defineProperty(transformOptions, name, {
get: function() {
var v = options[name];
if (v === 'parse')
return false;
return v;
},
enumerable: true,
configurable: true
});
var defaultValue = options[name] || kind === ON_BY_DEFAULT;
options[name] = defaultValue;
defaultValues[name] = defaultValue;
}
function addBoolOption(name) {
defaultValues[name] = false;
options[name] = false;
}
addFeatureOption('arrowFunctions', ON_BY_DEFAULT);
addFeatureOption('blockBinding', ON_BY_DEFAULT);
addFeatureOption('classes', ON_BY_DEFAULT);
addFeatureOption('computedPropertyNames', ON_BY_DEFAULT);
addFeatureOption('defaultParameters', ON_BY_DEFAULT);
addFeatureOption('destructuring', ON_BY_DEFAULT);
addFeatureOption('forOf', ON_BY_DEFAULT);
addFeatureOption('generators', ON_BY_DEFAULT);
addFeatureOption('modules', 'SPECIAL');
addFeatureOption('numericLiterals', ON_BY_DEFAULT);
addFeatureOption('propertyMethods', ON_BY_DEFAULT);
addFeatureOption('propertyNameShorthand', ON_BY_DEFAULT);
addFeatureOption('restParameters', ON_BY_DEFAULT);
addFeatureOption('sourceMaps', 'SPECIAL');
addFeatureOption('spread', ON_BY_DEFAULT);
addFeatureOption('templateLiterals', ON_BY_DEFAULT);
addFeatureOption('unicodeEscapeSequences', ON_BY_DEFAULT);
addFeatureOption('unicodeExpressions', ON_BY_DEFAULT);
addFeatureOption('annotations', EXPERIMENTAL);
addFeatureOption('arrayComprehension', EXPERIMENTAL);
addFeatureOption('asyncFunctions', EXPERIMENTAL);
addFeatureOption('exponentiation', EXPERIMENTAL);
addFeatureOption('generatorComprehension', EXPERIMENTAL);
addFeatureOption('symbols', EXPERIMENTAL);
addFeatureOption('types', EXPERIMENTAL);
addFeatureOption('memberVariables', EXPERIMENTAL);
addBoolOption('commentCallback');
addBoolOption('debug');
addBoolOption('freeVariableChecker');
addBoolOption('script');
addBoolOption('typeAssertions');
addBoolOption('validate');
return {
get optionsV01() {
return optionsV01;
},
get versionLockedOptions() {
return versionLockedOptions;
},
get parseOptions() {
return parseOptions;
},
get transformOptions() {
return transformOptions;
},
get Options() {
return Options;
},
get options() {
return options;
},
get CommandOptions() {
return CommandOptions;
},
get addOptions() {
return addOptions;
},
get toDashCase() {
return toDashCase;
}
};
});
System.register("traceur@0.0.74/src/syntax/TokenType", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/syntax/TokenType";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/syntax/TokenType", path);
}
var AMPERSAND = '&';
var AMPERSAND_EQUAL = '&=';
var AND = '&&';
var ARROW = '=>';
var AT = '@';
var BACK_QUOTE = '`';
var BANG = '!';
var BAR = '|';
var BAR_EQUAL = '|=';
var BREAK = 'break';
var CARET = '^';
var CARET_EQUAL = '^=';
var CASE = 'case';
var CATCH = 'catch';
var CLASS = 'class';
var CLOSE_ANGLE = '>';
var CLOSE_CURLY = '}';
var CLOSE_PAREN = ')';
var CLOSE_SQUARE = ']';
var COLON = ':';
var COMMA = ',';
var CONST = 'const';
var CONTINUE = 'continue';
var DEBUGGER = 'debugger';
var DEFAULT = 'default';
var DELETE = 'delete';
var DO = 'do';
var DOT_DOT_DOT = '...';
var ELSE = 'else';
var END_OF_FILE = 'End of File';
var ENUM = 'enum';
var EQUAL = '=';
var EQUAL_EQUAL = '==';
var EQUAL_EQUAL_EQUAL = '===';
var ERROR = 'error';
var EXPORT = 'export';
var EXTENDS = 'extends';
var FALSE = 'false';
var FINALLY = 'finally';
var FOR = 'for';
var FUNCTION = 'function';
var GREATER_EQUAL = '>=';
var IDENTIFIER = 'identifier';
var IF = 'if';
var IMPLEMENTS = 'implements';
var IMPORT = 'import';
var IN = 'in';
var INSTANCEOF = 'instanceof';
var INTERFACE = 'interface';
var LEFT_SHIFT = '<<';
var LEFT_SHIFT_EQUAL = '<<=';
var LESS_EQUAL = '<=';
var LET = 'let';
var MINUS = '-';
var MINUS_EQUAL = '-=';
var MINUS_MINUS = '--';
var NEW = 'new';
var NO_SUBSTITUTION_TEMPLATE = 'no substitution template';
var NOT_EQUAL = '!=';
var NOT_EQUAL_EQUAL = '!==';
var NULL = 'null';
var NUMBER = 'number literal';
var OPEN_ANGLE = '<';
var OPEN_CURLY = '{';
var OPEN_PAREN = '(';
var OPEN_SQUARE = '[';
var OR = '||';
var PACKAGE = 'package';
var PERCENT = '%';
var PERCENT_EQUAL = '%=';
var PERIOD = '.';
var PLUS = '+';
var PLUS_EQUAL = '+=';
var PLUS_PLUS = '++';
var PRIVATE = 'private';
var PROTECTED = 'protected';
var PUBLIC = 'public';
var QUESTION = '?';
var REGULAR_EXPRESSION = 'regular expression literal';
var RETURN = 'return';
var RIGHT_SHIFT = '>>';
var RIGHT_SHIFT_EQUAL = '>>=';
var SEMI_COLON = ';';
var SLASH = '/';
var SLASH_EQUAL = '/=';
var STAR = '*';
var STAR_EQUAL = '*=';
var STAR_STAR = '**';
var STAR_STAR_EQUAL = '**=';
var STATIC = 'static';
var STRING = 'string literal';
var SUPER = 'super';
var SWITCH = 'switch';
var TEMPLATE_HEAD = 'template head';
var TEMPLATE_MIDDLE = 'template middle';
var TEMPLATE_TAIL = 'template tail';
var THIS = 'this';
var THROW = 'throw';
var TILDE = '~';
var TRUE = 'true';
var TRY = 'try';
var TYPEOF = 'typeof';
var UNSIGNED_RIGHT_SHIFT = '>>>';
var UNSIGNED_RIGHT_SHIFT_EQUAL = '>>>=';
var VAR = 'var';
var VOID = 'void';
var WHILE = 'while';
var WITH = 'with';
var YIELD = 'yield';
return {
get AMPERSAND() {
return AMPERSAND;
},
get AMPERSAND_EQUAL() {
return AMPERSAND_EQUAL;
},
get AND() {
return AND;
},
get ARROW() {
return ARROW;
},
get AT() {
return AT;
},
get BACK_QUOTE() {
return BACK_QUOTE;
},
get BANG() {
return BANG;
},
get BAR() {
return BAR;
},
get BAR_EQUAL() {
return BAR_EQUAL;
},
get BREAK() {
return BREAK;
},
get CARET() {
return CARET;
},
get CARET_EQUAL() {
return CARET_EQUAL;
},
get CASE() {
return CASE;
},
get CATCH() {
return CATCH;
},
get CLASS() {
return CLASS;
},
get CLOSE_ANGLE() {
return CLOSE_ANGLE;
},
get CLOSE_CURLY() {
return CLOSE_CURLY;
},
get CLOSE_PAREN() {
return CLOSE_PAREN;
},
get CLOSE_SQUARE() {
return CLOSE_SQUARE;
},
get COLON() {
return COLON;
},
get COMMA() {
return COMMA;
},
get CONST() {
return CONST;
},
get CONTINUE() {
return CONTINUE;
},
get DEBUGGER() {
return DEBUGGER;
},
get DEFAULT() {
return DEFAULT;
},
get DELETE() {
return DELETE;
},
get DO() {
return DO;
},
get DOT_DOT_DOT() {
return DOT_DOT_DOT;
},
get ELSE() {
return ELSE;
},
get END_OF_FILE() {
return END_OF_FILE;
},
get ENUM() {
return ENUM;
},
get EQUAL() {
return EQUAL;
},
get EQUAL_EQUAL() {
return EQUAL_EQUAL;
},
get EQUAL_EQUAL_EQUAL() {
return EQUAL_EQUAL_EQUAL;
},
get ERROR() {
return ERROR;
},
get EXPORT() {
return EXPORT;
},
get EXTENDS() {
return EXTENDS;
},
get FALSE() {
return FALSE;
},
get FINALLY() {
return FINALLY;
},
get FOR() {
return FOR;
},
get FUNCTION() {
return FUNCTION;
},
get GREATER_EQUAL() {
return GREATER_EQUAL;
},
get IDENTIFIER() {
return IDENTIFIER;
},
get IF() {
return IF;
},
get IMPLEMENTS() {
return IMPLEMENTS;
},
get IMPORT() {
return IMPORT;
},
get IN() {
return IN;
},
get INSTANCEOF() {
return INSTANCEOF;
},
get INTERFACE() {
return INTERFACE;
},
get LEFT_SHIFT() {
return LEFT_SHIFT;
},
get LEFT_SHIFT_EQUAL() {
return LEFT_SHIFT_EQUAL;
},
get LESS_EQUAL() {
return LESS_EQUAL;
},
get LET() {
return LET;
},
get MINUS() {
return MINUS;
},
get MINUS_EQUAL() {
return MINUS_EQUAL;
},
get MINUS_MINUS() {
return MINUS_MINUS;
},
get NEW() {
return NEW;
},
get NO_SUBSTITUTION_TEMPLATE() {
return NO_SUBSTITUTION_TEMPLATE;
},
get NOT_EQUAL() {
return NOT_EQUAL;
},
get NOT_EQUAL_EQUAL() {
return NOT_EQUAL_EQUAL;
},
get NULL() {
return NULL;
},
get NUMBER() {
return NUMBER;
},
get OPEN_ANGLE() {
return OPEN_ANGLE;
},
get OPEN_CURLY() {
return OPEN_CURLY;
},
get OPEN_PAREN() {
return OPEN_PAREN;
},
get OPEN_SQUARE() {
return OPEN_SQUARE;
},
get OR() {
return OR;
},
get PACKAGE() {
return PACKAGE;
},
get PERCENT() {
return PERCENT;
},
get PERCENT_EQUAL() {
return PERCENT_EQUAL;
},
get PERIOD() {
return PERIOD;
},
get PLUS() {
return PLUS;
},
get PLUS_EQUAL() {
return PLUS_EQUAL;
},
get PLUS_PLUS() {
return PLUS_PLUS;
},
get PRIVATE() {
return PRIVATE;
},
get PROTECTED() {
return PROTECTED;
},
get PUBLIC() {
return PUBLIC;
},
get QUESTION() {
return QUESTION;
},
get REGULAR_EXPRESSION() {
return REGULAR_EXPRESSION;
},
get RETURN() {
return RETURN;
},
get RIGHT_SHIFT() {
return RIGHT_SHIFT;
},
get RIGHT_SHIFT_EQUAL() {
return RIGHT_SHIFT_EQUAL;
},
get SEMI_COLON() {
return SEMI_COLON;
},
get SLASH() {
return SLASH;
},
get SLASH_EQUAL() {
return SLASH_EQUAL;
},
get STAR() {
return STAR;
},
get STAR_EQUAL() {
return STAR_EQUAL;
},
get STAR_STAR() {
return STAR_STAR;
},
get STAR_STAR_EQUAL() {
return STAR_STAR_EQUAL;
},
get STATIC() {
return STATIC;
},
get STRING() {
return STRING;
},
get SUPER() {
return SUPER;
},
get SWITCH() {
return SWITCH;
},
get TEMPLATE_HEAD() {
return TEMPLATE_HEAD;
},
get TEMPLATE_MIDDLE() {
return TEMPLATE_MIDDLE;
},
get TEMPLATE_TAIL() {
return TEMPLATE_TAIL;
},
get THIS() {
return THIS;
},
get THROW() {
return THROW;
},
get TILDE() {
return TILDE;
},
get TRUE() {
return TRUE;
},
get TRY() {
return TRY;
},
get TYPEOF() {
return TYPEOF;
},
get UNSIGNED_RIGHT_SHIFT() {
return UNSIGNED_RIGHT_SHIFT;
},
get UNSIGNED_RIGHT_SHIFT_EQUAL() {
return UNSIGNED_RIGHT_SHIFT_EQUAL;
},
get VAR() {
return VAR;
},
get VOID() {
return VOID;
},
get WHILE() {
return WHILE;
},
get WITH() {
return WITH;
},
get YIELD() {
return YIELD;
}
};
});
System.register("traceur@0.0.74/src/syntax/trees/ParseTreeType", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/syntax/trees/ParseTreeType";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/syntax/trees/ParseTreeType", path);
}
var ANNOTATION = 'ANNOTATION';
var ANON_BLOCK = 'ANON_BLOCK';
var ARGUMENT_LIST = 'ARGUMENT_LIST';
var ARRAY_COMPREHENSION = 'ARRAY_COMPREHENSION';
var ARRAY_LITERAL_EXPRESSION = 'ARRAY_LITERAL_EXPRESSION';
var ARRAY_PATTERN = 'ARRAY_PATTERN';
var ARROW_FUNCTION_EXPRESSION = 'ARROW_FUNCTION_EXPRESSION';
var ASSIGNMENT_ELEMENT = 'ASSIGNMENT_ELEMENT';
var AWAIT_EXPRESSION = 'AWAIT_EXPRESSION';
var BINARY_EXPRESSION = 'BINARY_EXPRESSION';
var BINDING_ELEMENT = 'BINDING_ELEMENT';
var BINDING_IDENTIFIER = 'BINDING_IDENTIFIER';
var BLOCK = 'BLOCK';
var BREAK_STATEMENT = 'BREAK_STATEMENT';
var CALL_EXPRESSION = 'CALL_EXPRESSION';
var CASE_CLAUSE = 'CASE_CLAUSE';
var CATCH = 'CATCH';
var CLASS_DECLARATION = 'CLASS_DECLARATION';
var CLASS_EXPRESSION = 'CLASS_EXPRESSION';
var COMMA_EXPRESSION = 'COMMA_EXPRESSION';
var COMPREHENSION_FOR = 'COMPREHENSION_FOR';
var COMPREHENSION_IF = 'COMPREHENSION_IF';
var COMPUTED_PROPERTY_NAME = 'COMPUTED_PROPERTY_NAME';
var CONDITIONAL_EXPRESSION = 'CONDITIONAL_EXPRESSION';
var CONTINUE_STATEMENT = 'CONTINUE_STATEMENT';
var COVER_FORMALS = 'COVER_FORMALS';
var COVER_INITIALIZED_NAME = 'COVER_INITIALIZED_NAME';
var DEBUGGER_STATEMENT = 'DEBUGGER_STATEMENT';
var DEFAULT_CLAUSE = 'DEFAULT_CLAUSE';
var DO_WHILE_STATEMENT = 'DO_WHILE_STATEMENT';
var EMPTY_STATEMENT = 'EMPTY_STATEMENT';
var EXPORT_DECLARATION = 'EXPORT_DECLARATION';
var EXPORT_DEFAULT = 'EXPORT_DEFAULT';
var EXPORT_SPECIFIER = 'EXPORT_SPECIFIER';
var EXPORT_SPECIFIER_SET = 'EXPORT_SPECIFIER_SET';
var EXPORT_STAR = 'EXPORT_STAR';
var EXPRESSION_STATEMENT = 'EXPRESSION_STATEMENT';
var FINALLY = 'FINALLY';
var FOR_IN_STATEMENT = 'FOR_IN_STATEMENT';
var FOR_OF_STATEMENT = 'FOR_OF_STATEMENT';
var FOR_STATEMENT = 'FOR_STATEMENT';
var FORMAL_PARAMETER = 'FORMAL_PARAMETER';
var FORMAL_PARAMETER_LIST = 'FORMAL_PARAMETER_LIST';
var FUNCTION_BODY = 'FUNCTION_BODY';
var FUNCTION_DECLARATION = 'FUNCTION_DECLARATION';
var FUNCTION_EXPRESSION = 'FUNCTION_EXPRESSION';
var GENERATOR_COMPREHENSION = 'GENERATOR_COMPREHENSION';
var GET_ACCESSOR = 'GET_ACCESSOR';
var IDENTIFIER_EXPRESSION = 'IDENTIFIER_EXPRESSION';
var IF_STATEMENT = 'IF_STATEMENT';
var IMPORT_DECLARATION = 'IMPORT_DECLARATION';
var IMPORT_SPECIFIER = 'IMPORT_SPECIFIER';
var IMPORT_SPECIFIER_SET = 'IMPORT_SPECIFIER_SET';
var IMPORTED_BINDING = 'IMPORTED_BINDING';
var LABELLED_STATEMENT = 'LABELLED_STATEMENT';
var LITERAL_EXPRESSION = 'LITERAL_EXPRESSION';
var LITERAL_PROPERTY_NAME = 'LITERAL_PROPERTY_NAME';
var MEMBER_EXPRESSION = 'MEMBER_EXPRESSION';
var MEMBER_LOOKUP_EXPRESSION = 'MEMBER_LOOKUP_EXPRESSION';
var MODULE = 'MODULE';
var MODULE_DECLARATION = 'MODULE_DECLARATION';
var MODULE_SPECIFIER = 'MODULE_SPECIFIER';
var NAMED_EXPORT = 'NAMED_EXPORT';
var NEW_EXPRESSION = 'NEW_EXPRESSION';
var OBJECT_LITERAL_EXPRESSION = 'OBJECT_LITERAL_EXPRESSION';
var OBJECT_PATTERN = 'OBJECT_PATTERN';
var OBJECT_PATTERN_FIELD = 'OBJECT_PATTERN_FIELD';
var PAREN_EXPRESSION = 'PAREN_EXPRESSION';
var POSTFIX_EXPRESSION = 'POSTFIX_EXPRESSION';
var PREDEFINED_TYPE = 'PREDEFINED_TYPE';
var PROPERTY_METHOD_ASSIGNMENT = 'PROPERTY_METHOD_ASSIGNMENT';
var PROPERTY_NAME_ASSIGNMENT = 'PROPERTY_NAME_ASSIGNMENT';
var PROPERTY_NAME_SHORTHAND = 'PROPERTY_NAME_SHORTHAND';
var PROPERTY_VARIABLE_DECLARATION = 'PROPERTY_VARIABLE_DECLARATION';
var REST_PARAMETER = 'REST_PARAMETER';
var RETURN_STATEMENT = 'RETURN_STATEMENT';
var SCRIPT = 'SCRIPT';
var SET_ACCESSOR = 'SET_ACCESSOR';
var SPREAD_EXPRESSION = 'SPREAD_EXPRESSION';
var SPREAD_PATTERN_ELEMENT = 'SPREAD_PATTERN_ELEMENT';
var STATE_MACHINE = 'STATE_MACHINE';
var SUPER_EXPRESSION = 'SUPER_EXPRESSION';
var SWITCH_STATEMENT = 'SWITCH_STATEMENT';
var SYNTAX_ERROR_TREE = 'SYNTAX_ERROR_TREE';
var TEMPLATE_LITERAL_EXPRESSION = 'TEMPLATE_LITERAL_EXPRESSION';
var TEMPLATE_LITERAL_PORTION = 'TEMPLATE_LITERAL_PORTION';
var TEMPLATE_SUBSTITUTION = 'TEMPLATE_SUBSTITUTION';
var THIS_EXPRESSION = 'THIS_EXPRESSION';
var THROW_STATEMENT = 'THROW_STATEMENT';
var TRY_STATEMENT = 'TRY_STATEMENT';
var TYPE_ARGUMENTS = 'TYPE_ARGUMENTS';
var TYPE_NAME = 'TYPE_NAME';
var TYPE_REFERENCE = 'TYPE_REFERENCE';
var UNARY_EXPRESSION = 'UNARY_EXPRESSION';
var VARIABLE_DECLARATION = 'VARIABLE_DECLARATION';
var VARIABLE_DECLARATION_LIST = 'VARIABLE_DECLARATION_LIST';
var VARIABLE_STATEMENT = 'VARIABLE_STATEMENT';
var WHILE_STATEMENT = 'WHILE_STATEMENT';
var WITH_STATEMENT = 'WITH_STATEMENT';
var YIELD_EXPRESSION = 'YIELD_EXPRESSION';
return {
get ANNOTATION() {
return ANNOTATION;
},
get ANON_BLOCK() {
return ANON_BLOCK;
},
get ARGUMENT_LIST() {
return ARGUMENT_LIST;
},
get ARRAY_COMPREHENSION() {
return ARRAY_COMPREHENSION;
},
get ARRAY_LITERAL_EXPRESSION() {
return ARRAY_LITERAL_EXPRESSION;
},
get ARRAY_PATTERN() {
return ARRAY_PATTERN;
},
get ARROW_FUNCTION_EXPRESSION() {
return ARROW_FUNCTION_EXPRESSION;
},
get ASSIGNMENT_ELEMENT() {
return ASSIGNMENT_ELEMENT;
},
get AWAIT_EXPRESSION() {
return AWAIT_EXPRESSION;
},
get BINARY_EXPRESSION() {
return BINARY_EXPRESSION;
},
get BINDING_ELEMENT() {
return BINDING_ELEMENT;
},
get BINDING_IDENTIFIER() {
return BINDING_IDENTIFIER;
},
get BLOCK() {
return BLOCK;
},
get BREAK_STATEMENT() {
return BREAK_STATEMENT;
},
get CALL_EXPRESSION() {
return CALL_EXPRESSION;
},
get CASE_CLAUSE() {
return CASE_CLAUSE;
},
get CATCH() {
return CATCH;
},
get CLASS_DECLARATION() {
return CLASS_DECLARATION;
},
get CLASS_EXPRESSION() {
return CLASS_EXPRESSION;
},
get COMMA_EXPRESSION() {
return COMMA_EXPRESSION;
},
get COMPREHENSION_FOR() {
return COMPREHENSION_FOR;
},
get COMPREHENSION_IF() {
return COMPREHENSION_IF;
},
get COMPUTED_PROPERTY_NAME() {
return COMPUTED_PROPERTY_NAME;
},
get CONDITIONAL_EXPRESSION() {
return CONDITIONAL_EXPRESSION;
},
get CONTINUE_STATEMENT() {
return CONTINUE_STATEMENT;
},
get COVER_FORMALS() {
return COVER_FORMALS;
},
get COVER_INITIALIZED_NAME() {
return COVER_INITIALIZED_NAME;
},
get DEBUGGER_STATEMENT() {
return DEBUGGER_STATEMENT;
},
get DEFAULT_CLAUSE() {
return DEFAULT_CLAUSE;
},
get DO_WHILE_STATEMENT() {
return DO_WHILE_STATEMENT;
},
get EMPTY_STATEMENT() {
return EMPTY_STATEMENT;
},
get EXPORT_DECLARATION() {
return EXPORT_DECLARATION;
},
get EXPORT_DEFAULT() {
return EXPORT_DEFAULT;
},
get EXPORT_SPECIFIER() {
return EXPORT_SPECIFIER;
},
get EXPORT_SPECIFIER_SET() {
return EXPORT_SPECIFIER_SET;
},
get EXPORT_STAR() {
return EXPORT_STAR;
},
get EXPRESSION_STATEMENT() {
return EXPRESSION_STATEMENT;
},
get FINALLY() {
return FINALLY;
},
get FOR_IN_STATEMENT() {
return FOR_IN_STATEMENT;
},
get FOR_OF_STATEMENT() {
return FOR_OF_STATEMENT;
},
get FOR_STATEMENT() {
return FOR_STATEMENT;
},
get FORMAL_PARAMETER() {
return FORMAL_PARAMETER;
},
get FORMAL_PARAMETER_LIST() {
return FORMAL_PARAMETER_LIST;
},
get FUNCTION_BODY() {
return FUNCTION_BODY;
},
get FUNCTION_DECLARATION() {
return FUNCTION_DECLARATION;
},
get FUNCTION_EXPRESSION() {
return FUNCTION_EXPRESSION;
},
get GENERATOR_COMPREHENSION() {
return GENERATOR_COMPREHENSION;
},
get GET_ACCESSOR() {
return GET_ACCESSOR;
},
get IDENTIFIER_EXPRESSION() {
return IDENTIFIER_EXPRESSION;
},
get IF_STATEMENT() {
return IF_STATEMENT;
},
get IMPORT_DECLARATION() {
return IMPORT_DECLARATION;
},
get IMPORT_SPECIFIER() {
return IMPORT_SPECIFIER;
},
get IMPORT_SPECIFIER_SET() {
return IMPORT_SPECIFIER_SET;
},
get IMPORTED_BINDING() {
return IMPORTED_BINDING;
},
get LABELLED_STATEMENT() {
return LABELLED_STATEMENT;
},
get LITERAL_EXPRESSION() {
return LITERAL_EXPRESSION;
},
get LITERAL_PROPERTY_NAME() {
return LITERAL_PROPERTY_NAME;
},
get MEMBER_EXPRESSION() {
return MEMBER_EXPRESSION;
},
get MEMBER_LOOKUP_EXPRESSION() {
return MEMBER_LOOKUP_EXPRESSION;
},
get MODULE() {
return MODULE;
},
get MODULE_DECLARATION() {
return MODULE_DECLARATION;
},
get MODULE_SPECIFIER() {
return MODULE_SPECIFIER;
},
get NAMED_EXPORT() {
return NAMED_EXPORT;
},
get NEW_EXPRESSION() {
return NEW_EXPRESSION;
},
get OBJECT_LITERAL_EXPRESSION() {
return OBJECT_LITERAL_EXPRESSION;
},
get OBJECT_PATTERN() {
return OBJECT_PATTERN;
},
get OBJECT_PATTERN_FIELD() {
return OBJECT_PATTERN_FIELD;
},
get PAREN_EXPRESSION() {
return PAREN_EXPRESSION;
},
get POSTFIX_EXPRESSION() {
return POSTFIX_EXPRESSION;
},
get PREDEFINED_TYPE() {
return PREDEFINED_TYPE;
},
get PROPERTY_METHOD_ASSIGNMENT() {
return PROPERTY_METHOD_ASSIGNMENT;
},
get PROPERTY_NAME_ASSIGNMENT() {
return PROPERTY_NAME_ASSIGNMENT;
},
get PROPERTY_NAME_SHORTHAND() {
return PROPERTY_NAME_SHORTHAND;
},
get PROPERTY_VARIABLE_DECLARATION() {
return PROPERTY_VARIABLE_DECLARATION;
},
get REST_PARAMETER() {
return REST_PARAMETER;
},
get RETURN_STATEMENT() {
return RETURN_STATEMENT;
},
get SCRIPT() {
return SCRIPT;
},
get SET_ACCESSOR() {
return SET_ACCESSOR;
},
get SPREAD_EXPRESSION() {
return SPREAD_EXPRESSION;
},
get SPREAD_PATTERN_ELEMENT() {
return SPREAD_PATTERN_ELEMENT;
},
get STATE_MACHINE() {
return STATE_MACHINE;
},
get SUPER_EXPRESSION() {
return SUPER_EXPRESSION;
},
get SWITCH_STATEMENT() {
return SWITCH_STATEMENT;
},
get SYNTAX_ERROR_TREE() {
return SYNTAX_ERROR_TREE;
},
get TEMPLATE_LITERAL_EXPRESSION() {
return TEMPLATE_LITERAL_EXPRESSION;
},
get TEMPLATE_LITERAL_PORTION() {
return TEMPLATE_LITERAL_PORTION;
},
get TEMPLATE_SUBSTITUTION() {
return TEMPLATE_SUBSTITUTION;
},
get THIS_EXPRESSION() {
return THIS_EXPRESSION;
},
get THROW_STATEMENT() {
return THROW_STATEMENT;
},
get TRY_STATEMENT() {
return TRY_STATEMENT;
},
get TYPE_ARGUMENTS() {
return TYPE_ARGUMENTS;
},
get TYPE_NAME() {
return TYPE_NAME;
},
get TYPE_REFERENCE() {
return TYPE_REFERENCE;
},
get UNARY_EXPRESSION() {
return UNARY_EXPRESSION;
},
get VARIABLE_DECLARATION() {
return VARIABLE_DECLARATION;
},
get VARIABLE_DECLARATION_LIST() {
return VARIABLE_DECLARATION_LIST;
},
get VARIABLE_STATEMENT() {
return VARIABLE_STATEMENT;
},
get WHILE_STATEMENT() {
return WHILE_STATEMENT;
},
get WITH_STATEMENT() {
return WITH_STATEMENT;
},
get YIELD_EXPRESSION() {
return YIELD_EXPRESSION;
}
};
});
System.register("traceur@0.0.74/src/syntax/ParseTreeVisitor", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/syntax/ParseTreeVisitor";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/syntax/ParseTreeVisitor", path);
}
var ParseTreeVisitor = function ParseTreeVisitor() {};
($traceurRuntime.createClass)(ParseTreeVisitor, {
visitAny: function(tree) {
tree && tree.visit(this);
},
visit: function(tree) {
this.visitAny(tree);
},
visitList: function(list) {
if (list) {
for (var i = 0; i < list.length; i++) {
this.visitAny(list[i]);
}
}
},
visitStateMachine: function(tree) {
throw Error('State machines should not live outside of the GeneratorTransformer.');
},
visitAnnotation: function(tree) {
this.visitAny(tree.name);
this.visitAny(tree.args);
},
visitAnonBlock: function(tree) {
this.visitList(tree.statements);
},
visitArgumentList: function(tree) {
this.visitList(tree.args);
},
visitArrayComprehension: function(tree) {
this.visitList(tree.comprehensionList);
this.visitAny(tree.expression);
},
visitArrayLiteralExpression: function(tree) {
this.visitList(tree.elements);
},
visitArrayPattern: function(tree) {
this.visitList(tree.elements);
},
visitArrowFunctionExpression: function(tree) {
this.visitAny(tree.parameterList);
this.visitAny(tree.body);
},
visitAssignmentElement: function(tree) {
this.visitAny(tree.assignment);
this.visitAny(tree.initializer);
},
visitAwaitExpression: function(tree) {
this.visitAny(tree.expression);
},
visitBinaryExpression: function(tree) {
this.visitAny(tree.left);
this.visitAny(tree.right);
},
visitBindingElement: function(tree) {
this.visitAny(tree.binding);
this.visitAny(tree.initializer);
},
visitBindingIdentifier: function(tree) {},
visitBlock: function(tree) {
this.visitList(tree.statements);
},
visitBreakStatement: function(tree) {},
visitCallExpression: function(tree) {
this.visitAny(tree.operand);
this.visitAny(tree.args);
},
visitCaseClause: function(tree) {
this.visitAny(tree.expression);
this.visitList(tree.statements);
},
visitCatch: function(tree) {
this.visitAny(tree.binding);
this.visitAny(tree.catchBody);
},
visitClassDeclaration: function(tree) {
this.visitAny(tree.name);
this.visitAny(tree.superClass);
this.visitList(tree.elements);
this.visitList(tree.annotations);
},
visitClassExpression: function(tree) {
this.visitAny(tree.name);
this.visitAny(tree.superClass);
this.visitList(tree.elements);
this.visitList(tree.annotations);
},
visitCommaExpression: function(tree) {
this.visitList(tree.expressions);
},
visitComprehensionFor: function(tree) {
this.visitAny(tree.left);
this.visitAny(tree.iterator);
},
visitComprehensionIf: function(tree) {
this.visitAny(tree.expression);
},
visitComputedPropertyName: function(tree) {
this.visitAny(tree.expression);
},
visitConditionalExpression: function(tree) {
this.visitAny(tree.condition);
this.visitAny(tree.left);
this.visitAny(tree.right);
},
visitContinueStatement: function(tree) {},
visitCoverFormals: function(tree) {
this.visitList(tree.expressions);
},
visitCoverInitializedName: function(tree) {
this.visitAny(tree.initializer);
},
visitDebuggerStatement: function(tree) {},
visitDefaultClause: function(tree) {
this.visitList(tree.statements);
},
visitDoWhileStatement: function(tree) {
this.visitAny(tree.body);
this.visitAny(tree.condition);
},
visitEmptyStatement: function(tree) {},
visitExportDeclaration: function(tree) {
this.visitAny(tree.declaration);
this.visitList(tree.annotations);
},
visitExportDefault: function(tree) {
this.visitAny(tree.expression);
},
visitExportSpecifier: function(tree) {},
visitExportSpecifierSet: function(tree) {
this.visitList(tree.specifiers);
},
visitExportStar: function(tree) {},
visitExpressionStatement: function(tree) {
this.visitAny(tree.expression);
},
visitFinally: function(tree) {
this.visitAny(tree.block);
},
visitForInStatement: function(tree) {
this.visitAny(tree.initializer);
this.visitAny(tree.collection);
this.visitAny(tree.body);
},
visitForOfStatement: function(tree) {
this.visitAny(tree.initializer);
this.visitAny(tree.collection);
this.visitAny(tree.body);
},
visitForStatement: function(tree) {
this.visitAny(tree.initializer);
this.visitAny(tree.condition);
this.visitAny(tree.increment);
this.visitAny(tree.body);
},
visitFormalParameter: function(tree) {
this.visitAny(tree.parameter);
this.visitAny(tree.typeAnnotation);
this.visitList(tree.annotations);
},
visitFormalParameterList: function(tree) {
this.visitList(tree.parameters);
},
visitFunctionBody: function(tree) {
this.visitList(tree.statements);
},
visitFunctionDeclaration: function(tree) {
this.visitAny(tree.name);
this.visitAny(tree.parameterList);
this.visitAny(tree.typeAnnotation);
this.visitList(tree.annotations);
this.visitAny(tree.body);
},
visitFunctionExpression: function(tree) {
this.visitAny(tree.name);
this.visitAny(tree.parameterList);
this.visitAny(tree.typeAnnotation);
this.visitList(tree.annotations);
this.visitAny(tree.body);
},
visitGeneratorComprehension: function(tree) {
this.visitList(tree.comprehensionList);
this.visitAny(tree.expression);
},
visitGetAccessor: function(tree) {
this.visitAny(tree.name);
this.visitAny(tree.typeAnnotation);
this.visitList(tree.annotations);
this.visitAny(tree.body);
},
visitIdentifierExpression: function(tree) {},
visitIfStatement: function(tree) {
this.visitAny(tree.condition);
this.visitAny(tree.ifClause);
this.visitAny(tree.elseClause);
},
visitImportedBinding: function(tree) {
this.visitAny(tree.binding);
},
visitImportDeclaration: function(tree) {
this.visitAny(tree.importClause);
this.visitAny(tree.moduleSpecifier);
},
visitImportSpecifier: function(tree) {
this.visitAny(tree.binding);
},
visitImportSpecifierSet: function(tree) {
this.visitList(tree.specifiers);
},
visitLabelledStatement: function(tree) {
this.visitAny(tree.statement);
},
visitLiteralExpression: function(tree) {},
visitLiteralPropertyName: function(tree) {},
visitMemberExpression: function(tree) {
this.visitAny(tree.operand);
},
visitMemberLookupExpression: function(tree) {
this.visitAny(tree.operand);
this.visitAny(tree.memberExpression);
},
visitModule: function(tree) {
this.visitList(tree.scriptItemList);
},
visitModuleDeclaration: function(tree) {
this.visitAny(tree.binding);
this.visitAny(tree.expression);
},
visitModuleSpecifier: function(tree) {},
visitNamedExport: function(tree) {
this.visitAny(tree.moduleSpecifier);
this.visitAny(tree.specifierSet);
},
visitNewExpression: function(tree) {
this.visitAny(tree.operand);
this.visitAny(tree.args);
},
visitObjectLiteralExpression: function(tree) {
this.visitList(tree.propertyNameAndValues);
},
visitObjectPattern: function(tree) {
this.visitList(tree.fields);
},
visitObjectPatternField: function(tree) {
this.visitAny(tree.name);
this.visitAny(tree.element);
},
visitParenExpression: function(tree) {
this.visitAny(tree.expression);
},
visitPostfixExpression: function(tree) {
this.visitAny(tree.operand);
},
visitPredefinedType: function(tree) {},
visitScript: function(tree) {
this.visitList(tree.scriptItemList);
},
visitPropertyMethodAssignment: function(tree) {
this.visitAny(tree.name);
this.visitAny(tree.parameterList);
this.visitAny(tree.typeAnnotation);
this.visitList(tree.annotations);
this.visitAny(tree.body);
},
visitPropertyNameAssignment: function(tree) {
this.visitAny(tree.name);
this.visitAny(tree.value);
},
visitPropertyNameShorthand: function(tree) {},
visitPropertyVariableDeclaration: function(tree) {
this.visitAny(tree.name);
this.visitAny(tree.typeAnnotation);
this.visitList(tree.annotations);
},
visitRestParameter: function(tree) {
this.visitAny(tree.identifier);
},
visitReturnStatement: function(tree) {
this.visitAny(tree.expression);
},
visitSetAccessor: function(tree) {
this.visitAny(tree.name);
this.visitAny(tree.parameterList);
this.visitList(tree.annotations);
this.visitAny(tree.body);
},
visitSpreadExpression: function(tree) {
this.visitAny(tree.expression);
},
visitSpreadPatternElement: function(tree) {
this.visitAny(tree.lvalue);
},
visitSuperExpression: function(tree) {},
visitSwitchStatement: function(tree) {
this.visitAny(tree.expression);
this.visitList(tree.caseClauses);
},
visitSyntaxErrorTree: function(tree) {},
visitTemplateLiteralExpression: function(tree) {
this.visitAny(tree.operand);
this.visitList(tree.elements);
},
visitTemplateLiteralPortion: function(tree) {},
visitTemplateSubstitution: function(tree) {
this.visitAny(tree.expression);
},
visitThisExpression: function(tree) {},
visitThrowStatement: function(tree) {
this.visitAny(tree.value);
},
visitTryStatement: function(tree) {
this.visitAny(tree.body);
this.visitAny(tree.catchBlock);
this.visitAny(tree.finallyBlock);
},
visitTypeArguments: function(tree) {
this.visitList(tree.args);
},
visitTypeName: function(tree) {
this.visitAny(tree.moduleName);
},
visitTypeReference: function(tree) {
this.visitAny(tree.typeName);
this.visitAny(tree.args);
},
visitUnaryExpression: function(tree) {
this.visitAny(tree.operand);
},
visitVariableDeclaration: function(tree) {
this.visitAny(tree.lvalue);
this.visitAny(tree.typeAnnotation);
this.visitAny(tree.initializer);
},
visitVariableDeclarationList: function(tree) {
this.visitList(tree.declarations);
},
visitVariableStatement: function(tree) {
this.visitAny(tree.declarations);
},
visitWhileStatement: function(tree) {
this.visitAny(tree.condition);
this.visitAny(tree.body);
},
visitWithStatement: function(tree) {
this.visitAny(tree.expression);
this.visitAny(tree.body);
},
visitYieldExpression: function(tree) {
this.visitAny(tree.expression);
}
}, {});
return {get ParseTreeVisitor() {
return ParseTreeVisitor;
}};
});
System.register("traceur@0.0.74/src/syntax/PredefinedName", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/syntax/PredefinedName";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/syntax/PredefinedName", path);
}
var $ARGUMENTS = '$arguments';
var ANY = 'any';
var APPLY = 'apply';
var ARGUMENTS = 'arguments';
var ARRAY = 'Array';
var AS = 'as';
var ASYNC = 'async';
var AWAIT = 'await';
var BIND = 'bind';
var CALL = 'call';
var CONFIGURABLE = 'configurable';
var CONSTRUCTOR = 'constructor';
var CREATE = 'create';
var CURRENT = 'current';
var DEFINE_PROPERTY = 'defineProperty';
var ENUMERABLE = 'enumerable';
var FREEZE = 'freeze';
var FROM = 'from';
var FUNCTION = 'Function';
var GET = 'get';
var HAS = 'has';
var LENGTH = 'length';
var MODULE = 'module';
var NEW = 'new';
var OBJECT = 'Object';
var OBJECT_NAME = 'Object';
var OF = 'of';
var PREVENT_EXTENSIONS = 'preventExtensions';
var PROTOTYPE = 'prototype';
var PUSH = 'push';
var SET = 'set';
var SLICE = 'slice';
var THIS = 'this';
var TRACEUR_RUNTIME = '$traceurRuntime';
var UNDEFINED = 'undefined';
var WRITABLE = 'writable';
return {
get $ARGUMENTS() {
return $ARGUMENTS;
},
get ANY() {
return ANY;
},
get APPLY() {
return APPLY;
},
get ARGUMENTS() {
return ARGUMENTS;
},
get ARRAY() {
return ARRAY;
},
get AS() {
return AS;
},
get ASYNC() {
return ASYNC;
},
get AWAIT() {
return AWAIT;
},
get BIND() {
return BIND;
},
get CALL() {
return CALL;
},
get CONFIGURABLE() {
return CONFIGURABLE;
},
get CONSTRUCTOR() {
return CONSTRUCTOR;
},
get CREATE() {
return CREATE;
},
get CURRENT() {
return CURRENT;
},
get DEFINE_PROPERTY() {
return DEFINE_PROPERTY;
},
get ENUMERABLE() {
return ENUMERABLE;
},
get FREEZE() {
return FREEZE;
},
get FROM() {
return FROM;
},
get FUNCTION() {
return FUNCTION;
},
get GET() {
return GET;
},
get HAS() {
return HAS;
},
get LENGTH() {
return LENGTH;
},
get MODULE() {
return MODULE;
},
get NEW() {
return NEW;
},
get OBJECT() {
return OBJECT;
},
get OBJECT_NAME() {
return OBJECT_NAME;
},
get OF() {
return OF;
},
get PREVENT_EXTENSIONS() {
return PREVENT_EXTENSIONS;
},
get PROTOTYPE() {
return PROTOTYPE;
},
get PUSH() {
return PUSH;
},
get SET() {
return SET;
},
get SLICE() {
return SLICE;
},
get THIS() {
return THIS;
},
get TRACEUR_RUNTIME() {
return TRACEUR_RUNTIME;
},
get UNDEFINED() {
return UNDEFINED;
},
get WRITABLE() {
return WRITABLE;
}
};
});
System.register("traceur@0.0.74/src/semantics/util", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/semantics/util";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/semantics/util", path);
}
var $__0 = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType"),
IDENTIFIER_EXPRESSION = $__0.IDENTIFIER_EXPRESSION,
LITERAL_EXPRESSION = $__0.LITERAL_EXPRESSION,
PAREN_EXPRESSION = $__0.PAREN_EXPRESSION,
UNARY_EXPRESSION = $__0.UNARY_EXPRESSION;
var UNDEFINED = System.get("traceur@0.0.74/src/syntax/PredefinedName").UNDEFINED;
var VOID = System.get("traceur@0.0.74/src/syntax/TokenType").VOID;
function hasUseStrict(list) {
for (var i = 0; i < list.length; i++) {
if (!list[i].isDirectivePrologue())
return false;
if (list[i].isUseStrictDirective())
return true;
}
return false;
}
function isUndefined(tree) {
if (tree.type === PAREN_EXPRESSION)
return isUndefined(tree.expression);
return tree.type === IDENTIFIER_EXPRESSION && tree.identifierToken.value === UNDEFINED;
}
function isVoidExpression(tree) {
if (tree.type === PAREN_EXPRESSION)
return isVoidExpression(tree.expression);
return tree.type === UNARY_EXPRESSION && tree.operator.type === VOID && isLiteralExpression(tree.operand);
}
function isLiteralExpression(tree) {
if (tree.type === PAREN_EXPRESSION)
return isLiteralExpression(tree.expression);
return tree.type === LITERAL_EXPRESSION;
}
return {
get hasUseStrict() {
return hasUseStrict;
},
get isUndefined() {
return isUndefined;
},
get isVoidExpression() {
return isVoidExpression;
},
get isLiteralExpression() {
return isLiteralExpression;
}
};
});
System.register("traceur@0.0.74/src/semantics/isTreeStrict", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/semantics/isTreeStrict";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/semantics/isTreeStrict", path);
}
var $__0 = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType"),
ARROW_FUNCTION_EXPRESSION = $__0.ARROW_FUNCTION_EXPRESSION,
CLASS_DECLARATION = $__0.CLASS_DECLARATION,
CLASS_EXPRESSION = $__0.CLASS_EXPRESSION,
FUNCTION_BODY = $__0.FUNCTION_BODY,
FUNCTION_DECLARATION = $__0.FUNCTION_DECLARATION,
FUNCTION_EXPRESSION = $__0.FUNCTION_EXPRESSION,
GET_ACCESSOR = $__0.GET_ACCESSOR,
MODULE = $__0.MODULE,
PROPERTY_METHOD_ASSIGNMENT = $__0.PROPERTY_METHOD_ASSIGNMENT,
SCRIPT = $__0.SCRIPT,
SET_ACCESSOR = $__0.SET_ACCESSOR;
var hasUseStrict = System.get("traceur@0.0.74/src/semantics/util").hasUseStrict;
function isTreeStrict(tree) {
switch (tree.type) {
case CLASS_DECLARATION:
case CLASS_EXPRESSION:
case MODULE:
return true;
case FUNCTION_BODY:
return hasUseStrict(tree.statements);
case FUNCTION_EXPRESSION:
case FUNCTION_DECLARATION:
case PROPERTY_METHOD_ASSIGNMENT:
return isTreeStrict(tree.body);
case ARROW_FUNCTION_EXPRESSION:
if (tree.body.type === FUNCTION_BODY) {
return isTreeStrict(tree.body);
}
return false;
case GET_ACCESSOR:
case SET_ACCESSOR:
return isTreeStrict(tree.body);
case SCRIPT:
return hasUseStrict(tree.scriptItemList);
default:
return false;
}
}
return {get isTreeStrict() {
return isTreeStrict;
}};
});
System.register("traceur@0.0.74/src/semantics/Scope", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/semantics/Scope";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/semantics/Scope", path);
}
var $__0 = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType"),
BLOCK = $__0.BLOCK,
CATCH = $__0.CATCH;
var VAR = System.get("traceur@0.0.74/src/syntax/TokenType").VAR;
var isTreeStrict = System.get("traceur@0.0.74/src/semantics/isTreeStrict").isTreeStrict;
function reportDuplicateVar(reporter, tree, name) {
reporter.reportError(tree.location && tree.location.start, ("Duplicate declaration, " + name));
}
var Scope = function Scope(parent, tree) {
this.parent = parent;
this.tree = tree;
this.variableDeclarations = Object.create(null);
this.lexicalDeclarations = Object.create(null);
this.strictMode = parent && parent.strictMode || isTreeStrict(tree);
};
($traceurRuntime.createClass)(Scope, {
addBinding: function(tree, type, reporter) {
if (type === VAR) {
this.addVar(tree, reporter);
} else {
this.addDeclaration(tree, type, reporter);
}
},
addVar: function(tree, reporter) {
var name = tree.getStringValue();
if (this.lexicalDeclarations[name]) {
reportDuplicateVar(reporter, tree, name);
return;
}
this.variableDeclarations[name] = {
type: VAR,
tree: tree
};
if (!this.isVarScope && this.parent) {
this.parent.addVar(tree, reporter);
}
},
addDeclaration: function(tree, type, reporter) {
var name = tree.getStringValue();
if (this.lexicalDeclarations[name] || this.variableDeclarations[name]) {
reportDuplicateVar(reporter, tree, name);
return;
}
this.lexicalDeclarations[name] = {
type: type,
tree: tree
};
},
renameBinding: function(oldName, newTree, newType, reporter) {
var name = newTree.getStringValue();
if (newType == VAR) {
if (this.lexicalDeclarations[oldName]) {
delete this.lexicalDeclarations[oldName];
this.addVar(newTree, reporter);
}
} else if (this.variableDeclarations[oldName]) {
delete this.variableDeclarations[oldName];
this.addDeclaration(newTree, newType, reporter);
if (!this.isVarScope && this.parent) {
this.parent.renameBinding(oldName, newTree, newType);
}
}
},
get isVarScope() {
switch (this.tree.type) {
case BLOCK:
case CATCH:
return false;
}
return true;
},
getVarScope: function() {
if (this.isVarScope) {
return this;
}
if (this.parent) {
return this.parent.getVarScope();
}
return null;
},
getBinding: function(tree) {
var name = tree.getStringValue();
return this.getBindingByName(name);
},
getBindingByName: function(name) {
var b = this.lexicalDeclarations[name];
if (b) {
return b;
}
b = this.variableDeclarations[name];
if (b && this.isVarScope) {
return b;
}
if (this.parent) {
return this.parent.getBindingByName(name);
}
return null;
},
getAllBindingNames: function() {
var names = Object.create(null);
var name;
for (name in this.variableDeclarations) {
names[name] = true;
}
for (name in this.lexicalDeclarations) {
names[name] = true;
}
return names;
},
getVariableBindingNames: function() {
var names = Object.create(null);
for (var name in this.variableDeclarations) {
names[name] = true;
}
return names;
},
getLexicalBindingNames: function() {
var names = Object.create(null);
for (var name in this.lexicalDeclarations) {
names[name] = true;
}
return names;
},
hasBindingName: function(name) {
return this.lexicalDeclarations[name] || this.variableDeclarations[name];
},
hasLexicalBindingName: function(name) {
return this.lexicalDeclarations[name];
},
hasVariableBindingName: function(name) {
return this.variableDeclarations[name];
}
}, {});
return {get Scope() {
return Scope;
}};
});
System.register("traceur@0.0.74/src/semantics/ScopeVisitor", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/semantics/ScopeVisitor";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/semantics/ScopeVisitor", path);
}
var Map = System.get("traceur@0.0.74/src/runtime/polyfills/Map").Map;
var ParseTreeVisitor = System.get("traceur@0.0.74/src/syntax/ParseTreeVisitor").ParseTreeVisitor;
var VAR = System.get("traceur@0.0.74/src/syntax/TokenType").VAR;
var Scope = System.get("traceur@0.0.74/src/semantics/Scope").Scope;
var $__4 = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType"),
COMPREHENSION_FOR = $__4.COMPREHENSION_FOR,
VARIABLE_DECLARATION_LIST = $__4.VARIABLE_DECLARATION_LIST;
var ScopeVisitor = function ScopeVisitor() {
this.map_ = new Map();
this.scope = null;
this.withBlockCounter_ = 0;
};
var $ScopeVisitor = ScopeVisitor;
($traceurRuntime.createClass)(ScopeVisitor, {
getScopeForTree: function(tree) {
return this.map_.get(tree);
},
pushScope: function(tree) {
var scope = new Scope(this.scope, tree);
this.map_.set(tree, scope);
return this.scope = scope;
},
popScope: function(scope) {
if (this.scope !== scope) {
throw new Error('ScopeVisitor scope mismatch');
}
this.scope = scope.parent;
},
visitScript: function(tree) {
var scope = this.pushScope(tree);
$traceurRuntime.superGet(this, $ScopeVisitor.prototype, "visitScript").call(this, tree);
this.popScope(scope);
},
visitModule: function(tree) {
var scope = this.pushScope(tree);
$traceurRuntime.superGet(this, $ScopeVisitor.prototype, "visitModule").call(this, tree);
this.popScope(scope);
},
visitBlock: function(tree) {
var scope = this.pushScope(tree);
$traceurRuntime.superGet(this, $ScopeVisitor.prototype, "visitBlock").call(this, tree);
this.popScope(scope);
},
visitCatch: function(tree) {
var scope = this.pushScope(tree);
this.visitAny(tree.binding);
this.visitList(tree.catchBody.statements);
this.popScope(scope);
},
visitFunctionBodyForScope: function(tree) {
var parameterList = arguments[1] !== (void 0) ? arguments[1] : tree.parameterList;
var scope = this.pushScope(tree);
this.visitAny(parameterList);
this.visitAny(tree.body);
this.popScope(scope);
},
visitFunctionExpression: function(tree) {
this.visitFunctionBodyForScope(tree);
},
visitFunctionDeclaration: function(tree) {
this.visitAny(tree.name);
this.visitFunctionBodyForScope(tree);
},
visitArrowFunctionExpression: function(tree) {
this.visitFunctionBodyForScope(tree);
},
visitGetAccessor: function(tree) {
this.visitFunctionBodyForScope(tree, null);
},
visitSetAccessor: function(tree) {
this.visitFunctionBodyForScope(tree);
},
visitPropertyMethodAssignment: function(tree) {
this.visitFunctionBodyForScope(tree);
},
visitClassDeclaration: function(tree) {
this.visitAny(tree.superClass);
var scope = this.pushScope(tree);
this.visitAny(tree.name);
this.visitList(tree.elements);
this.popScope(scope);
},
visitClassExpression: function(tree) {
this.visitAny(tree.superClass);
var scope;
if (tree.name) {
scope = this.pushScope(tree);
this.visitAny(tree.name);
}
this.visitList(tree.elements);
if (tree.name) {
this.popScope(scope);
}
},
visitWithStatement: function(tree) {
this.visitAny(tree.expression);
this.withBlockCounter_++;
this.visitAny(tree.body);
this.withBlockCounter_--;
},
get inWithBlock() {
return this.withBlockCounter_ > 0;
},
visitLoop_: function(tree, func) {
if (tree.initializer.type !== VARIABLE_DECLARATION_LIST || tree.initializer.declarationType === VAR) {
func();
return;
}
var scope = this.pushScope(tree);
func();
this.popScope(scope);
},
visitForInStatement: function(tree) {
var $__5 = this;
this.visitLoop_(tree, (function() {
return $traceurRuntime.superGet($__5, $ScopeVisitor.prototype, "visitForInStatement").call($__5, tree);
}));
},
visitForOfStatement: function(tree) {
var $__5 = this;
this.visitLoop_(tree, (function() {
return $traceurRuntime.superGet($__5, $ScopeVisitor.prototype, "visitForOfStatement").call($__5, tree);
}));
},
visitForStatement: function(tree) {
var $__5 = this;
if (!tree.initializer) {
$traceurRuntime.superGet(this, $ScopeVisitor.prototype, "visitForStatement").call(this, tree);
} else {
this.visitLoop_(tree, (function() {
return $traceurRuntime.superGet($__5, $ScopeVisitor.prototype, "visitForStatement").call($__5, tree);
}));
}
},
visitComprehension_: function(tree) {
var scopes = [];
for (var i = 0; i < tree.comprehensionList.length; i++) {
var scope = null;
if (tree.comprehensionList[i].type === COMPREHENSION_FOR) {
scope = this.pushScope(tree.comprehensionList[i]);
}
scopes.push(scope);
this.visitAny(tree.comprehensionList[i]);
}
this.visitAny(tree.expression);
for (var i = scopes.length - 1; i >= 0; i--) {
if (scopes[i]) {
this.popScope(scopes[i]);
}
}
},
visitArrayComprehension: function(tree) {
this.visitComprehension_(tree);
},
visitGeneratorComprehension: function(tree) {
this.visitComprehension_(tree);
}
}, {}, ParseTreeVisitor);
return {get ScopeVisitor() {
return ScopeVisitor;
}};
});
System.register("traceur@0.0.74/src/semantics/ScopeChainBuilder", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/semantics/ScopeChainBuilder";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/semantics/ScopeChainBuilder", path);
}
var $__0 = System.get("traceur@0.0.74/src/syntax/TokenType"),
CONST = $__0.CONST,
LET = $__0.LET,
VAR = $__0.VAR;
var ScopeVisitor = System.get("traceur@0.0.74/src/semantics/ScopeVisitor").ScopeVisitor;
var ScopeChainBuilder = function ScopeChainBuilder(reporter) {
$traceurRuntime.superConstructor($ScopeChainBuilder).call(this);
this.reporter_ = reporter;
this.declarationType_ = null;
};
var $ScopeChainBuilder = ScopeChainBuilder;
($traceurRuntime.createClass)(ScopeChainBuilder, {
visitCatch: function(tree) {
var scope = this.pushScope(tree);
this.declarationType_ = LET;
this.visitAny(tree.binding);
this.visitList(tree.catchBody.statements);
this.popScope(scope);
},
visitImportedBinding: function(tree) {
this.declarationType_ = CONST;
$traceurRuntime.superGet(this, $ScopeChainBuilder.prototype, "visitImportedBinding").call(this, tree);
},
visitVariableDeclarationList: function(tree) {
this.declarationType_ = tree.declarationType;
$traceurRuntime.superGet(this, $ScopeChainBuilder.prototype, "visitVariableDeclarationList").call(this, tree);
},
visitBindingIdentifier: function(tree) {
this.declareVariable(tree);
},
visitFunctionExpression: function(tree) {
var scope = this.pushScope(tree);
if (tree.name) {
this.declarationType_ = CONST;
this.visitAny(tree.name);
}
this.visitAny(tree.parameterList);
this.visitAny(tree.body);
this.popScope(scope);
},
visitFormalParameter: function(tree) {
this.declarationType_ = VAR;
$traceurRuntime.superGet(this, $ScopeChainBuilder.prototype, "visitFormalParameter").call(this, tree);
},
visitFunctionDeclaration: function(tree) {
if (this.scope) {
if (this.scope.isVarScope) {
this.declarationType_ = VAR;
this.visitAny(tree.name);
} else {
if (!this.scope.strictMode) {
var varScope = this.scope.getVarScope();
if (varScope) {
varScope.addVar(tree.name, this.reporter_);
}
}
this.declarationType_ = LET;
this.visitAny(tree.name);
}
}
this.visitFunctionBodyForScope(tree, tree.parameterList, tree.body);
},
visitClassDeclaration: function(tree) {
this.visitAny(tree.superClass);
this.declarationType_ = LET;
this.visitAny(tree.name);
var scope = this.pushScope(tree);
this.declarationType_ = CONST;
this.visitAny(tree.name);
this.visitList(tree.elements);
this.popScope(scope);
},
visitClassExpression: function(tree) {
this.visitAny(tree.superClass);
var scope;
if (tree.name) {
scope = this.pushScope(tree);
this.declarationType_ = CONST;
this.visitAny(tree.name);
}
this.visitList(tree.elements);
if (tree.name) {
this.popScope(scope);
}
},
visitComprehensionFor: function(tree) {
this.declarationType_ = LET;
$traceurRuntime.superGet(this, $ScopeChainBuilder.prototype, "visitComprehensionFor").call(this, tree);
},
declareVariable: function(tree) {
this.scope.addBinding(tree, this.declarationType_, this.reporter_);
}
}, {}, ScopeVisitor);
return {get ScopeChainBuilder() {
return ScopeChainBuilder;
}};
});
System.register("traceur@0.0.74/src/semantics/ConstChecker", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/semantics/ConstChecker";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/semantics/ConstChecker", path);
}
var IDENTIFIER_EXPRESSION = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType").IDENTIFIER_EXPRESSION;
var $__1 = System.get("traceur@0.0.74/src/syntax/TokenType"),
CONST = $__1.CONST,
MINUS_MINUS = $__1.MINUS_MINUS,
PLUS_PLUS = $__1.PLUS_PLUS;
var ScopeVisitor = System.get("traceur@0.0.74/src/semantics/ScopeVisitor").ScopeVisitor;
var ScopeChainBuilder = System.get("traceur@0.0.74/src/semantics/ScopeChainBuilder").ScopeChainBuilder;
var ConstChecker = function ConstChecker(scopeBuilder, reporter) {
$traceurRuntime.superConstructor($ConstChecker).call(this);
this.scopeBuilder_ = scopeBuilder;
this.reporter_ = reporter;
};
var $ConstChecker = ConstChecker;
($traceurRuntime.createClass)(ConstChecker, {
pushScope: function(tree) {
return this.scope = this.scopeBuilder_.getScopeForTree(tree);
},
visitUnaryExpression: function(tree) {
if (tree.operand.type === IDENTIFIER_EXPRESSION && (tree.operator.type === PLUS_PLUS || tree.operator.type === MINUS_MINUS)) {
this.validateMutation_(tree.operand);
}
$traceurRuntime.superGet(this, $ConstChecker.prototype, "visitUnaryExpression").call(this, tree);
},
visitPostfixExpression: function(tree) {
if (tree.operand.type === IDENTIFIER_EXPRESSION) {
this.validateMutation_(tree.operand);
}
$traceurRuntime.superGet(this, $ConstChecker.prototype, "visitPostfixExpression").call(this, tree);
},
visitBinaryExpression: function(tree) {
if (tree.left.type === IDENTIFIER_EXPRESSION && tree.operator.isAssignmentOperator()) {
this.validateMutation_(tree.left);
}
$traceurRuntime.superGet(this, $ConstChecker.prototype, "visitBinaryExpression").call(this, tree);
},
validateMutation_: function(identifierExpression) {
if (this.inWithBlock) {
return;
}
var binding = this.scope.getBinding(identifierExpression);
if (binding === null) {
return;
}
var $__5 = binding,
type = $__5.type,
tree = $__5.tree;
if (type === CONST) {
this.reportError_(identifierExpression.location, (tree.getStringValue() + " is read-only"));
}
},
reportError_: function(location, message) {
this.reporter_.reportError(location.start, message);
}
}, {}, ScopeVisitor);
function validate(tree, reporter) {
var builder = new ScopeChainBuilder(reporter);
builder.visitAny(tree);
var checker = new ConstChecker(builder, reporter);
checker.visitAny(tree);
}
return {
get ConstChecker() {
return ConstChecker;
},
get validate() {
return validate;
}
};
});
System.register("traceur@0.0.74/src/semantics/FreeVariableChecker", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/semantics/FreeVariableChecker";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/semantics/FreeVariableChecker", path);
}
var $__0 = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType"),
FUNCTION_DECLARATION = $__0.FUNCTION_DECLARATION,
FUNCTION_EXPRESSION = $__0.FUNCTION_EXPRESSION,
GET_ACCESSOR = $__0.GET_ACCESSOR,
IDENTIFIER_EXPRESSION = $__0.IDENTIFIER_EXPRESSION,
MODULE = $__0.MODULE,
PROPERTY_METHOD_ASSIGNMENT = $__0.PROPERTY_METHOD_ASSIGNMENT,
SET_ACCESSOR = $__0.SET_ACCESSOR;
var TYPEOF = System.get("traceur@0.0.74/src/syntax/TokenType").TYPEOF;
var ScopeVisitor = System.get("traceur@0.0.74/src/semantics/ScopeVisitor").ScopeVisitor;
var ScopeChainBuilder = System.get("traceur@0.0.74/src/semantics/ScopeChainBuilder").ScopeChainBuilder;
function hasArgumentsInScope(scope) {
for (; scope; scope = scope.parent) {
switch (scope.tree.type) {
case FUNCTION_DECLARATION:
case FUNCTION_EXPRESSION:
case GET_ACCESSOR:
case PROPERTY_METHOD_ASSIGNMENT:
case SET_ACCESSOR:
return true;
}
}
return false;
}
function inModuleScope(scope) {
for (; scope; scope = scope.parent) {
if (scope.tree.type === MODULE) {
return true;
}
}
return false;
}
var FreeVariableChecker = function FreeVariableChecker(scopeBuilder, reporter) {
var global = arguments[2] !== (void 0) ? arguments[2] : Object.create(null);
$traceurRuntime.superConstructor($FreeVariableChecker).call(this);
this.scopeBuilder_ = scopeBuilder;
this.reporter_ = reporter;
this.global_ = global;
};
var $FreeVariableChecker = FreeVariableChecker;
($traceurRuntime.createClass)(FreeVariableChecker, {
pushScope: function(tree) {
return this.scope = this.scopeBuilder_.getScopeForTree(tree);
},
visitUnaryExpression: function(tree) {
if (tree.operator.type === TYPEOF && tree.operand.type === IDENTIFIER_EXPRESSION) {
var scope = this.scope;
var binding = scope.getBinding(tree.operand);
if (!binding) {
scope.addVar(tree.operand, this.reporter_);
}
} else {
$traceurRuntime.superGet(this, $FreeVariableChecker.prototype, "visitUnaryExpression").call(this, tree);
}
},
visitIdentifierExpression: function(tree) {
if (this.inWithBlock) {
return;
}
var scope = this.scope;
var binding = scope.getBinding(tree);
if (binding) {
return;
}
var name = tree.getStringValue();
if (name === 'arguments' && hasArgumentsInScope(scope)) {
return;
}
if (name === '__moduleName' && inModuleScope(scope)) {
return;
}
if (!(name in this.global_)) {
this.reporter_.reportError(tree.location.start, (name + " is not defined"));
}
}
}, {}, ScopeVisitor);
function validate(tree, reporter) {
var global = arguments[2] !== (void 0) ? arguments[2] : Reflect.global;
var builder = new ScopeChainBuilder(reporter);
builder.visitAny(tree);
var checker = new FreeVariableChecker(builder, reporter, global);
checker.visitAny(tree);
}
return {get validate() {
return validate;
}};
});
System.register("traceur@0.0.74/src/util/JSON", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/util/JSON";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/util/JSON", path);
}
function transform(v) {
var replacer = arguments[1] !== (void 0) ? arguments[1] : (function(k, v) {
return v;
});
return transform_(replacer('', v), replacer);
}
function transform_(v, replacer) {
var rv,
tv;
if (Array.isArray(v)) {
var len = v.length;
rv = Array(len);
for (var i = 0; i < len; i++) {
tv = transform_(replacer(String(i), v[i]), replacer);
rv[i] = tv === undefined ? null : tv;
}
return rv;
}
if (v instanceof Object) {
rv = {};
Object.keys(v).forEach((function(k) {
tv = transform_(replacer(k, v[k]), replacer);
if (tv !== undefined) {
rv[k] = tv;
}
}));
return rv;
}
return v;
}
return {get transform() {
return transform;
}};
});
System.register("traceur@0.0.74/src/syntax/Token", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/syntax/Token";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/syntax/Token", path);
}
var $__0 = System.get("traceur@0.0.74/src/syntax/TokenType"),
AMPERSAND_EQUAL = $__0.AMPERSAND_EQUAL,
BAR_EQUAL = $__0.BAR_EQUAL,
CARET_EQUAL = $__0.CARET_EQUAL,
EQUAL = $__0.EQUAL,
LEFT_SHIFT_EQUAL = $__0.LEFT_SHIFT_EQUAL,
MINUS_EQUAL = $__0.MINUS_EQUAL,
PERCENT_EQUAL = $__0.PERCENT_EQUAL,
PLUS_EQUAL = $__0.PLUS_EQUAL,
RIGHT_SHIFT_EQUAL = $__0.RIGHT_SHIFT_EQUAL,
SLASH_EQUAL = $__0.SLASH_EQUAL,
STAR_EQUAL = $__0.STAR_EQUAL,
STAR_STAR_EQUAL = $__0.STAR_STAR_EQUAL,
UNSIGNED_RIGHT_SHIFT_EQUAL = $__0.UNSIGNED_RIGHT_SHIFT_EQUAL;
var Token = function Token(type, location) {
this.type = type;
this.location = location;
};
($traceurRuntime.createClass)(Token, {
toString: function() {
return this.type;
},
isAssignmentOperator: function() {
return isAssignmentOperator(this.type);
},
isKeyword: function() {
return false;
},
isStrictKeyword: function() {
return false;
}
}, {});
function isAssignmentOperator(type) {
switch (type) {
case AMPERSAND_EQUAL:
case BAR_EQUAL:
case CARET_EQUAL:
case EQUAL:
case LEFT_SHIFT_EQUAL:
case MINUS_EQUAL:
case PERCENT_EQUAL:
case PLUS_EQUAL:
case RIGHT_SHIFT_EQUAL:
case SLASH_EQUAL:
case STAR_EQUAL:
case STAR_STAR_EQUAL:
case UNSIGNED_RIGHT_SHIFT_EQUAL:
return true;
}
return false;
}
return {
get Token() {
return Token;
},
get isAssignmentOperator() {
return isAssignmentOperator;
}
};
});
System.register("traceur@0.0.74/src/syntax/trees/ParseTree", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/syntax/trees/ParseTree";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/syntax/trees/ParseTree", path);
}
var ParseTreeType = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType");
var $__0 = System.get("traceur@0.0.74/src/syntax/TokenType"),
IDENTIFIER = $__0.IDENTIFIER,
STAR = $__0.STAR,
STRING = $__0.STRING,
VAR = $__0.VAR;
var Token = System.get("traceur@0.0.74/src/syntax/Token").Token;
var utilJSON = System.get("traceur@0.0.74/src/util/JSON");
var ASYNC = System.get("traceur@0.0.74/src/syntax/PredefinedName").ASYNC;
var $__3 = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType"),
ARRAY_COMPREHENSION = $__3.ARRAY_COMPREHENSION,
ARRAY_LITERAL_EXPRESSION = $__3.ARRAY_LITERAL_EXPRESSION,
ARRAY_PATTERN = $__3.ARRAY_PATTERN,
ARROW_FUNCTION_EXPRESSION = $__3.ARROW_FUNCTION_EXPRESSION,
AWAIT_EXPRESSION = $__3.AWAIT_EXPRESSION,
BINARY_EXPRESSION = $__3.BINARY_EXPRESSION,
BINDING_IDENTIFIER = $__3.BINDING_IDENTIFIER,
BLOCK = $__3.BLOCK,
BREAK_STATEMENT = $__3.BREAK_STATEMENT,
CALL_EXPRESSION = $__3.CALL_EXPRESSION,
CLASS_DECLARATION = $__3.CLASS_DECLARATION,
CLASS_EXPRESSION = $__3.CLASS_EXPRESSION,
COMMA_EXPRESSION = $__3.COMMA_EXPRESSION,
CONDITIONAL_EXPRESSION = $__3.CONDITIONAL_EXPRESSION,
CONTINUE_STATEMENT = $__3.CONTINUE_STATEMENT,
DEBUGGER_STATEMENT = $__3.DEBUGGER_STATEMENT,
DO_WHILE_STATEMENT = $__3.DO_WHILE_STATEMENT,
EMPTY_STATEMENT = $__3.EMPTY_STATEMENT,
EXPORT_DECLARATION = $__3.EXPORT_DECLARATION,
EXPRESSION_STATEMENT = $__3.EXPRESSION_STATEMENT,
FORMAL_PARAMETER = $__3.FORMAL_PARAMETER,
FOR_IN_STATEMENT = $__3.FOR_IN_STATEMENT,
FOR_OF_STATEMENT = $__3.FOR_OF_STATEMENT,
FOR_STATEMENT = $__3.FOR_STATEMENT,
FUNCTION_DECLARATION = $__3.FUNCTION_DECLARATION,
FUNCTION_EXPRESSION = $__3.FUNCTION_EXPRESSION,
GENERATOR_COMPREHENSION = $__3.GENERATOR_COMPREHENSION,
IDENTIFIER_EXPRESSION = $__3.IDENTIFIER_EXPRESSION,
IF_STATEMENT = $__3.IF_STATEMENT,
IMPORTED_BINDING = $__3.IMPORTED_BINDING,
IMPORT_DECLARATION = $__3.IMPORT_DECLARATION,
LABELLED_STATEMENT = $__3.LABELLED_STATEMENT,
LITERAL_EXPRESSION = $__3.LITERAL_EXPRESSION,
MEMBER_EXPRESSION = $__3.MEMBER_EXPRESSION,
MEMBER_LOOKUP_EXPRESSION = $__3.MEMBER_LOOKUP_EXPRESSION,
MODULE_DECLARATION = $__3.MODULE_DECLARATION,
NEW_EXPRESSION = $__3.NEW_EXPRESSION,
OBJECT_LITERAL_EXPRESSION = $__3.OBJECT_LITERAL_EXPRESSION,
OBJECT_PATTERN = $__3.OBJECT_PATTERN,
PAREN_EXPRESSION = $__3.PAREN_EXPRESSION,
POSTFIX_EXPRESSION = $__3.POSTFIX_EXPRESSION,
PREDEFINED_TYPE = $__3.PREDEFINED_TYPE,
PROPERTY_NAME_SHORTHAND = $__3.PROPERTY_NAME_SHORTHAND,
REST_PARAMETER = $__3.REST_PARAMETER,
RETURN_STATEMENT = $__3.RETURN_STATEMENT,
SPREAD_EXPRESSION = $__3.SPREAD_EXPRESSION,
SPREAD_PATTERN_ELEMENT = $__3.SPREAD_PATTERN_ELEMENT,
SUPER_EXPRESSION = $__3.SUPER_EXPRESSION,
SWITCH_STATEMENT = $__3.SWITCH_STATEMENT,
TEMPLATE_LITERAL_EXPRESSION = $__3.TEMPLATE_LITERAL_EXPRESSION,
THIS_EXPRESSION = $__3.THIS_EXPRESSION,
THROW_STATEMENT = $__3.THROW_STATEMENT,
TRY_STATEMENT = $__3.TRY_STATEMENT,
TYPE_REFERENCE = $__3.TYPE_REFERENCE,
UNARY_EXPRESSION = $__3.UNARY_EXPRESSION,
VARIABLE_DECLARATION = $__3.VARIABLE_DECLARATION,
VARIABLE_STATEMENT = $__3.VARIABLE_STATEMENT,
WHILE_STATEMENT = $__3.WHILE_STATEMENT,
WITH_STATEMENT = $__3.WITH_STATEMENT,
YIELD_EXPRESSION = $__3.YIELD_EXPRESSION;
;
var ParseTree = function ParseTree(type, location) {
throw new Error("Don't use for now. 'super' is currently very slow.");
this.type = type;
this.location = location;
};
var $ParseTree = ParseTree;
($traceurRuntime.createClass)(ParseTree, {
isPattern: function() {
switch (this.type) {
case ARRAY_PATTERN:
case OBJECT_PATTERN:
return true;
default:
return false;
}
},
isLeftHandSideExpression: function() {
switch (this.type) {
case THIS_EXPRESSION:
case CLASS_EXPRESSION:
case SUPER_EXPRESSION:
case IDENTIFIER_EXPRESSION:
case LITERAL_EXPRESSION:
case ARRAY_LITERAL_EXPRESSION:
case OBJECT_LITERAL_EXPRESSION:
case NEW_EXPRESSION:
case MEMBER_EXPRESSION:
case MEMBER_LOOKUP_EXPRESSION:
case CALL_EXPRESSION:
case FUNCTION_EXPRESSION:
case TEMPLATE_LITERAL_EXPRESSION:
return true;
case PAREN_EXPRESSION:
return this.expression.isLeftHandSideExpression();
default:
return false;
}
},
isAssignmentExpression: function() {
switch (this.type) {
case ARRAY_COMPREHENSION:
case ARRAY_LITERAL_EXPRESSION:
case ARROW_FUNCTION_EXPRESSION:
case AWAIT_EXPRESSION:
case BINARY_EXPRESSION:
case CALL_EXPRESSION:
case CLASS_EXPRESSION:
case CONDITIONAL_EXPRESSION:
case FUNCTION_EXPRESSION:
case GENERATOR_COMPREHENSION:
case IDENTIFIER_EXPRESSION:
case LITERAL_EXPRESSION:
case MEMBER_EXPRESSION:
case MEMBER_LOOKUP_EXPRESSION:
case NEW_EXPRESSION:
case OBJECT_LITERAL_EXPRESSION:
case PAREN_EXPRESSION:
case POSTFIX_EXPRESSION:
case TEMPLATE_LITERAL_EXPRESSION:
case SUPER_EXPRESSION:
case THIS_EXPRESSION:
case UNARY_EXPRESSION:
case YIELD_EXPRESSION:
return true;
default:
return false;
}
},
isMemberExpression: function() {
switch (this.type) {
case THIS_EXPRESSION:
case CLASS_EXPRESSION:
case SUPER_EXPRESSION:
case IDENTIFIER_EXPRESSION:
case LITERAL_EXPRESSION:
case ARRAY_LITERAL_EXPRESSION:
case OBJECT_LITERAL_EXPRESSION:
case PAREN_EXPRESSION:
case TEMPLATE_LITERAL_EXPRESSION:
case FUNCTION_EXPRESSION:
case MEMBER_LOOKUP_EXPRESSION:
case MEMBER_EXPRESSION:
case CALL_EXPRESSION:
return true;
case NEW_EXPRESSION:
return this.args != null;
}
return false;
},
isExpression: function() {
return this.isAssignmentExpression() || this.type == COMMA_EXPRESSION;
},
isAssignmentOrSpread: function() {
return this.isAssignmentExpression() || this.type == SPREAD_EXPRESSION;
},
isRestParameter: function() {
return this.type == REST_PARAMETER || (this.type == FORMAL_PARAMETER && this.parameter.isRestParameter());
},
isSpreadPatternElement: function() {
return this.type == SPREAD_PATTERN_ELEMENT;
},
isStatementListItem: function() {
return this.isStatement() || this.isDeclaration();
},
isStatement: function() {
switch (this.type) {
case BLOCK:
case VARIABLE_STATEMENT:
case EMPTY_STATEMENT:
case EXPRESSION_STATEMENT:
case IF_STATEMENT:
case CONTINUE_STATEMENT:
case BREAK_STATEMENT:
case RETURN_STATEMENT:
case WITH_STATEMENT:
case LABELLED_STATEMENT:
case THROW_STATEMENT:
case TRY_STATEMENT:
case DEBUGGER_STATEMENT:
return true;
}
return this.isBreakableStatement();
},
isDeclaration: function() {
switch (this.type) {
case FUNCTION_DECLARATION:
case CLASS_DECLARATION:
return true;
}
return this.isLexicalDeclaration();
},
isLexicalDeclaration: function() {
switch (this.type) {
case VARIABLE_STATEMENT:
return this.declarations.declarationType !== VAR;
}
return false;
},
isBreakableStatement: function() {
switch (this.type) {
case SWITCH_STATEMENT:
return true;
}
return this.isIterationStatement();
},
isIterationStatement: function() {
switch (this.type) {
case DO_WHILE_STATEMENT:
case FOR_IN_STATEMENT:
case FOR_OF_STATEMENT:
case FOR_STATEMENT:
case WHILE_STATEMENT:
return true;
}
return false;
},
isScriptElement: function() {
switch (this.type) {
case CLASS_DECLARATION:
case EXPORT_DECLARATION:
case FUNCTION_DECLARATION:
case IMPORT_DECLARATION:
case MODULE_DECLARATION:
case VARIABLE_DECLARATION:
return true;
}
return this.isStatement();
},
isGenerator: function() {
return this.functionKind !== null && this.functionKind.type === STAR;
},
isAsyncFunction: function() {
return this.functionKind !== null && this.functionKind.type === IDENTIFIER && this.functionKind.value === ASYNC;
},
isType: function() {
switch (this.type) {
case PREDEFINED_TYPE:
case TYPE_REFERENCE:
return true;
}
return false;
},
getDirectivePrologueStringToken_: function() {
var tree = this;
if (tree.type !== EXPRESSION_STATEMENT || !(tree = tree.expression))
return null;
if (tree.type !== LITERAL_EXPRESSION || !(tree = tree.literalToken))
return null;
if (tree.type !== STRING)
return null;
return tree;
},
isDirectivePrologue: function() {
return this.getDirectivePrologueStringToken_() !== null;
},
isUseStrictDirective: function() {
var token = this.getDirectivePrologueStringToken_();
if (!token)
return false;
var v = token.value;
return v === '"use strict"' || v === "'use strict'";
},
toJSON: function() {
return utilJSON.transform(this, $ParseTree.replacer);
},
stringify: function() {
var indent = arguments[0] !== (void 0) ? arguments[0] : 2;
return JSON.stringify(this, $ParseTree.replacer, indent);
},
getStringValue: function() {
switch (this.type) {
case IDENTIFIER_EXPRESSION:
case BINDING_IDENTIFIER:
return this.identifierToken.toString();
case IMPORTED_BINDING:
return this.binding.getStringValue();
case PROPERTY_NAME_SHORTHAND:
return this.name.toString();
}
throw new Error('Not yet implemented');
}
}, {
stripLocation: function(key, value) {
if (key === 'location') {
return undefined;
}
return value;
},
replacer: function(k, v) {
if (v instanceof $ParseTree || v instanceof Token) {
var rv = {type: v.type};
Object.keys(v).forEach(function(name) {
if (name !== 'location')
rv[name] = v[name];
});
return rv;
}
return v;
}
});
return {
get ParseTreeType() {
return ParseTreeType;
},
get ParseTree() {
return ParseTree;
}
};
});
System.register("traceur@0.0.74/src/syntax/trees/ParseTrees", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/syntax/trees/ParseTrees";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/syntax/trees/ParseTrees", path);
}
var ParseTree = System.get("traceur@0.0.74/src/syntax/trees/ParseTree").ParseTree;
var ParseTreeType = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType");
var ANNOTATION = ParseTreeType.ANNOTATION;
var Annotation = function Annotation(location, name, args) {
this.location = location;
this.name = name;
this.args = args;
};
($traceurRuntime.createClass)(Annotation, {
transform: function(transformer) {
return transformer.transformAnnotation(this);
},
visit: function(visitor) {
visitor.visitAnnotation(this);
},
get type() {
return ANNOTATION;
}
}, {}, ParseTree);
var ANON_BLOCK = ParseTreeType.ANON_BLOCK;
var AnonBlock = function AnonBlock(location, statements) {
this.location = location;
this.statements = statements;
};
($traceurRuntime.createClass)(AnonBlock, {
transform: function(transformer) {
return transformer.transformAnonBlock(this);
},
visit: function(visitor) {
visitor.visitAnonBlock(this);
},
get type() {
return ANON_BLOCK;
}
}, {}, ParseTree);
var ARGUMENT_LIST = ParseTreeType.ARGUMENT_LIST;
var ArgumentList = function ArgumentList(location, args) {
this.location = location;
this.args = args;
};
($traceurRuntime.createClass)(ArgumentList, {
transform: function(transformer) {
return transformer.transformArgumentList(this);
},
visit: function(visitor) {
visitor.visitArgumentList(this);
},
get type() {
return ARGUMENT_LIST;
}
}, {}, ParseTree);
var ARRAY_COMPREHENSION = ParseTreeType.ARRAY_COMPREHENSION;
var ArrayComprehension = function ArrayComprehension(location, comprehensionList, expression) {
this.location = location;
this.comprehensionList = comprehensionList;
this.expression = expression;
};
($traceurRuntime.createClass)(ArrayComprehension, {
transform: function(transformer) {
return transformer.transformArrayComprehension(this);
},
visit: function(visitor) {
visitor.visitArrayComprehension(this);
},
get type() {
return ARRAY_COMPREHENSION;
}
}, {}, ParseTree);
var ARRAY_LITERAL_EXPRESSION = ParseTreeType.ARRAY_LITERAL_EXPRESSION;
var ArrayLiteralExpression = function ArrayLiteralExpression(location, elements) {
this.location = location;
this.elements = elements;
};
($traceurRuntime.createClass)(ArrayLiteralExpression, {
transform: function(transformer) {
return transformer.transformArrayLiteralExpression(this);
},
visit: function(visitor) {
visitor.visitArrayLiteralExpression(this);
},
get type() {
return ARRAY_LITERAL_EXPRESSION;
}
}, {}, ParseTree);
var ARRAY_PATTERN = ParseTreeType.ARRAY_PATTERN;
var ArrayPattern = function ArrayPattern(location, elements) {
this.location = location;
this.elements = elements;
};
($traceurRuntime.createClass)(ArrayPattern, {
transform: function(transformer) {
return transformer.transformArrayPattern(this);
},
visit: function(visitor) {
visitor.visitArrayPattern(this);
},
get type() {
return ARRAY_PATTERN;
}
}, {}, ParseTree);
var ARROW_FUNCTION_EXPRESSION = ParseTreeType.ARROW_FUNCTION_EXPRESSION;
var ArrowFunctionExpression = function ArrowFunctionExpression(location, functionKind, parameterList, body) {
this.location = location;
this.functionKind = functionKind;
this.parameterList = parameterList;
this.body = body;
};
($traceurRuntime.createClass)(ArrowFunctionExpression, {
transform: function(transformer) {
return transformer.transformArrowFunctionExpression(this);
},
visit: function(visitor) {
visitor.visitArrowFunctionExpression(this);
},
get type() {
return ARROW_FUNCTION_EXPRESSION;
}
}, {}, ParseTree);
var ASSIGNMENT_ELEMENT = ParseTreeType.ASSIGNMENT_ELEMENT;
var AssignmentElement = function AssignmentElement(location, assignment, initializer) {
this.location = location;
this.assignment = assignment;
this.initializer = initializer;
};
($traceurRuntime.createClass)(AssignmentElement, {
transform: function(transformer) {
return transformer.transformAssignmentElement(this);
},
visit: function(visitor) {
visitor.visitAssignmentElement(this);
},
get type() {
return ASSIGNMENT_ELEMENT;
}
}, {}, ParseTree);
var AWAIT_EXPRESSION = ParseTreeType.AWAIT_EXPRESSION;
var AwaitExpression = function AwaitExpression(location, expression) {
this.location = location;
this.expression = expression;
};
($traceurRuntime.createClass)(AwaitExpression, {
transform: function(transformer) {
return transformer.transformAwaitExpression(this);
},
visit: function(visitor) {
visitor.visitAwaitExpression(this);
},
get type() {
return AWAIT_EXPRESSION;
}
}, {}, ParseTree);
var BINARY_EXPRESSION = ParseTreeType.BINARY_EXPRESSION;
var BinaryExpression = function BinaryExpression(location, left, operator, right) {
this.location = location;
this.left = left;
this.operator = operator;
this.right = right;
};
($traceurRuntime.createClass)(BinaryExpression, {
transform: function(transformer) {
return transformer.transformBinaryExpression(this);
},
visit: function(visitor) {
visitor.visitBinaryExpression(this);
},
get type() {
return BINARY_EXPRESSION;
}
}, {}, ParseTree);
var BINDING_ELEMENT = ParseTreeType.BINDING_ELEMENT;
var BindingElement = function BindingElement(location, binding, initializer) {
this.location = location;
this.binding = binding;
this.initializer = initializer;
};
($traceurRuntime.createClass)(BindingElement, {
transform: function(transformer) {
return transformer.transformBindingElement(this);
},
visit: function(visitor) {
visitor.visitBindingElement(this);
},
get type() {
return BINDING_ELEMENT;
}
}, {}, ParseTree);
var BINDING_IDENTIFIER = ParseTreeType.BINDING_IDENTIFIER;
var BindingIdentifier = function BindingIdentifier(location, identifierToken) {
this.location = location;
this.identifierToken = identifierToken;
};
($traceurRuntime.createClass)(BindingIdentifier, {
transform: function(transformer) {
return transformer.transformBindingIdentifier(this);
},
visit: function(visitor) {
visitor.visitBindingIdentifier(this);
},
get type() {
return BINDING_IDENTIFIER;
}
}, {}, ParseTree);
var BLOCK = ParseTreeType.BLOCK;
var Block = function Block(location, statements) {
this.location = location;
this.statements = statements;
};
($traceurRuntime.createClass)(Block, {
transform: function(transformer) {
return transformer.transformBlock(this);
},
visit: function(visitor) {
visitor.visitBlock(this);
},
get type() {
return BLOCK;
}
}, {}, ParseTree);
var BREAK_STATEMENT = ParseTreeType.BREAK_STATEMENT;
var BreakStatement = function BreakStatement(location, name) {
this.location = location;
this.name = name;
};
($traceurRuntime.createClass)(BreakStatement, {
transform: function(transformer) {
return transformer.transformBreakStatement(this);
},
visit: function(visitor) {
visitor.visitBreakStatement(this);
},
get type() {
return BREAK_STATEMENT;
}
}, {}, ParseTree);
var CALL_EXPRESSION = ParseTreeType.CALL_EXPRESSION;
var CallExpression = function CallExpression(location, operand, args) {
this.location = location;
this.operand = operand;
this.args = args;
};
($traceurRuntime.createClass)(CallExpression, {
transform: function(transformer) {
return transformer.transformCallExpression(this);
},
visit: function(visitor) {
visitor.visitCallExpression(this);
},
get type() {
return CALL_EXPRESSION;
}
}, {}, ParseTree);
var CASE_CLAUSE = ParseTreeType.CASE_CLAUSE;
var CaseClause = function CaseClause(location, expression, statements) {
this.location = location;
this.expression = expression;
this.statements = statements;
};
($traceurRuntime.createClass)(CaseClause, {
transform: function(transformer) {
return transformer.transformCaseClause(this);
},
visit: function(visitor) {
visitor.visitCaseClause(this);
},
get type() {
return CASE_CLAUSE;
}
}, {}, ParseTree);
var CATCH = ParseTreeType.CATCH;
var Catch = function Catch(location, binding, catchBody) {
this.location = location;
this.binding = binding;
this.catchBody = catchBody;
};
($traceurRuntime.createClass)(Catch, {
transform: function(transformer) {
return transformer.transformCatch(this);
},
visit: function(visitor) {
visitor.visitCatch(this);
},
get type() {
return CATCH;
}
}, {}, ParseTree);
var CLASS_DECLARATION = ParseTreeType.CLASS_DECLARATION;
var ClassDeclaration = function ClassDeclaration(location, name, superClass, elements, annotations) {
this.location = location;
this.name = name;
this.superClass = superClass;
this.elements = elements;
this.annotations = annotations;
};
($traceurRuntime.createClass)(ClassDeclaration, {
transform: function(transformer) {
return transformer.transformClassDeclaration(this);
},
visit: function(visitor) {
visitor.visitClassDeclaration(this);
},
get type() {
return CLASS_DECLARATION;
}
}, {}, ParseTree);
var CLASS_EXPRESSION = ParseTreeType.CLASS_EXPRESSION;
var ClassExpression = function ClassExpression(location, name, superClass, elements, annotations) {
this.location = location;
this.name = name;
this.superClass = superClass;
this.elements = elements;
this.annotations = annotations;
};
($traceurRuntime.createClass)(ClassExpression, {
transform: function(transformer) {
return transformer.transformClassExpression(this);
},
visit: function(visitor) {
visitor.visitClassExpression(this);
},
get type() {
return CLASS_EXPRESSION;
}
}, {}, ParseTree);
var COMMA_EXPRESSION = ParseTreeType.COMMA_EXPRESSION;
var CommaExpression = function CommaExpression(location, expressions) {
this.location = location;
this.expressions = expressions;
};
($traceurRuntime.createClass)(CommaExpression, {
transform: function(transformer) {
return transformer.transformCommaExpression(this);
},
visit: function(visitor) {
visitor.visitCommaExpression(this);
},
get type() {
return COMMA_EXPRESSION;
}
}, {}, ParseTree);
var COMPREHENSION_FOR = ParseTreeType.COMPREHENSION_FOR;
var ComprehensionFor = function ComprehensionFor(location, left, iterator) {
this.location = location;
this.left = left;
this.iterator = iterator;
};
($traceurRuntime.createClass)(ComprehensionFor, {
transform: function(transformer) {
return transformer.transformComprehensionFor(this);
},
visit: function(visitor) {
visitor.visitComprehensionFor(this);
},
get type() {
return COMPREHENSION_FOR;
}
}, {}, ParseTree);
var COMPREHENSION_IF = ParseTreeType.COMPREHENSION_IF;
var ComprehensionIf = function ComprehensionIf(location, expression) {
this.location = location;
this.expression = expression;
};
($traceurRuntime.createClass)(ComprehensionIf, {
transform: function(transformer) {
return transformer.transformComprehensionIf(this);
},
visit: function(visitor) {
visitor.visitComprehensionIf(this);
},
get type() {
return COMPREHENSION_IF;
}
}, {}, ParseTree);
var COMPUTED_PROPERTY_NAME = ParseTreeType.COMPUTED_PROPERTY_NAME;
var ComputedPropertyName = function ComputedPropertyName(location, expression) {
this.location = location;
this.expression = expression;
};
($traceurRuntime.createClass)(ComputedPropertyName, {
transform: function(transformer) {
return transformer.transformComputedPropertyName(this);
},
visit: function(visitor) {
visitor.visitComputedPropertyName(this);
},
get type() {
return COMPUTED_PROPERTY_NAME;
}
}, {}, ParseTree);
var CONDITIONAL_EXPRESSION = ParseTreeType.CONDITIONAL_EXPRESSION;
var ConditionalExpression = function ConditionalExpression(location, condition, left, right) {
this.location = location;
this.condition = condition;
this.left = left;
this.right = right;
};
($traceurRuntime.createClass)(ConditionalExpression, {
transform: function(transformer) {
return transformer.transformConditionalExpression(this);
},
visit: function(visitor) {
visitor.visitConditionalExpression(this);
},
get type() {
return CONDITIONAL_EXPRESSION;
}
}, {}, ParseTree);
var CONTINUE_STATEMENT = ParseTreeType.CONTINUE_STATEMENT;
var ContinueStatement = function ContinueStatement(location, name) {
this.location = location;
this.name = name;
};
($traceurRuntime.createClass)(ContinueStatement, {
transform: function(transformer) {
return transformer.transformContinueStatement(this);
},
visit: function(visitor) {
visitor.visitContinueStatement(this);
},
get type() {
return CONTINUE_STATEMENT;
}
}, {}, ParseTree);
var COVER_FORMALS = ParseTreeType.COVER_FORMALS;
var CoverFormals = function CoverFormals(location, expressions) {
this.location = location;
this.expressions = expressions;
};
($traceurRuntime.createClass)(CoverFormals, {
transform: function(transformer) {
return transformer.transformCoverFormals(this);
},
visit: function(visitor) {
visitor.visitCoverFormals(this);
},
get type() {
return COVER_FORMALS;
}
}, {}, ParseTree);
var COVER_INITIALIZED_NAME = ParseTreeType.COVER_INITIALIZED_NAME;
var CoverInitializedName = function CoverInitializedName(location, name, equalToken, initializer) {
this.location = location;
this.name = name;
this.equalToken = equalToken;
this.initializer = initializer;
};
($traceurRuntime.createClass)(CoverInitializedName, {
transform: function(transformer) {
return transformer.transformCoverInitializedName(this);
},
visit: function(visitor) {
visitor.visitCoverInitializedName(this);
},
get type() {
return COVER_INITIALIZED_NAME;
}
}, {}, ParseTree);
var DEBUGGER_STATEMENT = ParseTreeType.DEBUGGER_STATEMENT;
var DebuggerStatement = function DebuggerStatement(location) {
this.location = location;
};
($traceurRuntime.createClass)(DebuggerStatement, {
transform: function(transformer) {
return transformer.transformDebuggerStatement(this);
},
visit: function(visitor) {
visitor.visitDebuggerStatement(this);
},
get type() {
return DEBUGGER_STATEMENT;
}
}, {}, ParseTree);
var DEFAULT_CLAUSE = ParseTreeType.DEFAULT_CLAUSE;
var DefaultClause = function DefaultClause(location, statements) {
this.location = location;
this.statements = statements;
};
($traceurRuntime.createClass)(DefaultClause, {
transform: function(transformer) {
return transformer.transformDefaultClause(this);
},
visit: function(visitor) {
visitor.visitDefaultClause(this);
},
get type() {
return DEFAULT_CLAUSE;
}
}, {}, ParseTree);
var DO_WHILE_STATEMENT = ParseTreeType.DO_WHILE_STATEMENT;
var DoWhileStatement = function DoWhileStatement(location, body, condition) {
this.location = location;
this.body = body;
this.condition = condition;
};
($traceurRuntime.createClass)(DoWhileStatement, {
transform: function(transformer) {
return transformer.transformDoWhileStatement(this);
},
visit: function(visitor) {
visitor.visitDoWhileStatement(this);
},
get type() {
return DO_WHILE_STATEMENT;
}
}, {}, ParseTree);
var EMPTY_STATEMENT = ParseTreeType.EMPTY_STATEMENT;
var EmptyStatement = function EmptyStatement(location) {
this.location = location;
};
($traceurRuntime.createClass)(EmptyStatement, {
transform: function(transformer) {
return transformer.transformEmptyStatement(this);
},
visit: function(visitor) {
visitor.visitEmptyStatement(this);
},
get type() {
return EMPTY_STATEMENT;
}
}, {}, ParseTree);
var EXPORT_DECLARATION = ParseTreeType.EXPORT_DECLARATION;
var ExportDeclaration = function ExportDeclaration(location, declaration, annotations) {
this.location = location;
this.declaration = declaration;
this.annotations = annotations;
};
($traceurRuntime.createClass)(ExportDeclaration, {
transform: function(transformer) {
return transformer.transformExportDeclaration(this);
},
visit: function(visitor) {
visitor.visitExportDeclaration(this);
},
get type() {
return EXPORT_DECLARATION;
}
}, {}, ParseTree);
var EXPORT_DEFAULT = ParseTreeType.EXPORT_DEFAULT;
var ExportDefault = function ExportDefault(location, expression) {
this.location = location;
this.expression = expression;
};
($traceurRuntime.createClass)(ExportDefault, {
transform: function(transformer) {
return transformer.transformExportDefault(this);
},
visit: function(visitor) {
visitor.visitExportDefault(this);
},
get type() {
return EXPORT_DEFAULT;
}
}, {}, ParseTree);
var EXPORT_SPECIFIER = ParseTreeType.EXPORT_SPECIFIER;
var ExportSpecifier = function ExportSpecifier(location, lhs, rhs) {
this.location = location;
this.lhs = lhs;
this.rhs = rhs;
};
($traceurRuntime.createClass)(ExportSpecifier, {
transform: function(transformer) {
return transformer.transformExportSpecifier(this);
},
visit: function(visitor) {
visitor.visitExportSpecifier(this);
},
get type() {
return EXPORT_SPECIFIER;
}
}, {}, ParseTree);
var EXPORT_SPECIFIER_SET = ParseTreeType.EXPORT_SPECIFIER_SET;
var ExportSpecifierSet = function ExportSpecifierSet(location, specifiers) {
this.location = location;
this.specifiers = specifiers;
};
($traceurRuntime.createClass)(ExportSpecifierSet, {
transform: function(transformer) {
return transformer.transformExportSpecifierSet(this);
},
visit: function(visitor) {
visitor.visitExportSpecifierSet(this);
},
get type() {
return EXPORT_SPECIFIER_SET;
}
}, {}, ParseTree);
var EXPORT_STAR = ParseTreeType.EXPORT_STAR;
var ExportStar = function ExportStar(location) {
this.location = location;
};
($traceurRuntime.createClass)(ExportStar, {
transform: function(transformer) {
return transformer.transformExportStar(this);
},
visit: function(visitor) {
visitor.visitExportStar(this);
},
get type() {
return EXPORT_STAR;
}
}, {}, ParseTree);
var EXPRESSION_STATEMENT = ParseTreeType.EXPRESSION_STATEMENT;
var ExpressionStatement = function ExpressionStatement(location, expression) {
this.location = location;
this.expression = expression;
};
($traceurRuntime.createClass)(ExpressionStatement, {
transform: function(transformer) {
return transformer.transformExpressionStatement(this);
},
visit: function(visitor) {
visitor.visitExpressionStatement(this);
},
get type() {
return EXPRESSION_STATEMENT;
}
}, {}, ParseTree);
var FINALLY = ParseTreeType.FINALLY;
var Finally = function Finally(location, block) {
this.location = location;
this.block = block;
};
($traceurRuntime.createClass)(Finally, {
transform: function(transformer) {
return transformer.transformFinally(this);
},
visit: function(visitor) {
visitor.visitFinally(this);
},
get type() {
return FINALLY;
}
}, {}, ParseTree);
var FOR_IN_STATEMENT = ParseTreeType.FOR_IN_STATEMENT;
var ForInStatement = function ForInStatement(location, initializer, collection, body) {
this.location = location;
this.initializer = initializer;
this.collection = collection;
this.body = body;
};
($traceurRuntime.createClass)(ForInStatement, {
transform: function(transformer) {
return transformer.transformForInStatement(this);
},
visit: function(visitor) {
visitor.visitForInStatement(this);
},
get type() {
return FOR_IN_STATEMENT;
}
}, {}, ParseTree);
var FOR_OF_STATEMENT = ParseTreeType.FOR_OF_STATEMENT;
var ForOfStatement = function ForOfStatement(location, initializer, collection, body) {
this.location = location;
this.initializer = initializer;
this.collection = collection;
this.body = body;
};
($traceurRuntime.createClass)(ForOfStatement, {
transform: function(transformer) {
return transformer.transformForOfStatement(this);
},
visit: function(visitor) {
visitor.visitForOfStatement(this);
},
get type() {
return FOR_OF_STATEMENT;
}
}, {}, ParseTree);
var FOR_STATEMENT = ParseTreeType.FOR_STATEMENT;
var ForStatement = function ForStatement(location, initializer, condition, increment, body) {
this.location = location;
this.initializer = initializer;
this.condition = condition;
this.increment = increment;
this.body = body;
};
($traceurRuntime.createClass)(ForStatement, {
transform: function(transformer) {
return transformer.transformForStatement(this);
},
visit: function(visitor) {
visitor.visitForStatement(this);
},
get type() {
return FOR_STATEMENT;
}
}, {}, ParseTree);
var FORMAL_PARAMETER = ParseTreeType.FORMAL_PARAMETER;
var FormalParameter = function FormalParameter(location, parameter, typeAnnotation, annotations) {
this.location = location;
this.parameter = parameter;
this.typeAnnotation = typeAnnotation;
this.annotations = annotations;
};
($traceurRuntime.createClass)(FormalParameter, {
transform: function(transformer) {
return transformer.transformFormalParameter(this);
},
visit: function(visitor) {
visitor.visitFormalParameter(this);
},
get type() {
return FORMAL_PARAMETER;
}
}, {}, ParseTree);
var FORMAL_PARAMETER_LIST = ParseTreeType.FORMAL_PARAMETER_LIST;
var FormalParameterList = function FormalParameterList(location, parameters) {
this.location = location;
this.parameters = parameters;
};
($traceurRuntime.createClass)(FormalParameterList, {
transform: function(transformer) {
return transformer.transformFormalParameterList(this);
},
visit: function(visitor) {
visitor.visitFormalParameterList(this);
},
get type() {
return FORMAL_PARAMETER_LIST;
}
}, {}, ParseTree);
var FUNCTION_BODY = ParseTreeType.FUNCTION_BODY;
var FunctionBody = function FunctionBody(location, statements) {
this.location = location;
this.statements = statements;
};
($traceurRuntime.createClass)(FunctionBody, {
transform: function(transformer) {
return transformer.transformFunctionBody(this);
},
visit: function(visitor) {
visitor.visitFunctionBody(this);
},
get type() {
return FUNCTION_BODY;
}
}, {}, ParseTree);
var FUNCTION_DECLARATION = ParseTreeType.FUNCTION_DECLARATION;
var FunctionDeclaration = function FunctionDeclaration(location, name, functionKind, parameterList, typeAnnotation, annotations, body) {
this.location = location;
this.name = name;
this.functionKind = functionKind;
this.parameterList = parameterList;
this.typeAnnotation = typeAnnotation;
this.annotations = annotations;
this.body = body;
};
($traceurRuntime.createClass)(FunctionDeclaration, {
transform: function(transformer) {
return transformer.transformFunctionDeclaration(this);
},
visit: function(visitor) {
visitor.visitFunctionDeclaration(this);
},
get type() {
return FUNCTION_DECLARATION;
}
}, {}, ParseTree);
var FUNCTION_EXPRESSION = ParseTreeType.FUNCTION_EXPRESSION;
var FunctionExpression = function FunctionExpression(location, name, functionKind, parameterList, typeAnnotation, annotations, body) {
this.location = location;
this.name = name;
this.functionKind = functionKind;
this.parameterList = parameterList;
this.typeAnnotation = typeAnnotation;
this.annotations = annotations;
this.body = body;
};
($traceurRuntime.createClass)(FunctionExpression, {
transform: function(transformer) {
return transformer.transformFunctionExpression(this);
},
visit: function(visitor) {
visitor.visitFunctionExpression(this);
},
get type() {
return FUNCTION_EXPRESSION;
}
}, {}, ParseTree);
var GENERATOR_COMPREHENSION = ParseTreeType.GENERATOR_COMPREHENSION;
var GeneratorComprehension = function GeneratorComprehension(location, comprehensionList, expression) {
this.location = location;
this.comprehensionList = comprehensionList;
this.expression = expression;
};
($traceurRuntime.createClass)(GeneratorComprehension, {
transform: function(transformer) {
return transformer.transformGeneratorComprehension(this);
},
visit: function(visitor) {
visitor.visitGeneratorComprehension(this);
},
get type() {
return GENERATOR_COMPREHENSION;
}
}, {}, ParseTree);
var GET_ACCESSOR = ParseTreeType.GET_ACCESSOR;
var GetAccessor = function GetAccessor(location, isStatic, name, typeAnnotation, annotations, body) {
this.location = location;
this.isStatic = isStatic;
this.name = name;
this.typeAnnotation = typeAnnotation;
this.annotations = annotations;
this.body = body;
};
($traceurRuntime.createClass)(GetAccessor, {
transform: function(transformer) {
return transformer.transformGetAccessor(this);
},
visit: function(visitor) {
visitor.visitGetAccessor(this);
},
get type() {
return GET_ACCESSOR;
}
}, {}, ParseTree);
var IDENTIFIER_EXPRESSION = ParseTreeType.IDENTIFIER_EXPRESSION;
var IdentifierExpression = function IdentifierExpression(location, identifierToken) {
this.location = location;
this.identifierToken = identifierToken;
};
($traceurRuntime.createClass)(IdentifierExpression, {
transform: function(transformer) {
return transformer.transformIdentifierExpression(this);
},
visit: function(visitor) {
visitor.visitIdentifierExpression(this);
},
get type() {
return IDENTIFIER_EXPRESSION;
}
}, {}, ParseTree);
var IF_STATEMENT = ParseTreeType.IF_STATEMENT;
var IfStatement = function IfStatement(location, condition, ifClause, elseClause) {
this.location = location;
this.condition = condition;
this.ifClause = ifClause;
this.elseClause = elseClause;
};
($traceurRuntime.createClass)(IfStatement, {
transform: function(transformer) {
return transformer.transformIfStatement(this);
},
visit: function(visitor) {
visitor.visitIfStatement(this);
},
get type() {
return IF_STATEMENT;
}
}, {}, ParseTree);
var IMPORTED_BINDING = ParseTreeType.IMPORTED_BINDING;
var ImportedBinding = function ImportedBinding(location, binding) {
this.location = location;
this.binding = binding;
};
($traceurRuntime.createClass)(ImportedBinding, {
transform: function(transformer) {
return transformer.transformImportedBinding(this);
},
visit: function(visitor) {
visitor.visitImportedBinding(this);
},
get type() {
return IMPORTED_BINDING;
}
}, {}, ParseTree);
var IMPORT_DECLARATION = ParseTreeType.IMPORT_DECLARATION;
var ImportDeclaration = function ImportDeclaration(location, importClause, moduleSpecifier) {
this.location = location;
this.importClause = importClause;
this.moduleSpecifier = moduleSpecifier;
};
($traceurRuntime.createClass)(ImportDeclaration, {
transform: function(transformer) {
return transformer.transformImportDeclaration(this);
},
visit: function(visitor) {
visitor.visitImportDeclaration(this);
},
get type() {
return IMPORT_DECLARATION;
}
}, {}, ParseTree);
var IMPORT_SPECIFIER = ParseTreeType.IMPORT_SPECIFIER;
var ImportSpecifier = function ImportSpecifier(location, binding, name) {
this.location = location;
this.binding = binding;
this.name = name;
};
($traceurRuntime.createClass)(ImportSpecifier, {
transform: function(transformer) {
return transformer.transformImportSpecifier(this);
},
visit: function(visitor) {
visitor.visitImportSpecifier(this);
},
get type() {
return IMPORT_SPECIFIER;
}
}, {}, ParseTree);
var IMPORT_SPECIFIER_SET = ParseTreeType.IMPORT_SPECIFIER_SET;
var ImportSpecifierSet = function ImportSpecifierSet(location, specifiers) {
this.location = location;
this.specifiers = specifiers;
};
($traceurRuntime.createClass)(ImportSpecifierSet, {
transform: function(transformer) {
return transformer.transformImportSpecifierSet(this);
},
visit: function(visitor) {
visitor.visitImportSpecifierSet(this);
},
get type() {
return IMPORT_SPECIFIER_SET;
}
}, {}, ParseTree);
var LABELLED_STATEMENT = ParseTreeType.LABELLED_STATEMENT;
var LabelledStatement = function LabelledStatement(location, name, statement) {
this.location = location;
this.name = name;
this.statement = statement;
};
($traceurRuntime.createClass)(LabelledStatement, {
transform: function(transformer) {
return transformer.transformLabelledStatement(this);
},
visit: function(visitor) {
visitor.visitLabelledStatement(this);
},
get type() {
return LABELLED_STATEMENT;
}
}, {}, ParseTree);
var LITERAL_EXPRESSION = ParseTreeType.LITERAL_EXPRESSION;
var LiteralExpression = function LiteralExpression(location, literalToken) {
this.location = location;
this.literalToken = literalToken;
};
($traceurRuntime.createClass)(LiteralExpression, {
transform: function(transformer) {
return transformer.transformLiteralExpression(this);
},
visit: function(visitor) {
visitor.visitLiteralExpression(this);
},
get type() {
return LITERAL_EXPRESSION;
}
}, {}, ParseTree);
var LITERAL_PROPERTY_NAME = ParseTreeType.LITERAL_PROPERTY_NAME;
var LiteralPropertyName = function LiteralPropertyName(location, literalToken) {
this.location = location;
this.literalToken = literalToken;
};
($traceurRuntime.createClass)(LiteralPropertyName, {
transform: function(transformer) {
return transformer.transformLiteralPropertyName(this);
},
visit: function(visitor) {
visitor.visitLiteralPropertyName(this);
},
get type() {
return LITERAL_PROPERTY_NAME;
}
}, {}, ParseTree);
var MEMBER_EXPRESSION = ParseTreeType.MEMBER_EXPRESSION;
var MemberExpression = function MemberExpression(location, operand, memberName) {
this.location = location;
this.operand = operand;
this.memberName = memberName;
};
($traceurRuntime.createClass)(MemberExpression, {
transform: function(transformer) {
return transformer.transformMemberExpression(this);
},
visit: function(visitor) {
visitor.visitMemberExpression(this);
},
get type() {
return MEMBER_EXPRESSION;
}
}, {}, ParseTree);
var MEMBER_LOOKUP_EXPRESSION = ParseTreeType.MEMBER_LOOKUP_EXPRESSION;
var MemberLookupExpression = function MemberLookupExpression(location, operand, memberExpression) {
this.location = location;
this.operand = operand;
this.memberExpression = memberExpression;
};
($traceurRuntime.createClass)(MemberLookupExpression, {
transform: function(transformer) {
return transformer.transformMemberLookupExpression(this);
},
visit: function(visitor) {
visitor.visitMemberLookupExpression(this);
},
get type() {
return MEMBER_LOOKUP_EXPRESSION;
}
}, {}, ParseTree);
var MODULE = ParseTreeType.MODULE;
var Module = function Module(location, scriptItemList, moduleName) {
this.location = location;
this.scriptItemList = scriptItemList;
this.moduleName = moduleName;
};
($traceurRuntime.createClass)(Module, {
transform: function(transformer) {
return transformer.transformModule(this);
},
visit: function(visitor) {
visitor.visitModule(this);
},
get type() {
return MODULE;
}
}, {}, ParseTree);
var MODULE_DECLARATION = ParseTreeType.MODULE_DECLARATION;
var ModuleDeclaration = function ModuleDeclaration(location, binding, expression) {
this.location = location;
this.binding = binding;
this.expression = expression;
};
($traceurRuntime.createClass)(ModuleDeclaration, {
transform: function(transformer) {
return transformer.transformModuleDeclaration(this);
},
visit: function(visitor) {
visitor.visitModuleDeclaration(this);
},
get type() {
return MODULE_DECLARATION;
}
}, {}, ParseTree);
var MODULE_SPECIFIER = ParseTreeType.MODULE_SPECIFIER;
var ModuleSpecifier = function ModuleSpecifier(location, token) {
this.location = location;
this.token = token;
};
($traceurRuntime.createClass)(ModuleSpecifier, {
transform: function(transformer) {
return transformer.transformModuleSpecifier(this);
},
visit: function(visitor) {
visitor.visitModuleSpecifier(this);
},
get type() {
return MODULE_SPECIFIER;
}
}, {}, ParseTree);
var NAMED_EXPORT = ParseTreeType.NAMED_EXPORT;
var NamedExport = function NamedExport(location, moduleSpecifier, specifierSet) {
this.location = location;
this.moduleSpecifier = moduleSpecifier;
this.specifierSet = specifierSet;
};
($traceurRuntime.createClass)(NamedExport, {
transform: function(transformer) {
return transformer.transformNamedExport(this);
},
visit: function(visitor) {
visitor.visitNamedExport(this);
},
get type() {
return NAMED_EXPORT;
}
}, {}, ParseTree);
var NEW_EXPRESSION = ParseTreeType.NEW_EXPRESSION;
var NewExpression = function NewExpression(location, operand, args) {
this.location = location;
this.operand = operand;
this.args = args;
};
($traceurRuntime.createClass)(NewExpression, {
transform: function(transformer) {
return transformer.transformNewExpression(this);
},
visit: function(visitor) {
visitor.visitNewExpression(this);
},
get type() {
return NEW_EXPRESSION;
}
}, {}, ParseTree);
var OBJECT_LITERAL_EXPRESSION = ParseTreeType.OBJECT_LITERAL_EXPRESSION;
var ObjectLiteralExpression = function ObjectLiteralExpression(location, propertyNameAndValues) {
this.location = location;
this.propertyNameAndValues = propertyNameAndValues;
};
($traceurRuntime.createClass)(ObjectLiteralExpression, {
transform: function(transformer) {
return transformer.transformObjectLiteralExpression(this);
},
visit: function(visitor) {
visitor.visitObjectLiteralExpression(this);
},
get type() {
return OBJECT_LITERAL_EXPRESSION;
}
}, {}, ParseTree);
var OBJECT_PATTERN = ParseTreeType.OBJECT_PATTERN;
var ObjectPattern = function ObjectPattern(location, fields) {
this.location = location;
this.fields = fields;
};
($traceurRuntime.createClass)(ObjectPattern, {
transform: function(transformer) {
return transformer.transformObjectPattern(this);
},
visit: function(visitor) {
visitor.visitObjectPattern(this);
},
get type() {
return OBJECT_PATTERN;
}
}, {}, ParseTree);
var OBJECT_PATTERN_FIELD = ParseTreeType.OBJECT_PATTERN_FIELD;
var ObjectPatternField = function ObjectPatternField(location, name, element) {
this.location = location;
this.name = name;
this.element = element;
};
($traceurRuntime.createClass)(ObjectPatternField, {
transform: function(transformer) {
return transformer.transformObjectPatternField(this);
},
visit: function(visitor) {
visitor.visitObjectPatternField(this);
},
get type() {
return OBJECT_PATTERN_FIELD;
}
}, {}, ParseTree);
var PAREN_EXPRESSION = ParseTreeType.PAREN_EXPRESSION;
var ParenExpression = function ParenExpression(location, expression) {
this.location = location;
this.expression = expression;
};
($traceurRuntime.createClass)(ParenExpression, {
transform: function(transformer) {
return transformer.transformParenExpression(this);
},
visit: function(visitor) {
visitor.visitParenExpression(this);
},
get type() {
return PAREN_EXPRESSION;
}
}, {}, ParseTree);
var POSTFIX_EXPRESSION = ParseTreeType.POSTFIX_EXPRESSION;
var PostfixExpression = function PostfixExpression(location, operand, operator) {
this.location = location;
this.operand = operand;
this.operator = operator;
};
($traceurRuntime.createClass)(PostfixExpression, {
transform: function(transformer) {
return transformer.transformPostfixExpression(this);
},
visit: function(visitor) {
visitor.visitPostfixExpression(this);
},
get type() {
return POSTFIX_EXPRESSION;
}
}, {}, ParseTree);
var PREDEFINED_TYPE = ParseTreeType.PREDEFINED_TYPE;
var PredefinedType = function PredefinedType(location, typeToken) {
this.location = location;
this.typeToken = typeToken;
};
($traceurRuntime.createClass)(PredefinedType, {
transform: function(transformer) {
return transformer.transformPredefinedType(this);
},
visit: function(visitor) {
visitor.visitPredefinedType(this);
},
get type() {
return PREDEFINED_TYPE;
}
}, {}, ParseTree);
var SCRIPT = ParseTreeType.SCRIPT;
var Script = function Script(location, scriptItemList, moduleName) {
this.location = location;
this.scriptItemList = scriptItemList;
this.moduleName = moduleName;
};
($traceurRuntime.createClass)(Script, {
transform: function(transformer) {
return transformer.transformScript(this);
},
visit: function(visitor) {
visitor.visitScript(this);
},
get type() {
return SCRIPT;
}
}, {}, ParseTree);
var PROPERTY_METHOD_ASSIGNMENT = ParseTreeType.PROPERTY_METHOD_ASSIGNMENT;
var PropertyMethodAssignment = function PropertyMethodAssignment(location, isStatic, functionKind, name, parameterList, typeAnnotation, annotations, body) {
this.location = location;
this.isStatic = isStatic;
this.functionKind = functionKind;
this.name = name;
this.parameterList = parameterList;
this.typeAnnotation = typeAnnotation;
this.annotations = annotations;
this.body = body;
};
($traceurRuntime.createClass)(PropertyMethodAssignment, {
transform: function(transformer) {
return transformer.transformPropertyMethodAssignment(this);
},
visit: function(visitor) {
visitor.visitPropertyMethodAssignment(this);
},
get type() {
return PROPERTY_METHOD_ASSIGNMENT;
}
}, {}, ParseTree);
var PROPERTY_NAME_ASSIGNMENT = ParseTreeType.PROPERTY_NAME_ASSIGNMENT;
var PropertyNameAssignment = function PropertyNameAssignment(location, name, value) {
this.location = location;
this.name = name;
this.value = value;
};
($traceurRuntime.createClass)(PropertyNameAssignment, {
transform: function(transformer) {
return transformer.transformPropertyNameAssignment(this);
},
visit: function(visitor) {
visitor.visitPropertyNameAssignment(this);
},
get type() {
return PROPERTY_NAME_ASSIGNMENT;
}
}, {}, ParseTree);
var PROPERTY_NAME_SHORTHAND = ParseTreeType.PROPERTY_NAME_SHORTHAND;
var PropertyNameShorthand = function PropertyNameShorthand(location, name) {
this.location = location;
this.name = name;
};
($traceurRuntime.createClass)(PropertyNameShorthand, {
transform: function(transformer) {
return transformer.transformPropertyNameShorthand(this);
},
visit: function(visitor) {
visitor.visitPropertyNameShorthand(this);
},
get type() {
return PROPERTY_NAME_SHORTHAND;
}
}, {}, ParseTree);
var PROPERTY_VARIABLE_DECLARATION = ParseTreeType.PROPERTY_VARIABLE_DECLARATION;
var PropertyVariableDeclaration = function PropertyVariableDeclaration(location, isStatic, name, typeAnnotation, annotations) {
this.location = location;
this.isStatic = isStatic;
this.name = name;
this.typeAnnotation = typeAnnotation;
this.annotations = annotations;
};
($traceurRuntime.createClass)(PropertyVariableDeclaration, {
transform: function(transformer) {
return transformer.transformPropertyVariableDeclaration(this);
},
visit: function(visitor) {
visitor.visitPropertyVariableDeclaration(this);
},
get type() {
return PROPERTY_VARIABLE_DECLARATION;
}
}, {}, ParseTree);
var REST_PARAMETER = ParseTreeType.REST_PARAMETER;
var RestParameter = function RestParameter(location, identifier) {
this.location = location;
this.identifier = identifier;
};
($traceurRuntime.createClass)(RestParameter, {
transform: function(transformer) {
return transformer.transformRestParameter(this);
},
visit: function(visitor) {
visitor.visitRestParameter(this);
},
get type() {
return REST_PARAMETER;
}
}, {}, ParseTree);
var RETURN_STATEMENT = ParseTreeType.RETURN_STATEMENT;
var ReturnStatement = function ReturnStatement(location, expression) {
this.location = location;
this.expression = expression;
};
($traceurRuntime.createClass)(ReturnStatement, {
transform: function(transformer) {
return transformer.transformReturnStatement(this);
},
visit: function(visitor) {
visitor.visitReturnStatement(this);
},
get type() {
return RETURN_STATEMENT;
}
}, {}, ParseTree);
var SET_ACCESSOR = ParseTreeType.SET_ACCESSOR;
var SetAccessor = function SetAccessor(location, isStatic, name, parameterList, annotations, body) {
this.location = location;
this.isStatic = isStatic;
this.name = name;
this.parameterList = parameterList;
this.annotations = annotations;
this.body = body;
};
($traceurRuntime.createClass)(SetAccessor, {
transform: function(transformer) {
return transformer.transformSetAccessor(this);
},
visit: function(visitor) {
visitor.visitSetAccessor(this);
},
get type() {
return SET_ACCESSOR;
}
}, {}, ParseTree);
var SPREAD_EXPRESSION = ParseTreeType.SPREAD_EXPRESSION;
var SpreadExpression = function SpreadExpression(location, expression) {
this.location = location;
this.expression = expression;
};
($traceurRuntime.createClass)(SpreadExpression, {
transform: function(transformer) {
return transformer.transformSpreadExpression(this);
},
visit: function(visitor) {
visitor.visitSpreadExpression(this);
},
get type() {
return SPREAD_EXPRESSION;
}
}, {}, ParseTree);
var SPREAD_PATTERN_ELEMENT = ParseTreeType.SPREAD_PATTERN_ELEMENT;
var SpreadPatternElement = function SpreadPatternElement(location, lvalue) {
this.location = location;
this.lvalue = lvalue;
};
($traceurRuntime.createClass)(SpreadPatternElement, {
transform: function(transformer) {
return transformer.transformSpreadPatternElement(this);
},
visit: function(visitor) {
visitor.visitSpreadPatternElement(this);
},
get type() {
return SPREAD_PATTERN_ELEMENT;
}
}, {}, ParseTree);
var SUPER_EXPRESSION = ParseTreeType.SUPER_EXPRESSION;
var SuperExpression = function SuperExpression(location) {
this.location = location;
};
($traceurRuntime.createClass)(SuperExpression, {
transform: function(transformer) {
return transformer.transformSuperExpression(this);
},
visit: function(visitor) {
visitor.visitSuperExpression(this);
},
get type() {
return SUPER_EXPRESSION;
}
}, {}, ParseTree);
var SWITCH_STATEMENT = ParseTreeType.SWITCH_STATEMENT;
var SwitchStatement = function SwitchStatement(location, expression, caseClauses) {
this.location = location;
this.expression = expression;
this.caseClauses = caseClauses;
};
($traceurRuntime.createClass)(SwitchStatement, {
transform: function(transformer) {
return transformer.transformSwitchStatement(this);
},
visit: function(visitor) {
visitor.visitSwitchStatement(this);
},
get type() {
return SWITCH_STATEMENT;
}
}, {}, ParseTree);
var SYNTAX_ERROR_TREE = ParseTreeType.SYNTAX_ERROR_TREE;
var SyntaxErrorTree = function SyntaxErrorTree(location, nextToken, message) {
this.location = location;
this.nextToken = nextToken;
this.message = message;
};
($traceurRuntime.createClass)(SyntaxErrorTree, {
transform: function(transformer) {
return transformer.transformSyntaxErrorTree(this);
},
visit: function(visitor) {
visitor.visitSyntaxErrorTree(this);
},
get type() {
return SYNTAX_ERROR_TREE;
}
}, {}, ParseTree);
var TEMPLATE_LITERAL_EXPRESSION = ParseTreeType.TEMPLATE_LITERAL_EXPRESSION;
var TemplateLiteralExpression = function TemplateLiteralExpression(location, operand, elements) {
this.location = location;
this.operand = operand;
this.elements = elements;
};
($traceurRuntime.createClass)(TemplateLiteralExpression, {
transform: function(transformer) {
return transformer.transformTemplateLiteralExpression(this);
},
visit: function(visitor) {
visitor.visitTemplateLiteralExpression(this);
},
get type() {
return TEMPLATE_LITERAL_EXPRESSION;
}
}, {}, ParseTree);
var TEMPLATE_LITERAL_PORTION = ParseTreeType.TEMPLATE_LITERAL_PORTION;
var TemplateLiteralPortion = function TemplateLiteralPortion(location, value) {
this.location = location;
this.value = value;
};
($traceurRuntime.createClass)(TemplateLiteralPortion, {
transform: function(transformer) {
return transformer.transformTemplateLiteralPortion(this);
},
visit: function(visitor) {
visitor.visitTemplateLiteralPortion(this);
},
get type() {
return TEMPLATE_LITERAL_PORTION;
}
}, {}, ParseTree);
var TEMPLATE_SUBSTITUTION = ParseTreeType.TEMPLATE_SUBSTITUTION;
var TemplateSubstitution = function TemplateSubstitution(location, expression) {
this.location = location;
this.expression = expression;
};
($traceurRuntime.createClass)(TemplateSubstitution, {
transform: function(transformer) {
return transformer.transformTemplateSubstitution(this);
},
visit: function(visitor) {
visitor.visitTemplateSubstitution(this);
},
get type() {
return TEMPLATE_SUBSTITUTION;
}
}, {}, ParseTree);
var THIS_EXPRESSION = ParseTreeType.THIS_EXPRESSION;
var ThisExpression = function ThisExpression(location) {
this.location = location;
};
($traceurRuntime.createClass)(ThisExpression, {
transform: function(transformer) {
return transformer.transformThisExpression(this);
},
visit: function(visitor) {
visitor.visitThisExpression(this);
},
get type() {
return THIS_EXPRESSION;
}
}, {}, ParseTree);
var THROW_STATEMENT = ParseTreeType.THROW_STATEMENT;
var ThrowStatement = function ThrowStatement(location, value) {
this.location = location;
this.value = value;
};
($traceurRuntime.createClass)(ThrowStatement, {
transform: function(transformer) {
return transformer.transformThrowStatement(this);
},
visit: function(visitor) {
visitor.visitThrowStatement(this);
},
get type() {
return THROW_STATEMENT;
}
}, {}, ParseTree);
var TRY_STATEMENT = ParseTreeType.TRY_STATEMENT;
var TryStatement = function TryStatement(location, body, catchBlock, finallyBlock) {
this.location = location;
this.body = body;
this.catchBlock = catchBlock;
this.finallyBlock = finallyBlock;
};
($traceurRuntime.createClass)(TryStatement, {
transform: function(transformer) {
return transformer.transformTryStatement(this);
},
visit: function(visitor) {
visitor.visitTryStatement(this);
},
get type() {
return TRY_STATEMENT;
}
}, {}, ParseTree);
var TYPE_ARGUMENTS = ParseTreeType.TYPE_ARGUMENTS;
var TypeArguments = function TypeArguments(location, args) {
this.location = location;
this.args = args;
};
($traceurRuntime.createClass)(TypeArguments, {
transform: function(transformer) {
return transformer.transformTypeArguments(this);
},
visit: function(visitor) {
visitor.visitTypeArguments(this);
},
get type() {
return TYPE_ARGUMENTS;
}
}, {}, ParseTree);
var TYPE_NAME = ParseTreeType.TYPE_NAME;
var TypeName = function TypeName(location, moduleName, name) {
this.location = location;
this.moduleName = moduleName;
this.name = name;
};
($traceurRuntime.createClass)(TypeName, {
transform: function(transformer) {
return transformer.transformTypeName(this);
},
visit: function(visitor) {
visitor.visitTypeName(this);
},
get type() {
return TYPE_NAME;
}
}, {}, ParseTree);
var TYPE_REFERENCE = ParseTreeType.TYPE_REFERENCE;
var TypeReference = function TypeReference(location, typeName, args) {
this.location = location;
this.typeName = typeName;
this.args = args;
};
($traceurRuntime.createClass)(TypeReference, {
transform: function(transformer) {
return transformer.transformTypeReference(this);
},
visit: function(visitor) {
visitor.visitTypeReference(this);
},
get type() {
return TYPE_REFERENCE;
}
}, {}, ParseTree);
var UNARY_EXPRESSION = ParseTreeType.UNARY_EXPRESSION;
var UnaryExpression = function UnaryExpression(location, operator, operand) {
this.location = location;
this.operator = operator;
this.operand = operand;
};
($traceurRuntime.createClass)(UnaryExpression, {
transform: function(transformer) {
return transformer.transformUnaryExpression(this);
},
visit: function(visitor) {
visitor.visitUnaryExpression(this);
},
get type() {
return UNARY_EXPRESSION;
}
}, {}, ParseTree);
var VARIABLE_DECLARATION = ParseTreeType.VARIABLE_DECLARATION;
var VariableDeclaration = function VariableDeclaration(location, lvalue, typeAnnotation, initializer) {
this.location = location;
this.lvalue = lvalue;
this.typeAnnotation = typeAnnotation;
this.initializer = initializer;
};
($traceurRuntime.createClass)(VariableDeclaration, {
transform: function(transformer) {
return transformer.transformVariableDeclaration(this);
},
visit: function(visitor) {
visitor.visitVariableDeclaration(this);
},
get type() {
return VARIABLE_DECLARATION;
}
}, {}, ParseTree);
var VARIABLE_DECLARATION_LIST = ParseTreeType.VARIABLE_DECLARATION_LIST;
var VariableDeclarationList = function VariableDeclarationList(location, declarationType, declarations) {
this.location = location;
this.declarationType = declarationType;
this.declarations = declarations;
};
($traceurRuntime.createClass)(VariableDeclarationList, {
transform: function(transformer) {
return transformer.transformVariableDeclarationList(this);
},
visit: function(visitor) {
visitor.visitVariableDeclarationList(this);
},
get type() {
return VARIABLE_DECLARATION_LIST;
}
}, {}, ParseTree);
var VARIABLE_STATEMENT = ParseTreeType.VARIABLE_STATEMENT;
var VariableStatement = function VariableStatement(location, declarations) {
this.location = location;
this.declarations = declarations;
};
($traceurRuntime.createClass)(VariableStatement, {
transform: function(transformer) {
return transformer.transformVariableStatement(this);
},
visit: function(visitor) {
visitor.visitVariableStatement(this);
},
get type() {
return VARIABLE_STATEMENT;
}
}, {}, ParseTree);
var WHILE_STATEMENT = ParseTreeType.WHILE_STATEMENT;
var WhileStatement = function WhileStatement(location, condition, body) {
this.location = location;
this.condition = condition;
this.body = body;
};
($traceurRuntime.createClass)(WhileStatement, {
transform: function(transformer) {
return transformer.transformWhileStatement(this);
},
visit: function(visitor) {
visitor.visitWhileStatement(this);
},
get type() {
return WHILE_STATEMENT;
}
}, {}, ParseTree);
var WITH_STATEMENT = ParseTreeType.WITH_STATEMENT;
var WithStatement = function WithStatement(location, expression, body) {
this.location = location;
this.expression = expression;
this.body = body;
};
($traceurRuntime.createClass)(WithStatement, {
transform: function(transformer) {
return transformer.transformWithStatement(this);
},
visit: function(visitor) {
visitor.visitWithStatement(this);
},
get type() {
return WITH_STATEMENT;
}
}, {}, ParseTree);
var YIELD_EXPRESSION = ParseTreeType.YIELD_EXPRESSION;
var YieldExpression = function YieldExpression(location, expression, isYieldFor) {
this.location = location;
this.expression = expression;
this.isYieldFor = isYieldFor;
};
($traceurRuntime.createClass)(YieldExpression, {
transform: function(transformer) {
return transformer.transformYieldExpression(this);
},
visit: function(visitor) {
visitor.visitYieldExpression(this);
},
get type() {
return YIELD_EXPRESSION;
}
}, {}, ParseTree);
return {
get Annotation() {
return Annotation;
},
get AnonBlock() {
return AnonBlock;
},
get ArgumentList() {
return ArgumentList;
},
get ArrayComprehension() {
return ArrayComprehension;
},
get ArrayLiteralExpression() {
return ArrayLiteralExpression;
},
get ArrayPattern() {
return ArrayPattern;
},
get ArrowFunctionExpression() {
return ArrowFunctionExpression;
},
get AssignmentElement() {
return AssignmentElement;
},
get AwaitExpression() {
return AwaitExpression;
},
get BinaryExpression() {
return BinaryExpression;
},
get BindingElement() {
return BindingElement;
},
get BindingIdentifier() {
return BindingIdentifier;
},
get Block() {
return Block;
},
get BreakStatement() {
return BreakStatement;
},
get CallExpression() {
return CallExpression;
},
get CaseClause() {
return CaseClause;
},
get Catch() {
return Catch;
},
get ClassDeclaration() {
return ClassDeclaration;
},
get ClassExpression() {
return ClassExpression;
},
get CommaExpression() {
return CommaExpression;
},
get ComprehensionFor() {
return ComprehensionFor;
},
get ComprehensionIf() {
return ComprehensionIf;
},
get ComputedPropertyName() {
return ComputedPropertyName;
},
get ConditionalExpression() {
return ConditionalExpression;
},
get ContinueStatement() {
return ContinueStatement;
},
get CoverFormals() {
return CoverFormals;
},
get CoverInitializedName() {
return CoverInitializedName;
},
get DebuggerStatement() {
return DebuggerStatement;
},
get DefaultClause() {
return DefaultClause;
},
get DoWhileStatement() {
return DoWhileStatement;
},
get EmptyStatement() {
return EmptyStatement;
},
get ExportDeclaration() {
return ExportDeclaration;
},
get ExportDefault() {
return ExportDefault;
},
get ExportSpecifier() {
return ExportSpecifier;
},
get ExportSpecifierSet() {
return ExportSpecifierSet;
},
get ExportStar() {
return ExportStar;
},
get ExpressionStatement() {
return ExpressionStatement;
},
get Finally() {
return Finally;
},
get ForInStatement() {
return ForInStatement;
},
get ForOfStatement() {
return ForOfStatement;
},
get ForStatement() {
return ForStatement;
},
get FormalParameter() {
return FormalParameter;
},
get FormalParameterList() {
return FormalParameterList;
},
get FunctionBody() {
return FunctionBody;
},
get FunctionDeclaration() {
return FunctionDeclaration;
},
get FunctionExpression() {
return FunctionExpression;
},
get GeneratorComprehension() {
return GeneratorComprehension;
},
get GetAccessor() {
return GetAccessor;
},
get IdentifierExpression() {
return IdentifierExpression;
},
get IfStatement() {
return IfStatement;
},
get ImportedBinding() {
return ImportedBinding;
},
get ImportDeclaration() {
return ImportDeclaration;
},
get ImportSpecifier() {
return ImportSpecifier;
},
get ImportSpecifierSet() {
return ImportSpecifierSet;
},
get LabelledStatement() {
return LabelledStatement;
},
get LiteralExpression() {
return LiteralExpression;
},
get LiteralPropertyName() {
return LiteralPropertyName;
},
get MemberExpression() {
return MemberExpression;
},
get MemberLookupExpression() {
return MemberLookupExpression;
},
get Module() {
return Module;
},
get ModuleDeclaration() {
return ModuleDeclaration;
},
get ModuleSpecifier() {
return ModuleSpecifier;
},
get NamedExport() {
return NamedExport;
},
get NewExpression() {
return NewExpression;
},
get ObjectLiteralExpression() {
return ObjectLiteralExpression;
},
get ObjectPattern() {
return ObjectPattern;
},
get ObjectPatternField() {
return ObjectPatternField;
},
get ParenExpression() {
return ParenExpression;
},
get PostfixExpression() {
return PostfixExpression;
},
get PredefinedType() {
return PredefinedType;
},
get Script() {
return Script;
},
get PropertyMethodAssignment() {
return PropertyMethodAssignment;
},
get PropertyNameAssignment() {
return PropertyNameAssignment;
},
get PropertyNameShorthand() {
return PropertyNameShorthand;
},
get PropertyVariableDeclaration() {
return PropertyVariableDeclaration;
},
get RestParameter() {
return RestParameter;
},
get ReturnStatement() {
return ReturnStatement;
},
get SetAccessor() {
return SetAccessor;
},
get SpreadExpression() {
return SpreadExpression;
},
get SpreadPatternElement() {
return SpreadPatternElement;
},
get SuperExpression() {
return SuperExpression;
},
get SwitchStatement() {
return SwitchStatement;
},
get SyntaxErrorTree() {
return SyntaxErrorTree;
},
get TemplateLiteralExpression() {
return TemplateLiteralExpression;
},
get TemplateLiteralPortion() {
return TemplateLiteralPortion;
},
get TemplateSubstitution() {
return TemplateSubstitution;
},
get ThisExpression() {
return ThisExpression;
},
get ThrowStatement() {
return ThrowStatement;
},
get TryStatement() {
return TryStatement;
},
get TypeArguments() {
return TypeArguments;
},
get TypeName() {
return TypeName;
},
get TypeReference() {
return TypeReference;
},
get UnaryExpression() {
return UnaryExpression;
},
get VariableDeclaration() {
return VariableDeclaration;
},
get VariableDeclarationList() {
return VariableDeclarationList;
},
get VariableStatement() {
return VariableStatement;
},
get WhileStatement() {
return WhileStatement;
},
get WithStatement() {
return WithStatement;
},
get YieldExpression() {
return YieldExpression;
}
};
});
System.register("traceur@0.0.74/src/util/assert", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/util/assert";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/util/assert", path);
}
var options = System.get("traceur@0.0.74/src/Options").options;
function assert(b) {
if (!b && options.debug)
throw Error('Assertion failed');
}
return {get assert() {
return assert;
}};
});
System.register("traceur@0.0.74/src/syntax/IdentifierToken", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/syntax/IdentifierToken";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/syntax/IdentifierToken", path);
}
var Token = System.get("traceur@0.0.74/src/syntax/Token").Token;
var IDENTIFIER = System.get("traceur@0.0.74/src/syntax/TokenType").IDENTIFIER;
var IdentifierToken = function IdentifierToken(location, value) {
this.location = location;
this.value = value;
};
($traceurRuntime.createClass)(IdentifierToken, {
toString: function() {
return this.value;
},
get type() {
return IDENTIFIER;
}
}, {}, Token);
return {get IdentifierToken() {
return IdentifierToken;
}};
});
System.register("traceur@0.0.74/src/syntax/LiteralToken", [], function() {
"use strict";
var $__3;
var __moduleName = "traceur@0.0.74/src/syntax/LiteralToken";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/syntax/LiteralToken", path);
}
var Token = System.get("traceur@0.0.74/src/syntax/Token").Token;
var $__1 = System.get("traceur@0.0.74/src/syntax/TokenType"),
NULL = $__1.NULL,
NUMBER = $__1.NUMBER,
STRING = $__1.STRING;
var StringParser = function StringParser(value) {
this.value = value;
this.index = 0;
};
($traceurRuntime.createClass)(StringParser, ($__3 = {}, Object.defineProperty($__3, Symbol.iterator, {
value: function() {
return this;
},
configurable: true,
enumerable: true,
writable: true
}), Object.defineProperty($__3, "next", {
value: function() {
if (++this.index >= this.value.length - 1)
return {
value: undefined,
done: true
};
return {
value: this.value[this.index],
done: false
};
},
configurable: true,
enumerable: true,
writable: true
}), Object.defineProperty($__3, "parse", {
value: function() {
if (this.value.indexOf('\\') === -1)
return this.value.slice(1, -1);
var result = '';
for (var $__4 = this[$traceurRuntime.toProperty(Symbol.iterator)](),
$__5; !($__5 = $__4.next()).done; ) {
var ch = $__5.value;
{
result += ch === '\\' ? this.parseEscapeSequence() : ch;
}
}
return result;
},
configurable: true,
enumerable: true,
writable: true
}), Object.defineProperty($__3, "parseEscapeSequence", {
value: function() {
var ch = this.next().value;
switch (ch) {
case '\n':
case '\r':
case '\u2028':
case '\u2029':
return '';
case '0':
return '\0';
case 'b':
return '\b';
case 'f':
return '\f';
case 'n':
return '\n';
case 'r':
return '\r';
case 't':
return '\t';
case 'v':
return '\v';
case 'x':
return String.fromCharCode(parseInt(this.next().value + this.next().value, 16));
case 'u':
var nextValue = this.next().value;
if (nextValue === '{') {
var hexDigits = '';
while ((nextValue = this.next().value) !== '}') {
hexDigits += nextValue;
}
var codePoint = parseInt(hexDigits, 16);
if (codePoint <= 0xFFFF) {
return String.fromCharCode(codePoint);
}
var high = Math.floor((codePoint - 0x10000) / 0x400) + 0xD800;
var low = (codePoint - 0x10000) % 0x400 + 0xDC00;
return String.fromCharCode(high, low);
}
return String.fromCharCode(parseInt(nextValue + this.next().value + this.next().value + this.next().value, 16));
default:
if (Number(ch) < 8)
throw new Error('Octal literals are not supported');
return ch;
}
},
configurable: true,
enumerable: true,
writable: true
}), $__3), {});
var LiteralToken = function LiteralToken(type, value, location) {
this.type = type;
this.location = location;
this.value = value;
};
($traceurRuntime.createClass)(LiteralToken, {
toString: function() {
return this.value;
},
get processedValue() {
switch (this.type) {
case NULL:
return null;
case NUMBER:
var value = this.value;
if (value.charCodeAt(0) === 48) {
switch (value.charCodeAt(1)) {
case 66:
case 98:
return parseInt(this.value.slice(2), 2);
case 79:
case 111:
return parseInt(this.value.slice(2), 8);
}
}
return Number(this.value);
case STRING:
var parser = new StringParser(this.value);
return parser.parse();
default:
throw new Error('Not implemented');
}
}
}, {}, Token);
return {get LiteralToken() {
return LiteralToken;
}};
});
System.register("traceur@0.0.74/src/codegeneration/ParseTreeFactory", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/ParseTreeFactory";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/ParseTreeFactory", path);
}
var IdentifierToken = System.get("traceur@0.0.74/src/syntax/IdentifierToken").IdentifierToken;
var LiteralToken = System.get("traceur@0.0.74/src/syntax/LiteralToken").LiteralToken;
var $__2 = System.get("traceur@0.0.74/src/syntax/trees/ParseTree"),
ParseTree = $__2.ParseTree,
ParseTreeType = $__2.ParseTreeType;
var $__3 = System.get("traceur@0.0.74/src/syntax/PredefinedName"),
CALL = $__3.CALL,
CREATE = $__3.CREATE,
DEFINE_PROPERTY = $__3.DEFINE_PROPERTY,
FREEZE = $__3.FREEZE,
OBJECT = $__3.OBJECT,
UNDEFINED = $__3.UNDEFINED;
var Token = System.get("traceur@0.0.74/src/syntax/Token").Token;
var $__5 = System.get("traceur@0.0.74/src/syntax/TokenType"),
EQUAL = $__5.EQUAL,
FALSE = $__5.FALSE,
NULL = $__5.NULL,
NUMBER = $__5.NUMBER,
STRING = $__5.STRING,
TRUE = $__5.TRUE,
VOID = $__5.VOID;
var assert = System.get("traceur@0.0.74/src/util/assert").assert;
var $__7 = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees"),
ArgumentList = $__7.ArgumentList,
ArrayLiteralExpression = $__7.ArrayLiteralExpression,
BinaryExpression = $__7.BinaryExpression,
BindingIdentifier = $__7.BindingIdentifier,
Block = $__7.Block,
BreakStatement = $__7.BreakStatement,
CallExpression = $__7.CallExpression,
CaseClause = $__7.CaseClause,
Catch = $__7.Catch,
ClassDeclaration = $__7.ClassDeclaration,
CommaExpression = $__7.CommaExpression,
ConditionalExpression = $__7.ConditionalExpression,
ContinueStatement = $__7.ContinueStatement,
DefaultClause = $__7.DefaultClause,
DoWhileStatement = $__7.DoWhileStatement,
EmptyStatement = $__7.EmptyStatement,
ExpressionStatement = $__7.ExpressionStatement,
Finally = $__7.Finally,
ForInStatement = $__7.ForInStatement,
ForOfStatement = $__7.ForOfStatement,
ForStatement = $__7.ForStatement,
FormalParameterList = $__7.FormalParameterList,
FunctionBody = $__7.FunctionBody,
FunctionExpression = $__7.FunctionExpression,
IdentifierExpression = $__7.IdentifierExpression,
IfStatement = $__7.IfStatement,
ImportedBinding = $__7.ImportedBinding,
LiteralExpression = $__7.LiteralExpression,
LiteralPropertyName = $__7.LiteralPropertyName,
MemberExpression = $__7.MemberExpression,
MemberLookupExpression = $__7.MemberLookupExpression,
NewExpression = $__7.NewExpression,
ObjectLiteralExpression = $__7.ObjectLiteralExpression,
ParenExpression = $__7.ParenExpression,
PostfixExpression = $__7.PostfixExpression,
Script = $__7.Script,
PropertyNameAssignment = $__7.PropertyNameAssignment,
RestParameter = $__7.RestParameter,
ReturnStatement = $__7.ReturnStatement,
SpreadExpression = $__7.SpreadExpression,
SwitchStatement = $__7.SwitchStatement,
ThisExpression = $__7.ThisExpression,
ThrowStatement = $__7.ThrowStatement,
TryStatement = $__7.TryStatement,
UnaryExpression = $__7.UnaryExpression,
VariableDeclaration = $__7.VariableDeclaration,
VariableDeclarationList = $__7.VariableDeclarationList,
VariableStatement = $__7.VariableStatement,
WhileStatement = $__7.WhileStatement,
WithStatement = $__7.WithStatement;
var slice = Array.prototype.slice.call.bind(Array.prototype.slice);
var map = Array.prototype.map.call.bind(Array.prototype.map);
function createOperatorToken(operator) {
return new Token(operator, null);
}
function createIdentifierToken(identifier) {
return new IdentifierToken(null, identifier);
}
function createStringLiteralToken(value) {
return new LiteralToken(STRING, JSON.stringify(value), null);
}
function createBooleanLiteralToken(value) {
return new Token(value ? TRUE : FALSE, null);
}
function createNullLiteralToken() {
return new LiteralToken(NULL, 'null', null);
}
function createNumberLiteralToken(value) {
return new LiteralToken(NUMBER, String(value), null);
}
function createEmptyParameterList() {
return new FormalParameterList(null, []);
}
function createArgumentList(list) {
return new ArgumentList(null, list);
}
function createEmptyArgumentList() {
return createArgumentList([]);
}
function createArrayLiteralExpression(list) {
return new ArrayLiteralExpression(null, list);
}
function createEmptyArrayLiteralExpression() {
return createArrayLiteralExpression([]);
}
function createAssignmentExpression(lhs, rhs) {
return new BinaryExpression(null, lhs, createOperatorToken(EQUAL), rhs);
}
function createBinaryExpression(left, operator, right) {
return new BinaryExpression(null, left, operator, right);
}
function createBindingIdentifier(identifier) {
if (typeof identifier === 'string')
identifier = createIdentifierToken(identifier);
else if (identifier.type === ParseTreeType.BINDING_IDENTIFIER)
return identifier;
else if (identifier.type === ParseTreeType.IDENTIFIER_EXPRESSION)
return new BindingIdentifier(identifier.location, identifier.identifierToken);
return new BindingIdentifier(null, identifier);
}
function createImportedBinding(name) {
var bindingIdentifier = createBindingIdentifier(name);
return new ImportedBinding(bindingIdentifier.location, bindingIdentifier);
}
function createEmptyStatement() {
return new EmptyStatement(null);
}
function createEmptyBlock() {
return createBlock([]);
}
function createBlock(statements) {
return new Block(null, statements);
}
function createFunctionBody(statements) {
return new FunctionBody(null, statements);
}
function createScopedExpression(body, scope) {
assert(body.type === 'FUNCTION_BODY');
return createCallCall(createParenExpression(createFunctionExpression(createEmptyParameterList(), body)), scope);
}
function createImmediatelyInvokedFunctionExpression(body) {
assert(body.type === 'FUNCTION_BODY');
return createCallExpression(createParenExpression(createFunctionExpression(createEmptyParameterList(), body)));
}
function createCallExpression(operand) {
var args = arguments[1] !== (void 0) ? arguments[1] : createEmptyArgumentList();
return new CallExpression(null, operand, args);
}
function createBreakStatement() {
var name = arguments[0] !== (void 0) ? arguments[0] : null;
return new BreakStatement(null, name);
}
function createCallCall(func, thisExpression) {
return createCallExpression(createMemberExpression(func, CALL), createArgumentList([thisExpression]));
}
function createCaseClause(expression, statements) {
return new CaseClause(null, expression, statements);
}
function createCatch(identifier, catchBody) {
identifier = createBindingIdentifier(identifier);
return new Catch(null, identifier, catchBody);
}
function createClassDeclaration(name, superClass, elements) {
return new ClassDeclaration(null, name, superClass, elements, []);
}
function createCommaExpression(expressions) {
return new CommaExpression(null, expressions);
}
function createConditionalExpression(condition, left, right) {
return new ConditionalExpression(null, condition, left, right);
}
function createContinueStatement() {
var name = arguments[0] !== (void 0) ? arguments[0] : null;
return new ContinueStatement(null, name);
}
function createDefaultClause(statements) {
return new DefaultClause(null, statements);
}
function createDoWhileStatement(body, condition) {
return new DoWhileStatement(null, body, condition);
}
function createAssignmentStatement(lhs, rhs) {
return createExpressionStatement(createAssignmentExpression(lhs, rhs));
}
function createCallStatement(operand) {
var args = arguments[1];
return createExpressionStatement(createCallExpression(operand, args));
}
function createExpressionStatement(expression) {
return new ExpressionStatement(null, expression);
}
function createFinally(block) {
return new Finally(null, block);
}
function createForOfStatement(initializer, collection, body) {
return new ForOfStatement(null, initializer, collection, body);
}
function createForInStatement(initializer, collection, body) {
return new ForInStatement(null, initializer, collection, body);
}
function createForStatement(variables, condition, increment, body) {
return new ForStatement(null, variables, condition, increment, body);
}
function createFunctionExpression(parameterList, body) {
assert(body.type === 'FUNCTION_BODY');
return new FunctionExpression(null, null, false, parameterList, null, [], body);
}
function createIdentifierExpression(identifier) {
if (typeof identifier == 'string')
identifier = createIdentifierToken(identifier);
else if (identifier instanceof BindingIdentifier)
identifier = identifier.identifierToken;
return new IdentifierExpression(null, identifier);
}
function createUndefinedExpression() {
return createIdentifierExpression(UNDEFINED);
}
function createIfStatement(condition, ifClause) {
var elseClause = arguments[2] !== (void 0) ? arguments[2] : null;
return new IfStatement(null, condition, ifClause, elseClause);
}
function createStringLiteral(value) {
return new LiteralExpression(null, createStringLiteralToken(value));
}
function createBooleanLiteral(value) {
return new LiteralExpression(null, createBooleanLiteralToken(value));
}
function createTrueLiteral() {
return createBooleanLiteral(true);
}
function createFalseLiteral() {
return createBooleanLiteral(false);
}
function createNullLiteral() {
return new LiteralExpression(null, createNullLiteralToken());
}
function createNumberLiteral(value) {
return new LiteralExpression(null, createNumberLiteralToken(value));
}
function createMemberExpression(operand, memberName, memberNames) {
if (typeof operand == 'string' || operand instanceof IdentifierToken)
operand = createIdentifierExpression(operand);
if (typeof memberName == 'string')
memberName = createIdentifierToken(memberName);
if (memberName instanceof LiteralToken)
memberName = new LiteralExpression(null, memberName);
var tree = memberName instanceof LiteralExpression ? new MemberLookupExpression(null, operand, memberName) : new MemberExpression(null, operand, memberName);
for (var i = 2; i < arguments.length; i++) {
tree = createMemberExpression(tree, arguments[i]);
}
return tree;
}
function createMemberLookupExpression(operand, memberExpression) {
return new MemberLookupExpression(null, operand, memberExpression);
}
function createThisExpression() {
return new ThisExpression(null);
}
function createNewExpression(operand, args) {
return new NewExpression(null, operand, args);
}
function createObjectFreeze(value) {
return createCallExpression(createMemberExpression(OBJECT, FREEZE), createArgumentList([value]));
}
function createObjectCreate(protoExpression, descriptors) {
var argumentList = [protoExpression];
if (descriptors)
argumentList.push(descriptors);
return createCallExpression(createMemberExpression(OBJECT, CREATE), createArgumentList(argumentList));
}
function createObjectLiteral(descr) {
var propertyNameAndValues = Object.keys(descr).map(function(name) {
var value = descr[name];
if (!(value instanceof ParseTree))
value = createBooleanLiteral(!!value);
return createPropertyNameAssignment(name, value);
});
return createObjectLiteralExpression(propertyNameAndValues);
}
function createDefineProperty(tree, name, descr) {
if (typeof name === 'string')
name = createStringLiteral(name);
return createCallExpression(createMemberExpression(OBJECT, DEFINE_PROPERTY), createArgumentList([tree, name, createObjectLiteral(descr)]));
}
function createObjectLiteralExpression(propertyNameAndValues) {
return new ObjectLiteralExpression(null, propertyNameAndValues);
}
function createParenExpression(expression) {
return new ParenExpression(null, expression);
}
function createPostfixExpression(operand, operator) {
return new PostfixExpression(null, operand, operator);
}
function createScript(scriptItemList) {
return new Script(null, scriptItemList);
}
function createPropertyNameAssignment(identifier, value) {
if (typeof identifier == 'string')
identifier = createLiteralPropertyName(identifier);
return new PropertyNameAssignment(null, identifier, value);
}
function createLiteralPropertyName(name) {
return new LiteralPropertyName(null, createIdentifierToken(name));
}
function createRestParameter(identifier) {
return new RestParameter(null, createBindingIdentifier(identifier));
}
function createReturnStatement(expression) {
return new ReturnStatement(null, expression);
}
function createSpreadExpression(expression) {
return new SpreadExpression(null, expression);
}
function createSwitchStatement(expression, caseClauses) {
return new SwitchStatement(null, expression, caseClauses);
}
function createThrowStatement(value) {
return new ThrowStatement(null, value);
}
function createTryStatement(body, catchBlock) {
var finallyBlock = arguments[2] !== (void 0) ? arguments[2] : null;
return new TryStatement(null, body, catchBlock, finallyBlock);
}
function createUnaryExpression(operator, operand) {
return new UnaryExpression(null, operator, operand);
}
function createUseStrictDirective() {
return createExpressionStatement(createStringLiteral('use strict'));
}
function createVariableDeclarationList(binding, identifierOrDeclarations, initializer) {
if (identifierOrDeclarations instanceof Array) {
var declarations = identifierOrDeclarations;
return new VariableDeclarationList(null, binding, declarations);
}
var identifier = identifierOrDeclarations;
return createVariableDeclarationList(binding, [createVariableDeclaration(identifier, initializer)]);
}
function createVariableDeclaration(identifier, initializer) {
if (!(identifier instanceof ParseTree) || identifier.type !== ParseTreeType.BINDING_IDENTIFIER && identifier.type !== ParseTreeType.OBJECT_PATTERN && identifier.type !== ParseTreeType.ARRAY_PATTERN) {
identifier = createBindingIdentifier(identifier);
}
return new VariableDeclaration(null, identifier, null, initializer);
}
function createVariableStatement(listOrBinding, identifier, initializer) {
if (listOrBinding instanceof VariableDeclarationList)
return new VariableStatement(null, listOrBinding);
var binding = listOrBinding;
var list = createVariableDeclarationList(binding, identifier, initializer);
return createVariableStatement(list);
}
function createVoid0() {
return createParenExpression(createUnaryExpression(createOperatorToken(VOID), createNumberLiteral(0)));
}
function createWhileStatement(condition, body) {
return new WhileStatement(null, condition, body);
}
function createWithStatement(expression, body) {
return new WithStatement(null, expression, body);
}
function createAssignStateStatement(state) {
return createAssignmentStatement(createMemberExpression('$ctx', 'state'), createNumberLiteral(state));
}
return {
get createOperatorToken() {
return createOperatorToken;
},
get createIdentifierToken() {
return createIdentifierToken;
},
get createStringLiteralToken() {
return createStringLiteralToken;
},
get createBooleanLiteralToken() {
return createBooleanLiteralToken;
},
get createNullLiteralToken() {
return createNullLiteralToken;
},
get createNumberLiteralToken() {
return createNumberLiteralToken;
},
get createEmptyParameterList() {
return createEmptyParameterList;
},
get createArgumentList() {
return createArgumentList;
},
get createEmptyArgumentList() {
return createEmptyArgumentList;
},
get createArrayLiteralExpression() {
return createArrayLiteralExpression;
},
get createEmptyArrayLiteralExpression() {
return createEmptyArrayLiteralExpression;
},
get createAssignmentExpression() {
return createAssignmentExpression;
},
get createBinaryExpression() {
return createBinaryExpression;
},
get createBindingIdentifier() {
return createBindingIdentifier;
},
get createImportedBinding() {
return createImportedBinding;
},
get createEmptyStatement() {
return createEmptyStatement;
},
get createEmptyBlock() {
return createEmptyBlock;
},
get createBlock() {
return createBlock;
},
get createFunctionBody() {
return createFunctionBody;
},
get createScopedExpression() {
return createScopedExpression;
},
get createImmediatelyInvokedFunctionExpression() {
return createImmediatelyInvokedFunctionExpression;
},
get createCallExpression() {
return createCallExpression;
},
get createBreakStatement() {
return createBreakStatement;
},
get createCaseClause() {
return createCaseClause;
},
get createCatch() {
return createCatch;
},
get createClassDeclaration() {
return createClassDeclaration;
},
get createCommaExpression() {
return createCommaExpression;
},
get createConditionalExpression() {
return createConditionalExpression;
},
get createContinueStatement() {
return createContinueStatement;
},
get createDefaultClause() {
return createDefaultClause;
},
get createDoWhileStatement() {
return createDoWhileStatement;
},
get createAssignmentStatement() {
return createAssignmentStatement;
},
get createCallStatement() {
return createCallStatement;
},
get createExpressionStatement() {
return createExpressionStatement;
},
get createFinally() {
return createFinally;
},
get createForOfStatement() {
return createForOfStatement;
},
get createForInStatement() {
return createForInStatement;
},
get createForStatement() {
return createForStatement;
},
get createFunctionExpression() {
return createFunctionExpression;
},
get createIdentifierExpression() {
return createIdentifierExpression;
},
get createUndefinedExpression() {
return createUndefinedExpression;
},
get createIfStatement() {
return createIfStatement;
},
get createStringLiteral() {
return createStringLiteral;
},
get createBooleanLiteral() {
return createBooleanLiteral;
},
get createTrueLiteral() {
return createTrueLiteral;
},
get createFalseLiteral() {
return createFalseLiteral;
},
get createNullLiteral() {
return createNullLiteral;
},
get createNumberLiteral() {
return createNumberLiteral;
},
get createMemberExpression() {
return createMemberExpression;
},
get createMemberLookupExpression() {
return createMemberLookupExpression;
},
get createThisExpression() {
return createThisExpression;
},
get createNewExpression() {
return createNewExpression;
},
get createObjectFreeze() {
return createObjectFreeze;
},
get createObjectCreate() {
return createObjectCreate;
},
get createObjectLiteral() {
return createObjectLiteral;
},
get createDefineProperty() {
return createDefineProperty;
},
get createObjectLiteralExpression() {
return createObjectLiteralExpression;
},
get createParenExpression() {
return createParenExpression;
},
get createPostfixExpression() {
return createPostfixExpression;
},
get createScript() {
return createScript;
},
get createPropertyNameAssignment() {
return createPropertyNameAssignment;
},
get createReturnStatement() {
return createReturnStatement;
},
get createSwitchStatement() {
return createSwitchStatement;
},
get createThrowStatement() {
return createThrowStatement;
},
get createTryStatement() {
return createTryStatement;
},
get createUnaryExpression() {
return createUnaryExpression;
},
get createUseStrictDirective() {
return createUseStrictDirective;
},
get createVariableDeclarationList() {
return createVariableDeclarationList;
},
get createVariableDeclaration() {
return createVariableDeclaration;
},
get createVariableStatement() {
return createVariableStatement;
},
get createVoid0() {
return createVoid0;
},
get createWhileStatement() {
return createWhileStatement;
},
get createWithStatement() {
return createWithStatement;
},
get createAssignStateStatement() {
return createAssignStateStatement;
}
};
});
System.register("traceur@0.0.74/src/codegeneration/FindVisitor", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/FindVisitor";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/FindVisitor", path);
}
var ParseTreeVisitor = System.get("traceur@0.0.74/src/syntax/ParseTreeVisitor").ParseTreeVisitor;
var FindVisitor = function FindVisitor(tree) {
var keepOnGoing = arguments[1];
this.found_ = false;
this.shouldContinue_ = true;
this.keepOnGoing_ = keepOnGoing;
this.visitAny(tree);
};
($traceurRuntime.createClass)(FindVisitor, {
get found() {
return this.found_;
},
set found(v) {
if (v) {
this.found_ = true;
if (!this.keepOnGoing_)
this.shouldContinue_ = false;
}
},
visitAny: function(tree) {
this.shouldContinue_ && tree && tree.visit(this);
},
visitList: function(list) {
if (list) {
for (var i = 0; this.shouldContinue_ && i < list.length; i++) {
this.visitAny(list[i]);
}
}
}
}, {}, ParseTreeVisitor);
return {get FindVisitor() {
return FindVisitor;
}};
});
System.register("traceur@0.0.74/src/syntax/Keywords", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/syntax/Keywords";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/syntax/Keywords", path);
}
var keywords = ['break', 'case', 'catch', 'class', 'const', 'continue', 'debugger', 'default', 'delete', 'do', 'else', 'export', 'finally', 'for', 'function', 'if', 'import', 'in', 'instanceof', 'let', 'new', 'return', 'super', 'switch', 'this', 'throw', 'try', 'typeof', 'var', 'void', 'while', 'with', 'enum', 'extends', 'null', 'true', 'false'];
var strictKeywords = ['implements', 'interface', 'package', 'private', 'protected', 'public', 'static', 'yield'];
var keywordsByName = Object.create(null);
var NORMAL_KEYWORD = 1;
var STRICT_KEYWORD = 2;
keywords.forEach((function(value) {
keywordsByName[value] = NORMAL_KEYWORD;
}));
strictKeywords.forEach((function(value) {
keywordsByName[value] = STRICT_KEYWORD;
}));
function getKeywordType(value) {
return keywordsByName[value];
}
function isStrictKeyword(value) {
return getKeywordType(value) === STRICT_KEYWORD;
}
return {
get NORMAL_KEYWORD() {
return NORMAL_KEYWORD;
},
get STRICT_KEYWORD() {
return STRICT_KEYWORD;
},
get getKeywordType() {
return getKeywordType;
},
get isStrictKeyword() {
return isStrictKeyword;
}
};
});
System.register("traceur@0.0.74/src/staticsemantics/StrictParams", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/staticsemantics/StrictParams";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/staticsemantics/StrictParams", path);
}
var ParseTreeVisitor = System.get("traceur@0.0.74/src/syntax/ParseTreeVisitor").ParseTreeVisitor;
var isStrictKeyword = System.get("traceur@0.0.74/src/syntax/Keywords").isStrictKeyword;
var StrictParams = function StrictParams(errorReporter) {
$traceurRuntime.superConstructor($StrictParams).call(this);
this.errorReporter = errorReporter;
};
var $StrictParams = StrictParams;
($traceurRuntime.createClass)(StrictParams, {visitBindingIdentifier: function(tree) {
var name = tree.identifierToken.toString();
if (isStrictKeyword(name)) {
this.errorReporter.reportError(tree.location.start, (name + " is a reserved identifier"));
}
}}, {visit: function(tree, errorReporter) {
new $StrictParams(errorReporter).visitAny(tree);
}}, ParseTreeVisitor);
return {get StrictParams() {
return StrictParams;
}};
});
System.register("traceur@0.0.74/src/util/SourceRange", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/util/SourceRange";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/util/SourceRange", path);
}
var SourceRange = function SourceRange(start, end) {
this.start = start;
this.end = end;
};
($traceurRuntime.createClass)(SourceRange, {toString: function() {
var str = this.start.source.contents;
return str.slice(this.start.offset, this.end.offset);
}}, {});
return {get SourceRange() {
return SourceRange;
}};
});
System.register("traceur@0.0.74/src/util/ErrorReporter", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/util/ErrorReporter";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/util/ErrorReporter", path);
}
var ErrorReporter = function ErrorReporter() {
this.hadError_ = false;
};
($traceurRuntime.createClass)(ErrorReporter, {
reportError: function(location, message) {
this.hadError_ = true;
this.reportMessageInternal(location, message);
},
reportMessageInternal: function(location, message) {
if (location)
message = (location + ": " + message);
console.error(message);
},
hadError: function() {
return this.hadError_;
},
clearError: function() {
this.hadError_ = false;
}
}, {});
function format(location, text) {
var args = arguments[2];
var i = 0;
text = text.replace(/%./g, function(s) {
switch (s) {
case '%s':
return args && args[i++];
case '%%':
return '%';
}
return s;
});
if (location)
text = (location + ": " + text);
return text;
}
;
ErrorReporter.format = format;
return {
get ErrorReporter() {
return ErrorReporter;
},
get format() {
return format;
}
};
});
System.register("traceur@0.0.74/src/util/SyntaxErrorReporter", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/util/SyntaxErrorReporter";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/util/SyntaxErrorReporter", path);
}
var $__0 = System.get("traceur@0.0.74/src/util/ErrorReporter"),
ErrorReporter = $__0.ErrorReporter,
format = $__0.format;
var SyntaxErrorReporter = function SyntaxErrorReporter() {
$traceurRuntime.superConstructor($SyntaxErrorReporter).apply(this, arguments);
};
var $SyntaxErrorReporter = SyntaxErrorReporter;
($traceurRuntime.createClass)(SyntaxErrorReporter, {reportMessageInternal: function(location, message) {
var s = format(location, message);
throw new SyntaxError(s);
}}, {}, ErrorReporter);
return {get SyntaxErrorReporter() {
return SyntaxErrorReporter;
}};
});
System.register("traceur@0.0.74/src/syntax/KeywordToken", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/syntax/KeywordToken";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/syntax/KeywordToken", path);
}
var STRICT_KEYWORD = System.get("traceur@0.0.74/src/syntax/Keywords").STRICT_KEYWORD;
var Token = System.get("traceur@0.0.74/src/syntax/Token").Token;
var KeywordToken = function KeywordToken(type, keywordType, location) {
this.type = type;
this.location = location;
this.isStrictKeyword_ = keywordType === STRICT_KEYWORD;
};
($traceurRuntime.createClass)(KeywordToken, {
isKeyword: function() {
return true;
},
isStrictKeyword: function() {
return this.isStrictKeyword_;
}
}, {}, Token);
return {get KeywordToken() {
return KeywordToken;
}};
});
System.register("traceur@0.0.74/src/syntax/unicode-tables", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/syntax/unicode-tables";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/syntax/unicode-tables", path);
}
var idStartTable = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 442, 443, 443, 444, 447, 448, 451, 452, 659, 660, 660, 661, 687, 688, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 883, 884, 884, 886, 887, 890, 890, 891, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1599, 1600, 1600, 1601, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2417, 2418, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3653, 3654, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4348, 4349, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6210, 6211, 6211, 6212, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7287, 7288, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7467, 7468, 7530, 7531, 7543, 7544, 7544, 7545, 7578, 7579, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8472, 8472, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8494, 8494, 8495, 8500, 8501, 8504, 8505, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8578, 8579, 8580, 8581, 8584, 11264, 11310, 11312, 11358, 11360, 11387, 11388, 11389, 11390, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 12293, 12293, 12294, 12294, 12295, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12347, 12347, 12348, 12348, 12353, 12438, 12443, 12444, 12445, 12446, 12447, 12447, 12449, 12538, 12540, 12542, 12543, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 40980, 40981, 40981, 40982, 42124, 42192, 42231, 42232, 42237, 42240, 42507, 42508, 42508, 42512, 42527, 42538, 42539, 42560, 42605, 42606, 42606, 42623, 42623, 42624, 42647, 42656, 42725, 42726, 42735, 42775, 42783, 42786, 42863, 42864, 42864, 42865, 42887, 42888, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43001, 43002, 43002, 43003, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43631, 43632, 43632, 43633, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43740, 43741, 43741, 43744, 43754, 43762, 43762, 43763, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65391, 65392, 65392, 65393, 65437, 65438, 65439, 65440, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, 65856, 65908, 66176, 66204, 66208, 66256, 66304, 66334, 66352, 66368, 66369, 66369, 66370, 66377, 66378, 66378, 66432, 66461, 66464, 66499, 66504, 66511, 66513, 66517, 66560, 66639, 66640, 66717, 67584, 67589, 67592, 67592, 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, 67840, 67861, 67872, 67897, 67968, 68023, 68030, 68031, 68096, 68096, 68112, 68115, 68117, 68119, 68121, 68147, 68192, 68220, 68352, 68405, 68416, 68437, 68448, 68466, 68608, 68680, 69635, 69687, 69763, 69807, 69840, 69864, 69891, 69926, 70019, 70066, 70081, 70084, 71296, 71338, 73728, 74606, 74752, 74850, 77824, 78894, 92160, 92728, 93952, 94020, 94032, 94032, 94099, 94111, 110592, 110593, 119808, 119892, 119894, 119964, 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, 126464, 126467, 126469, 126495, 126497, 126498, 126500, 126500, 126503, 126503, 126505, 126514, 126516, 126519, 126521, 126521, 126523, 126523, 126530, 126530, 126535, 126535, 126537, 126537, 126539, 126539, 126541, 126543, 126545, 126546, 126548, 126548, 126551, 126551, 126553, 126553, 126555, 126555, 126557, 126557, 126559, 126559, 126561, 126562, 126564, 126564, 126567, 126570, 126572, 126578, 126580, 126583, 126585, 126588, 126590, 126590, 126592, 126601, 126603, 126619, 126625, 126627, 126629, 126633, 126635, 126651, 131072, 173782, 173824, 177972, 177984, 178205, 194560, 195101];
var idContinueTable = [183, 183, 768, 879, 903, 903, 1155, 1159, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1552, 1562, 1611, 1631, 1632, 1641, 1648, 1648, 1750, 1756, 1759, 1764, 1767, 1768, 1770, 1773, 1776, 1785, 1809, 1809, 1840, 1866, 1958, 1968, 1984, 1993, 2027, 2035, 2070, 2073, 2075, 2083, 2085, 2087, 2089, 2093, 2137, 2139, 2276, 2302, 2304, 2306, 2307, 2307, 2362, 2362, 2363, 2363, 2364, 2364, 2366, 2368, 2369, 2376, 2377, 2380, 2381, 2381, 2382, 2383, 2385, 2391, 2402, 2403, 2406, 2415, 2433, 2433, 2434, 2435, 2492, 2492, 2494, 2496, 2497, 2500, 2503, 2504, 2507, 2508, 2509, 2509, 2519, 2519, 2530, 2531, 2534, 2543, 2561, 2562, 2563, 2563, 2620, 2620, 2622, 2624, 2625, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2662, 2671, 2672, 2673, 2677, 2677, 2689, 2690, 2691, 2691, 2748, 2748, 2750, 2752, 2753, 2757, 2759, 2760, 2761, 2761, 2763, 2764, 2765, 2765, 2786, 2787, 2790, 2799, 2817, 2817, 2818, 2819, 2876, 2876, 2878, 2878, 2879, 2879, 2880, 2880, 2881, 2884, 2887, 2888, 2891, 2892, 2893, 2893, 2902, 2902, 2903, 2903, 2914, 2915, 2918, 2927, 2946, 2946, 3006, 3007, 3008, 3008, 3009, 3010, 3014, 3016, 3018, 3020, 3021, 3021, 3031, 3031, 3046, 3055, 3073, 3075, 3134, 3136, 3137, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3170, 3171, 3174, 3183, 3202, 3203, 3260, 3260, 3262, 3262, 3263, 3263, 3264, 3268, 3270, 3270, 3271, 3272, 3274, 3275, 3276, 3277, 3285, 3286, 3298, 3299, 3302, 3311, 3330, 3331, 3390, 3392, 3393, 3396, 3398, 3400, 3402, 3404, 3405, 3405, 3415, 3415, 3426, 3427, 3430, 3439, 3458, 3459, 3530, 3530, 3535, 3537, 3538, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3633, 3633, 3636, 3642, 3655, 3662, 3664, 3673, 3761, 3761, 3764, 3769, 3771, 3772, 3784, 3789, 3792, 3801, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3903, 3953, 3966, 3967, 3967, 3968, 3972, 3974, 3975, 3981, 3991, 3993, 4028, 4038, 4038, 4139, 4140, 4141, 4144, 4145, 4145, 4146, 4151, 4152, 4152, 4153, 4154, 4155, 4156, 4157, 4158, 4160, 4169, 4182, 4183, 4184, 4185, 4190, 4192, 4194, 4196, 4199, 4205, 4209, 4212, 4226, 4226, 4227, 4228, 4229, 4230, 4231, 4236, 4237, 4237, 4239, 4239, 4240, 4249, 4250, 4252, 4253, 4253, 4957, 4959, 4969, 4977, 5906, 5908, 5938, 5940, 5970, 5971, 6002, 6003, 6068, 6069, 6070, 6070, 6071, 6077, 6078, 6085, 6086, 6086, 6087, 6088, 6089, 6099, 6109, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6313, 6313, 6432, 6434, 6435, 6438, 6439, 6440, 6441, 6443, 6448, 6449, 6450, 6450, 6451, 6456, 6457, 6459, 6470, 6479, 6576, 6592, 6600, 6601, 6608, 6617, 6618, 6618, 6679, 6680, 6681, 6683, 6741, 6741, 6742, 6742, 6743, 6743, 6744, 6750, 6752, 6752, 6753, 6753, 6754, 6754, 6755, 6756, 6757, 6764, 6765, 6770, 6771, 6780, 6783, 6783, 6784, 6793, 6800, 6809, 6912, 6915, 6916, 6916, 6964, 6964, 6965, 6965, 6966, 6970, 6971, 6971, 6972, 6972, 6973, 6977, 6978, 6978, 6979, 6980, 6992, 7001, 7019, 7027, 7040, 7041, 7042, 7042, 7073, 7073, 7074, 7077, 7078, 7079, 7080, 7081, 7082, 7082, 7083, 7083, 7084, 7085, 7088, 7097, 7142, 7142, 7143, 7143, 7144, 7145, 7146, 7148, 7149, 7149, 7150, 7150, 7151, 7153, 7154, 7155, 7204, 7211, 7212, 7219, 7220, 7221, 7222, 7223, 7232, 7241, 7248, 7257, 7376, 7378, 7380, 7392, 7393, 7393, 7394, 7400, 7405, 7405, 7410, 7411, 7412, 7412, 7616, 7654, 7676, 7679, 8255, 8256, 8276, 8276, 8400, 8412, 8417, 8417, 8421, 8432, 11503, 11505, 11647, 11647, 11744, 11775, 12330, 12333, 12334, 12335, 12441, 12442, 42528, 42537, 42607, 42607, 42612, 42621, 42655, 42655, 42736, 42737, 43010, 43010, 43014, 43014, 43019, 43019, 43043, 43044, 43045, 43046, 43047, 43047, 43136, 43137, 43188, 43203, 43204, 43204, 43216, 43225, 43232, 43249, 43264, 43273, 43302, 43309, 43335, 43345, 43346, 43347, 43392, 43394, 43395, 43395, 43443, 43443, 43444, 43445, 43446, 43449, 43450, 43451, 43452, 43452, 43453, 43456, 43472, 43481, 43561, 43566, 43567, 43568, 43569, 43570, 43571, 43572, 43573, 43574, 43587, 43587, 43596, 43596, 43597, 43597, 43600, 43609, 43643, 43643, 43696, 43696, 43698, 43700, 43703, 43704, 43710, 43711, 43713, 43713, 43755, 43755, 43756, 43757, 43758, 43759, 43765, 43765, 43766, 43766, 44003, 44004, 44005, 44005, 44006, 44007, 44008, 44008, 44009, 44010, 44012, 44012, 44013, 44013, 44016, 44025, 64286, 64286, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65296, 65305, 65343, 65343, 66045, 66045, 66720, 66729, 68097, 68099, 68101, 68102, 68108, 68111, 68152, 68154, 68159, 68159, 69632, 69632, 69633, 69633, 69634, 69634, 69688, 69702, 69734, 69743, 69760, 69761, 69762, 69762, 69808, 69810, 69811, 69814, 69815, 69816, 69817, 69818, 69872, 69881, 69888, 69890, 69927, 69931, 69932, 69932, 69933, 69940, 69942, 69951, 70016, 70017, 70018, 70018, 70067, 70069, 70070, 70078, 70079, 70080, 70096, 70105, 71339, 71339, 71340, 71340, 71341, 71341, 71342, 71343, 71344, 71349, 71350, 71350, 71351, 71351, 71360, 71369, 94033, 94078, 94095, 94098, 119141, 119142, 119143, 119145, 119149, 119154, 119163, 119170, 119173, 119179, 119210, 119213, 119362, 119364, 120782, 120831, 917760, 917999];
return {
get idStartTable() {
return idStartTable;
},
get idContinueTable() {
return idContinueTable;
}
};
});
System.register("traceur@0.0.74/src/syntax/Scanner", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/syntax/Scanner";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/syntax/Scanner", path);
}
var IdentifierToken = System.get("traceur@0.0.74/src/syntax/IdentifierToken").IdentifierToken;
var KeywordToken = System.get("traceur@0.0.74/src/syntax/KeywordToken").KeywordToken;
var LiteralToken = System.get("traceur@0.0.74/src/syntax/LiteralToken").LiteralToken;
var Token = System.get("traceur@0.0.74/src/syntax/Token").Token;
var getKeywordType = System.get("traceur@0.0.74/src/syntax/Keywords").getKeywordType;
var $__5 = System.get("traceur@0.0.74/src/syntax/unicode-tables"),
idContinueTable = $__5.idContinueTable,
idStartTable = $__5.idStartTable;
var $__6 = System.get("traceur@0.0.74/src/Options"),
options = $__6.options,
parseOptions = $__6.parseOptions;
var $__7 = System.get("traceur@0.0.74/src/syntax/TokenType"),
AMPERSAND = $__7.AMPERSAND,
AMPERSAND_EQUAL = $__7.AMPERSAND_EQUAL,
AND = $__7.AND,
ARROW = $__7.ARROW,
AT = $__7.AT,
BANG = $__7.BANG,
BAR = $__7.BAR,
BAR_EQUAL = $__7.BAR_EQUAL,
CARET = $__7.CARET,
CARET_EQUAL = $__7.CARET_EQUAL,
CLOSE_ANGLE = $__7.CLOSE_ANGLE,
CLOSE_CURLY = $__7.CLOSE_CURLY,
CLOSE_PAREN = $__7.CLOSE_PAREN,
CLOSE_SQUARE = $__7.CLOSE_SQUARE,
COLON = $__7.COLON,
COMMA = $__7.COMMA,
DOT_DOT_DOT = $__7.DOT_DOT_DOT,
END_OF_FILE = $__7.END_OF_FILE,
EQUAL = $__7.EQUAL,
EQUAL_EQUAL = $__7.EQUAL_EQUAL,
EQUAL_EQUAL_EQUAL = $__7.EQUAL_EQUAL_EQUAL,
ERROR = $__7.ERROR,
GREATER_EQUAL = $__7.GREATER_EQUAL,
LEFT_SHIFT = $__7.LEFT_SHIFT,
LEFT_SHIFT_EQUAL = $__7.LEFT_SHIFT_EQUAL,
LESS_EQUAL = $__7.LESS_EQUAL,
MINUS = $__7.MINUS,
MINUS_EQUAL = $__7.MINUS_EQUAL,
MINUS_MINUS = $__7.MINUS_MINUS,
NO_SUBSTITUTION_TEMPLATE = $__7.NO_SUBSTITUTION_TEMPLATE,
NOT_EQUAL = $__7.NOT_EQUAL,
NOT_EQUAL_EQUAL = $__7.NOT_EQUAL_EQUAL,
NUMBER = $__7.NUMBER,
OPEN_ANGLE = $__7.OPEN_ANGLE,
OPEN_CURLY = $__7.OPEN_CURLY,
OPEN_PAREN = $__7.OPEN_PAREN,
OPEN_SQUARE = $__7.OPEN_SQUARE,
OR = $__7.OR,
PERCENT = $__7.PERCENT,
PERCENT_EQUAL = $__7.PERCENT_EQUAL,
PERIOD = $__7.PERIOD,
PLUS = $__7.PLUS,
PLUS_EQUAL = $__7.PLUS_EQUAL,
PLUS_PLUS = $__7.PLUS_PLUS,
QUESTION = $__7.QUESTION,
REGULAR_EXPRESSION = $__7.REGULAR_EXPRESSION,
RIGHT_SHIFT = $__7.RIGHT_SHIFT,
RIGHT_SHIFT_EQUAL = $__7.RIGHT_SHIFT_EQUAL,
SEMI_COLON = $__7.SEMI_COLON,
SLASH = $__7.SLASH,
SLASH_EQUAL = $__7.SLASH_EQUAL,
STAR = $__7.STAR,
STAR_EQUAL = $__7.STAR_EQUAL,
STAR_STAR = $__7.STAR_STAR,
STAR_STAR_EQUAL = $__7.STAR_STAR_EQUAL,
STRING = $__7.STRING,
TEMPLATE_HEAD = $__7.TEMPLATE_HEAD,
TEMPLATE_MIDDLE = $__7.TEMPLATE_MIDDLE,
TEMPLATE_TAIL = $__7.TEMPLATE_TAIL,
TILDE = $__7.TILDE,
UNSIGNED_RIGHT_SHIFT = $__7.UNSIGNED_RIGHT_SHIFT,
UNSIGNED_RIGHT_SHIFT_EQUAL = $__7.UNSIGNED_RIGHT_SHIFT_EQUAL;
var isWhitespaceArray = [];
for (var i = 0; i < 128; i++) {
isWhitespaceArray[i] = i >= 9 && i <= 13 || i === 0x20;
}
var isWhitespaceArray = [];
for (var i = 0; i < 128; i++) {
isWhitespaceArray[i] = i >= 9 && i <= 13 || i === 0x20;
}
function isWhitespace(code) {
if (code < 128)
return isWhitespaceArray[code];
switch (code) {
case 0xA0:
case 0xFEFF:
case 0x2028:
case 0x2029:
return true;
}
return false;
}
function isLineTerminator(code) {
switch (code) {
case 10:
case 13:
case 0x2028:
case 0x2029:
return true;
}
return false;
}
function isDecimalDigit(code) {
return code >= 48 && code <= 57;
}
var isHexDigitArray = [];
for (var i = 0; i < 128; i++) {
isHexDigitArray[i] = i >= 48 && i <= 57 || i >= 65 && i <= 70 || i >= 97 && i <= 102;
}
function isHexDigit(code) {
return code < 128 && isHexDigitArray[code];
}
function isBinaryDigit(code) {
return code === 48 || code === 49;
}
function isOctalDigit(code) {
return code >= 48 && code <= 55;
}
var isIdentifierStartArray = [];
for (var i = 0; i < 128; i++) {
isIdentifierStartArray[i] = i === 36 || i >= 65 && i <= 90 || i === 95 || i >= 97 && i <= 122;
}
function isIdentifierStart(code) {
return code < 128 ? isIdentifierStartArray[code] : inTable(idStartTable, code);
}
var isIdentifierPartArray = [];
for (var i = 0; i < 128; i++) {
isIdentifierPartArray[i] = isIdentifierStart(i) || isDecimalDigit(i);
}
function isIdentifierPart(code) {
return code < 128 ? isIdentifierPartArray[code] : inTable(idStartTable, code) || inTable(idContinueTable, code) || code === 8204 || code === 8205;
}
function inTable(table, code) {
for (var i = 0; i < table.length; ) {
if (code < table[i++])
return false;
if (code <= table[i++])
return true;
}
return false;
}
function isRegularExpressionChar(code) {
switch (code) {
case 47:
return false;
case 91:
case 92:
return true;
}
return !isLineTerminator(code);
}
function isRegularExpressionFirstChar(code) {
return isRegularExpressionChar(code) && code !== 42;
}
var index,
input,
length,
token,
lastToken,
lookaheadToken,
currentCharCode,
lineNumberTable,
errorReporter,
currentParser;
var Scanner = function Scanner(reporter, file, parser) {
errorReporter = reporter;
lineNumberTable = file.lineNumberTable;
input = file.contents;
length = file.contents.length;
this.index = 0;
currentParser = parser;
};
($traceurRuntime.createClass)(Scanner, {
get lastToken() {
return lastToken;
},
getPosition: function() {
return getPosition(getOffset());
},
nextRegularExpressionLiteralToken: function() {
lastToken = nextRegularExpressionLiteralToken();
token = scanToken();
return lastToken;
},
nextTemplateLiteralToken: function() {
var t = nextTemplateLiteralToken();
token = scanToken();
return t;
},
nextCloseAngle: function() {
switch (token.type) {
case GREATER_EQUAL:
case RIGHT_SHIFT:
case RIGHT_SHIFT_EQUAL:
case UNSIGNED_RIGHT_SHIFT:
case UNSIGNED_RIGHT_SHIFT_EQUAL:
this.index -= token.type.length - 1;
lastToken = createToken(CLOSE_ANGLE, index);
token = scanToken();
return lastToken;
}
return nextToken();
},
nextToken: function() {
return nextToken();
},
peekToken: function(opt_index) {
return opt_index ? peekTokenLookahead() : peekToken();
},
peekTokenNoLineTerminator: function() {
return peekTokenNoLineTerminator();
},
isAtEnd: function() {
return isAtEnd();
},
set index(i) {
index = i;
lastToken = null;
token = null;
lookaheadToken = null;
updateCurrentCharCode();
},
get index() {
return index;
}
}, {});
function getPosition(offset) {
return lineNumberTable.getSourcePosition(offset);
}
function getTokenRange(startOffset) {
return lineNumberTable.getSourceRange(startOffset, index);
}
function getOffset() {
return token ? token.location.start.offset : index;
}
function nextRegularExpressionLiteralToken() {
var beginIndex = index - token.toString().length;
if (!(token.type == SLASH_EQUAL && currentCharCode === 47) && !skipRegularExpressionBody()) {
return new LiteralToken(REGULAR_EXPRESSION, getTokenString(beginIndex), getTokenRange(beginIndex));
}
if (currentCharCode !== 47) {
reportError('Expected \'/\' in regular expression literal');
return new LiteralToken(REGULAR_EXPRESSION, getTokenString(beginIndex), getTokenRange(beginIndex));
}
next();
while (isIdentifierPart(currentCharCode)) {
next();
}
return new LiteralToken(REGULAR_EXPRESSION, getTokenString(beginIndex), getTokenRange(beginIndex));
}
function skipRegularExpressionBody() {
if (!isRegularExpressionFirstChar(currentCharCode)) {
reportError('Expected regular expression first char');
return false;
}
while (!isAtEnd() && isRegularExpressionChar(currentCharCode)) {
if (!skipRegularExpressionChar())
return false;
}
return true;
}
function skipRegularExpressionChar() {
switch (currentCharCode) {
case 92:
return skipRegularExpressionBackslashSequence();
case 91:
return skipRegularExpressionClass();
default:
next();
return true;
}
}
function skipRegularExpressionBackslashSequence() {
next();
if (isLineTerminator(currentCharCode) || isAtEnd()) {
reportError('New line not allowed in regular expression literal');
return false;
}
next();
return true;
}
function skipRegularExpressionClass() {
next();
while (!isAtEnd() && peekRegularExpressionClassChar()) {
if (!skipRegularExpressionClassChar()) {
return false;
}
}
if (currentCharCode !== 93) {
reportError('\']\' expected');
return false;
}
next();
return true;
}
function peekRegularExpressionClassChar() {
return currentCharCode !== 93 && !isLineTerminator(currentCharCode);
}
function skipRegularExpressionClassChar() {
if (currentCharCode === 92) {
return skipRegularExpressionBackslashSequence();
}
next();
return true;
}
function skipTemplateCharacter() {
while (!isAtEnd()) {
switch (currentCharCode) {
case 96:
return;
case 92:
skipStringLiteralEscapeSequence();
break;
case 36:
var code = input.charCodeAt(index + 1);
if (code === 123)
return;
default:
next();
}
}
}
function scanTemplateStart(beginIndex) {
if (isAtEnd()) {
reportError('Unterminated template literal');
return lastToken = createToken(END_OF_FILE, beginIndex);
}
return nextTemplateLiteralTokenShared(NO_SUBSTITUTION_TEMPLATE, TEMPLATE_HEAD);
}
function nextTemplateLiteralToken() {
if (isAtEnd()) {
reportError('Expected \'}\' after expression in template literal');
return createToken(END_OF_FILE, index);
}
if (token.type !== CLOSE_CURLY) {
reportError('Expected \'}\' after expression in template literal');
return createToken(ERROR, index);
}
return nextTemplateLiteralTokenShared(TEMPLATE_TAIL, TEMPLATE_MIDDLE);
}
function nextTemplateLiteralTokenShared(endType, middleType) {
var beginIndex = index;
skipTemplateCharacter();
if (isAtEnd()) {
reportError('Unterminated template literal');
return createToken(ERROR, beginIndex);
}
var value = getTokenString(beginIndex);
switch (currentCharCode) {
case 96:
next();
return lastToken = new LiteralToken(endType, value, getTokenRange(beginIndex - 1));
case 36:
next();
next();
return lastToken = new LiteralToken(middleType, value, getTokenRange(beginIndex - 1));
}
}
function nextToken() {
var t = peekToken();
token = lookaheadToken || scanToken();
lookaheadToken = null;
lastToken = t;
return t;
}
function peekTokenNoLineTerminator() {
var t = peekToken();
var start = lastToken.location.end.offset;
var end = t.location.start.offset;
for (var i = start; i < end; i++) {
var code = input.charCodeAt(i);
if (isLineTerminator(code))
return null;
if (code === 47) {
code = input.charCodeAt(++i);
if (code === 47)
return null;
i = input.indexOf('*/', i) + 2;
}
}
return t;
}
function peekToken() {
return token || (token = scanToken());
}
function peekTokenLookahead() {
if (!token)
token = scanToken();
if (!lookaheadToken)
lookaheadToken = scanToken();
return lookaheadToken;
}
function skipWhitespace() {
while (!isAtEnd() && peekWhitespace()) {
next();
}
}
function peekWhitespace() {
return isWhitespace(currentCharCode);
}
function skipComments() {
while (skipComment()) {}
}
function skipComment() {
skipWhitespace();
var code = currentCharCode;
if (code === 47) {
code = input.charCodeAt(index + 1);
switch (code) {
case 47:
skipSingleLineComment();
return true;
case 42:
skipMultiLineComment();
return true;
}
}
return false;
}
function commentCallback(start, index) {
if (options.commentCallback)
currentParser.handleComment(lineNumberTable.getSourceRange(start, index));
}
function skipSingleLineComment() {
var start = index;
index += 2;
while (!isAtEnd() && !isLineTerminator(input.charCodeAt(index++))) {}
updateCurrentCharCode();
commentCallback(start, index);
}
function skipMultiLineComment() {
var start = index;
var i = input.indexOf('*/', index + 2);
if (i !== -1)
index = i + 2;
else
index = length;
updateCurrentCharCode();
commentCallback(start, index);
}
function scanToken() {
skipComments();
var beginIndex = index;
if (isAtEnd())
return createToken(END_OF_FILE, beginIndex);
var code = currentCharCode;
next();
switch (code) {
case 123:
return createToken(OPEN_CURLY, beginIndex);
case 125:
return createToken(CLOSE_CURLY, beginIndex);
case 40:
return createToken(OPEN_PAREN, beginIndex);
case 41:
return createToken(CLOSE_PAREN, beginIndex);
case 91:
return createToken(OPEN_SQUARE, beginIndex);
case 93:
return createToken(CLOSE_SQUARE, beginIndex);
case 46:
switch (currentCharCode) {
case 46:
if (input.charCodeAt(index + 1) === 46) {
next();
next();
return createToken(DOT_DOT_DOT, beginIndex);
}
break;
default:
if (isDecimalDigit(currentCharCode))
return scanNumberPostPeriod(beginIndex);
}
return createToken(PERIOD, beginIndex);
case 59:
return createToken(SEMI_COLON, beginIndex);
case 44:
return createToken(COMMA, beginIndex);
case 126:
return createToken(TILDE, beginIndex);
case 63:
return createToken(QUESTION, beginIndex);
case 58:
return createToken(COLON, beginIndex);
case 60:
switch (currentCharCode) {
case 60:
next();
if (currentCharCode === 61) {
next();
return createToken(LEFT_SHIFT_EQUAL, beginIndex);
}
return createToken(LEFT_SHIFT, beginIndex);
case 61:
next();
return createToken(LESS_EQUAL, beginIndex);
default:
return createToken(OPEN_ANGLE, beginIndex);
}
case 62:
switch (currentCharCode) {
case 62:
next();
switch (currentCharCode) {
case 61:
next();
return createToken(RIGHT_SHIFT_EQUAL, beginIndex);
case 62:
next();
if (currentCharCode === 61) {
next();
return createToken(UNSIGNED_RIGHT_SHIFT_EQUAL, beginIndex);
}
return createToken(UNSIGNED_RIGHT_SHIFT, beginIndex);
default:
return createToken(RIGHT_SHIFT, beginIndex);
}
case 61:
next();
return createToken(GREATER_EQUAL, beginIndex);
default:
return createToken(CLOSE_ANGLE, beginIndex);
}
case 61:
if (currentCharCode === 61) {
next();
if (currentCharCode === 61) {
next();
return createToken(EQUAL_EQUAL_EQUAL, beginIndex);
}
return createToken(EQUAL_EQUAL, beginIndex);
}
if (currentCharCode === 62 && parseOptions.arrowFunctions) {
next();
return createToken(ARROW, beginIndex);
}
return createToken(EQUAL, beginIndex);
case 33:
if (currentCharCode === 61) {
next();
if (currentCharCode === 61) {
next();
return createToken(NOT_EQUAL_EQUAL, beginIndex);
}
return createToken(NOT_EQUAL, beginIndex);
}
return createToken(BANG, beginIndex);
case 42:
if (currentCharCode === 61) {
next();
return createToken(STAR_EQUAL, beginIndex);
}
if (currentCharCode === 42 && parseOptions.exponentiation) {
next();
if (currentCharCode === 61) {
next();
return createToken(STAR_STAR_EQUAL, beginIndex);
}
return createToken(STAR_STAR, beginIndex);
}
return createToken(STAR, beginIndex);
case 37:
if (currentCharCode === 61) {
next();
return createToken(PERCENT_EQUAL, beginIndex);
}
return createToken(PERCENT, beginIndex);
case 94:
if (currentCharCode === 61) {
next();
return createToken(CARET_EQUAL, beginIndex);
}
return createToken(CARET, beginIndex);
case 47:
if (currentCharCode === 61) {
next();
return createToken(SLASH_EQUAL, beginIndex);
}
return createToken(SLASH, beginIndex);
case 43:
switch (currentCharCode) {
case 43:
next();
return createToken(PLUS_PLUS, beginIndex);
case 61:
next();
return createToken(PLUS_EQUAL, beginIndex);
default:
return createToken(PLUS, beginIndex);
}
case 45:
switch (currentCharCode) {
case 45:
next();
return createToken(MINUS_MINUS, beginIndex);
case 61:
next();
return createToken(MINUS_EQUAL, beginIndex);
default:
return createToken(MINUS, beginIndex);
}
case 38:
switch (currentCharCode) {
case 38:
next();
return createToken(AND, beginIndex);
case 61:
next();
return createToken(AMPERSAND_EQUAL, beginIndex);
default:
return createToken(AMPERSAND, beginIndex);
}
case 124:
switch (currentCharCode) {
case 124:
next();
return createToken(OR, beginIndex);
case 61:
next();
return createToken(BAR_EQUAL, beginIndex);
default:
return createToken(BAR, beginIndex);
}
case 96:
return scanTemplateStart(beginIndex);
case 64:
return createToken(AT, beginIndex);
case 48:
return scanPostZero(beginIndex);
case 49:
case 50:
case 51:
case 52:
case 53:
case 54:
case 55:
case 56:
case 57:
return scanPostDigit(beginIndex);
case 34:
case 39:
return scanStringLiteral(beginIndex, code);
default:
return scanIdentifierOrKeyword(beginIndex, code);
}
}
function scanNumberPostPeriod(beginIndex) {
skipDecimalDigits();
return scanExponentOfNumericLiteral(beginIndex);
}
function scanPostDigit(beginIndex) {
skipDecimalDigits();
return scanFractionalNumericLiteral(beginIndex);
}
function scanPostZero(beginIndex) {
switch (currentCharCode) {
case 46:
return scanFractionalNumericLiteral(beginIndex);
case 88:
case 120:
next();
if (!isHexDigit(currentCharCode)) {
reportError('Hex Integer Literal must contain at least one digit');
}
skipHexDigits();
return new LiteralToken(NUMBER, getTokenString(beginIndex), getTokenRange(beginIndex));
case 66:
case 98:
if (!parseOptions.numericLiterals)
break;
next();
if (!isBinaryDigit(currentCharCode)) {
reportError('Binary Integer Literal must contain at least one digit');
}
skipBinaryDigits();
return new LiteralToken(NUMBER, getTokenString(beginIndex), getTokenRange(beginIndex));
case 79:
case 111:
if (!parseOptions.numericLiterals)
break;
next();
if (!isOctalDigit(currentCharCode)) {
reportError('Octal Integer Literal must contain at least one digit');
}
skipOctalDigits();
return new LiteralToken(NUMBER, getTokenString(beginIndex), getTokenRange(beginIndex));
case 48:
case 49:
case 50:
case 51:
case 52:
case 53:
case 54:
case 55:
case 56:
case 57:
return scanPostDigit(beginIndex);
}
return new LiteralToken(NUMBER, getTokenString(beginIndex), getTokenRange(beginIndex));
}
function createToken(type, beginIndex) {
return new Token(type, getTokenRange(beginIndex));
}
function readUnicodeEscapeSequence() {
var beginIndex = index;
if (currentCharCode === 117) {
next();
if (skipHexDigit() && skipHexDigit() && skipHexDigit() && skipHexDigit()) {
return parseInt(getTokenString(beginIndex + 1), 16);
}
}
reportError('Invalid unicode escape sequence in identifier', beginIndex - 1);
return 0;
}
function scanIdentifierOrKeyword(beginIndex, code) {
var escapedCharCodes;
if (code === 92) {
code = readUnicodeEscapeSequence();
escapedCharCodes = [code];
}
if (!isIdentifierStart(code)) {
reportError(("Character code '" + code + "' is not a valid identifier start char"), beginIndex);
return createToken(ERROR, beginIndex);
}
for (; ; ) {
code = currentCharCode;
if (isIdentifierPart(code)) {
next();
} else if (code === 92) {
next();
code = readUnicodeEscapeSequence();
if (!escapedCharCodes)
escapedCharCodes = [];
escapedCharCodes.push(code);
if (!isIdentifierPart(code))
return createToken(ERROR, beginIndex);
} else {
break;
}
}
var value = input.slice(beginIndex, index);
var keywordType = getKeywordType(value);
if (keywordType)
return new KeywordToken(value, keywordType, getTokenRange(beginIndex));
if (escapedCharCodes) {
var i = 0;
value = value.replace(/\\u..../g, function(s) {
return String.fromCharCode(escapedCharCodes[i++]);
});
}
return new IdentifierToken(getTokenRange(beginIndex), value);
}
function scanStringLiteral(beginIndex, terminator) {
while (peekStringLiteralChar(terminator)) {
if (!skipStringLiteralChar()) {
return new LiteralToken(STRING, getTokenString(beginIndex), getTokenRange(beginIndex));
}
}
if (currentCharCode !== terminator) {
reportError('Unterminated String Literal', beginIndex);
} else {
next();
}
return new LiteralToken(STRING, getTokenString(beginIndex), getTokenRange(beginIndex));
}
function getTokenString(beginIndex) {
return input.substring(beginIndex, index);
}
function peekStringLiteralChar(terminator) {
return !isAtEnd() && currentCharCode !== terminator && !isLineTerminator(currentCharCode);
}
function skipStringLiteralChar() {
if (currentCharCode === 92) {
return skipStringLiteralEscapeSequence();
}
next();
return true;
}
function skipStringLiteralEscapeSequence() {
next();
if (isAtEnd()) {
reportError('Unterminated string literal escape sequence');
return false;
}
if (isLineTerminator(currentCharCode)) {
skipLineTerminator();
return true;
}
var code = currentCharCode;
next();
switch (code) {
case 39:
case 34:
case 92:
case 98:
case 102:
case 110:
case 114:
case 116:
case 118:
case 48:
return true;
case 120:
return skipHexDigit() && skipHexDigit();
case 117:
return skipUnicodeEscapeSequence();
default:
return true;
}
}
function skipUnicodeEscapeSequence() {
if (currentCharCode === 123 && parseOptions.unicodeEscapeSequences) {
next();
var beginIndex = index;
if (!isHexDigit(currentCharCode)) {
reportError('Hex digit expected');
return false;
}
skipHexDigits();
if (currentCharCode !== 125) {
reportError('Hex digit expected');
return false;
}
var codePoint = getTokenString(beginIndex, index);
if (parseInt(codePoint, 16) > 0x10FFFF) {
reportError('The code point in a Unicode escape sequence cannot exceed 10FFFF');
return false;
}
next();
return true;
}
return skipHexDigit() && skipHexDigit() && skipHexDigit() && skipHexDigit();
}
function skipHexDigit() {
if (!isHexDigit(currentCharCode)) {
reportError('Hex digit expected');
return false;
}
next();
return true;
}
function skipLineTerminator() {
var first = currentCharCode;
next();
if (first === 13 && currentCharCode === 10) {
next();
}
}
function scanFractionalNumericLiteral(beginIndex) {
if (currentCharCode === 46) {
next();
skipDecimalDigits();
}
return scanExponentOfNumericLiteral(beginIndex);
}
function scanExponentOfNumericLiteral(beginIndex) {
switch (currentCharCode) {
case 101:
case 69:
next();
switch (currentCharCode) {
case 43:
case 45:
next();
break;
}
if (!isDecimalDigit(currentCharCode)) {
reportError('Exponent part must contain at least one digit');
}
skipDecimalDigits();
break;
default:
break;
}
return new LiteralToken(NUMBER, getTokenString(beginIndex), getTokenRange(beginIndex));
}
function skipDecimalDigits() {
while (isDecimalDigit(currentCharCode)) {
next();
}
}
function skipHexDigits() {
while (isHexDigit(currentCharCode)) {
next();
}
}
function skipBinaryDigits() {
while (isBinaryDigit(currentCharCode)) {
next();
}
}
function skipOctalDigits() {
while (isOctalDigit(currentCharCode)) {
next();
}
}
function isAtEnd() {
return index === length;
}
function next() {
index++;
updateCurrentCharCode();
}
function updateCurrentCharCode() {
currentCharCode = input.charCodeAt(index);
}
function reportError(message) {
var indexArg = arguments[1] !== (void 0) ? arguments[1] : index;
var position = getPosition(indexArg);
errorReporter.reportError(position, message);
}
return {
get isWhitespace() {
return isWhitespace;
},
get isLineTerminator() {
return isLineTerminator;
},
get isIdentifierPart() {
return isIdentifierPart;
},
get Scanner() {
return Scanner;
}
};
});
System.register("traceur@0.0.74/src/syntax/Parser", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/syntax/Parser";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/syntax/Parser", path);
}
var FindVisitor = System.get("traceur@0.0.74/src/codegeneration/FindVisitor").FindVisitor;
var IdentifierToken = System.get("traceur@0.0.74/src/syntax/IdentifierToken").IdentifierToken;
var $__2 = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType"),
ARRAY_LITERAL_EXPRESSION = $__2.ARRAY_LITERAL_EXPRESSION,
BINDING_IDENTIFIER = $__2.BINDING_IDENTIFIER,
CALL_EXPRESSION = $__2.CALL_EXPRESSION,
COMPUTED_PROPERTY_NAME = $__2.COMPUTED_PROPERTY_NAME,
COVER_FORMALS = $__2.COVER_FORMALS,
FORMAL_PARAMETER_LIST = $__2.FORMAL_PARAMETER_LIST,
IDENTIFIER_EXPRESSION = $__2.IDENTIFIER_EXPRESSION,
LITERAL_PROPERTY_NAME = $__2.LITERAL_PROPERTY_NAME,
OBJECT_LITERAL_EXPRESSION = $__2.OBJECT_LITERAL_EXPRESSION,
REST_PARAMETER = $__2.REST_PARAMETER,
SYNTAX_ERROR_TREE = $__2.SYNTAX_ERROR_TREE;
var $__3 = System.get("traceur@0.0.74/src/syntax/PredefinedName"),
AS = $__3.AS,
ASYNC = $__3.ASYNC,
AWAIT = $__3.AWAIT,
FROM = $__3.FROM,
GET = $__3.GET,
OF = $__3.OF,
SET = $__3.SET;
var SyntaxErrorReporter = System.get("traceur@0.0.74/src/util/SyntaxErrorReporter").SyntaxErrorReporter;
var Scanner = System.get("traceur@0.0.74/src/syntax/Scanner").Scanner;
var SourceRange = System.get("traceur@0.0.74/src/util/SourceRange").SourceRange;
var StrictParams = System.get("traceur@0.0.74/src/staticsemantics/StrictParams").StrictParams;
var $__8 = System.get("traceur@0.0.74/src/syntax/Token"),
Token = $__8.Token,
isAssignmentOperator = $__8.isAssignmentOperator;
var getKeywordType = System.get("traceur@0.0.74/src/syntax/Keywords").getKeywordType;
var traceurOptions = System.get("traceur@0.0.74/src/Options").options;
var $__11 = System.get("traceur@0.0.74/src/syntax/TokenType"),
AMPERSAND = $__11.AMPERSAND,
AND = $__11.AND,
ARROW = $__11.ARROW,
AT = $__11.AT,
BANG = $__11.BANG,
BAR = $__11.BAR,
BREAK = $__11.BREAK,
CARET = $__11.CARET,
CASE = $__11.CASE,
CATCH = $__11.CATCH,
CLASS = $__11.CLASS,
CLOSE_ANGLE = $__11.CLOSE_ANGLE,
CLOSE_CURLY = $__11.CLOSE_CURLY,
CLOSE_PAREN = $__11.CLOSE_PAREN,
CLOSE_SQUARE = $__11.CLOSE_SQUARE,
COLON = $__11.COLON,
COMMA = $__11.COMMA,
CONST = $__11.CONST,
CONTINUE = $__11.CONTINUE,
DEBUGGER = $__11.DEBUGGER,
DEFAULT = $__11.DEFAULT,
DELETE = $__11.DELETE,
DO = $__11.DO,
DOT_DOT_DOT = $__11.DOT_DOT_DOT,
ELSE = $__11.ELSE,
END_OF_FILE = $__11.END_OF_FILE,
EQUAL = $__11.EQUAL,
EQUAL_EQUAL = $__11.EQUAL_EQUAL,
EQUAL_EQUAL_EQUAL = $__11.EQUAL_EQUAL_EQUAL,
ERROR = $__11.ERROR,
EXPORT = $__11.EXPORT,
EXTENDS = $__11.EXTENDS,
FALSE = $__11.FALSE,
FINALLY = $__11.FINALLY,
FOR = $__11.FOR,
FUNCTION = $__11.FUNCTION,
GREATER_EQUAL = $__11.GREATER_EQUAL,
IDENTIFIER = $__11.IDENTIFIER,
IF = $__11.IF,
IMPLEMENTS = $__11.IMPLEMENTS,
IMPORT = $__11.IMPORT,
IN = $__11.IN,
INSTANCEOF = $__11.INSTANCEOF,
INTERFACE = $__11.INTERFACE,
LEFT_SHIFT = $__11.LEFT_SHIFT,
LESS_EQUAL = $__11.LESS_EQUAL,
LET = $__11.LET,
MINUS = $__11.MINUS,
MINUS_MINUS = $__11.MINUS_MINUS,
NEW = $__11.NEW,
NO_SUBSTITUTION_TEMPLATE = $__11.NO_SUBSTITUTION_TEMPLATE,
NOT_EQUAL = $__11.NOT_EQUAL,
NOT_EQUAL_EQUAL = $__11.NOT_EQUAL_EQUAL,
NULL = $__11.NULL,
NUMBER = $__11.NUMBER,
OPEN_ANGLE = $__11.OPEN_ANGLE,
OPEN_CURLY = $__11.OPEN_CURLY,
OPEN_PAREN = $__11.OPEN_PAREN,
OPEN_SQUARE = $__11.OPEN_SQUARE,
OR = $__11.OR,
PACKAGE = $__11.PACKAGE,
PERCENT = $__11.PERCENT,
PERIOD = $__11.PERIOD,
PLUS = $__11.PLUS,
PLUS_PLUS = $__11.PLUS_PLUS,
PRIVATE = $__11.PRIVATE,
PROTECTED = $__11.PROTECTED,
PUBLIC = $__11.PUBLIC,
QUESTION = $__11.QUESTION,
RETURN = $__11.RETURN,
RIGHT_SHIFT = $__11.RIGHT_SHIFT,
SEMI_COLON = $__11.SEMI_COLON,
SLASH = $__11.SLASH,
SLASH_EQUAL = $__11.SLASH_EQUAL,
STAR = $__11.STAR,
STAR_STAR = $__11.STAR_STAR,
STATIC = $__11.STATIC,
STRING = $__11.STRING,
SUPER = $__11.SUPER,
SWITCH = $__11.SWITCH,
TEMPLATE_HEAD = $__11.TEMPLATE_HEAD,
TEMPLATE_TAIL = $__11.TEMPLATE_TAIL,
THIS = $__11.THIS,
THROW = $__11.THROW,
TILDE = $__11.TILDE,
TRUE = $__11.TRUE,
TRY = $__11.TRY,
TYPEOF = $__11.TYPEOF,
UNSIGNED_RIGHT_SHIFT = $__11.UNSIGNED_RIGHT_SHIFT,
VAR = $__11.VAR,
VOID = $__11.VOID,
WHILE = $__11.WHILE,
WITH = $__11.WITH,
YIELD = $__11.YIELD;
var $__12 = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees"),
ArgumentList = $__12.ArgumentList,
ArrayComprehension = $__12.ArrayComprehension,
ArrayLiteralExpression = $__12.ArrayLiteralExpression,
ArrayPattern = $__12.ArrayPattern,
ArrowFunctionExpression = $__12.ArrowFunctionExpression,
AssignmentElement = $__12.AssignmentElement,
AwaitExpression = $__12.AwaitExpression,
BinaryExpression = $__12.BinaryExpression,
BindingElement = $__12.BindingElement,
BindingIdentifier = $__12.BindingIdentifier,
Block = $__12.Block,
BreakStatement = $__12.BreakStatement,
CallExpression = $__12.CallExpression,
CaseClause = $__12.CaseClause,
Catch = $__12.Catch,
ClassDeclaration = $__12.ClassDeclaration,
ClassExpression = $__12.ClassExpression,
CommaExpression = $__12.CommaExpression,
ComprehensionFor = $__12.ComprehensionFor,
ComprehensionIf = $__12.ComprehensionIf,
ComputedPropertyName = $__12.ComputedPropertyName,
ConditionalExpression = $__12.ConditionalExpression,
ContinueStatement = $__12.ContinueStatement,
CoverFormals = $__12.CoverFormals,
CoverInitializedName = $__12.CoverInitializedName,
DebuggerStatement = $__12.DebuggerStatement,
Annotation = $__12.Annotation,
DefaultClause = $__12.DefaultClause,
DoWhileStatement = $__12.DoWhileStatement,
EmptyStatement = $__12.EmptyStatement,
ExportDeclaration = $__12.ExportDeclaration,
ExportDefault = $__12.ExportDefault,
ExportSpecifier = $__12.ExportSpecifier,
ExportSpecifierSet = $__12.ExportSpecifierSet,
ExportStar = $__12.ExportStar,
ExpressionStatement = $__12.ExpressionStatement,
Finally = $__12.Finally,
ForInStatement = $__12.ForInStatement,
ForOfStatement = $__12.ForOfStatement,
ForStatement = $__12.ForStatement,
FormalParameter = $__12.FormalParameter,
FormalParameterList = $__12.FormalParameterList,
FunctionBody = $__12.FunctionBody,
FunctionDeclaration = $__12.FunctionDeclaration,
FunctionExpression = $__12.FunctionExpression,
GeneratorComprehension = $__12.GeneratorComprehension,
GetAccessor = $__12.GetAccessor,
IdentifierExpression = $__12.IdentifierExpression,
IfStatement = $__12.IfStatement,
ImportDeclaration = $__12.ImportDeclaration,
ImportSpecifier = $__12.ImportSpecifier,
ImportSpecifierSet = $__12.ImportSpecifierSet,
ImportedBinding = $__12.ImportedBinding,
LabelledStatement = $__12.LabelledStatement,
LiteralExpression = $__12.LiteralExpression,
LiteralPropertyName = $__12.LiteralPropertyName,
MemberExpression = $__12.MemberExpression,
MemberLookupExpression = $__12.MemberLookupExpression,
Module = $__12.Module,
ModuleDeclaration = $__12.ModuleDeclaration,
ModuleSpecifier = $__12.ModuleSpecifier,
NamedExport = $__12.NamedExport,
NewExpression = $__12.NewExpression,
ObjectLiteralExpression = $__12.ObjectLiteralExpression,
ObjectPattern = $__12.ObjectPattern,
ObjectPatternField = $__12.ObjectPatternField,
ParenExpression = $__12.ParenExpression,
PostfixExpression = $__12.PostfixExpression,
PredefinedType = $__12.PredefinedType,
Script = $__12.Script,
PropertyMethodAssignment = $__12.PropertyMethodAssignment,
PropertyNameAssignment = $__12.PropertyNameAssignment,
PropertyNameShorthand = $__12.PropertyNameShorthand,
PropertyVariableDeclaration = $__12.PropertyVariableDeclaration,
RestParameter = $__12.RestParameter,
ReturnStatement = $__12.ReturnStatement,
SetAccessor = $__12.SetAccessor,
SpreadExpression = $__12.SpreadExpression,
SpreadPatternElement = $__12.SpreadPatternElement,
SuperExpression = $__12.SuperExpression,
SwitchStatement = $__12.SwitchStatement,
SyntaxErrorTree = $__12.SyntaxErrorTree,
TemplateLiteralExpression = $__12.TemplateLiteralExpression,
TemplateLiteralPortion = $__12.TemplateLiteralPortion,
TemplateSubstitution = $__12.TemplateSubstitution,
ThisExpression = $__12.ThisExpression,
ThrowStatement = $__12.ThrowStatement,
TryStatement = $__12.TryStatement,
TypeArguments = $__12.TypeArguments,
TypeName = $__12.TypeName,
TypeReference = $__12.TypeReference,
UnaryExpression = $__12.UnaryExpression,
VariableDeclaration = $__12.VariableDeclaration,
VariableDeclarationList = $__12.VariableDeclarationList,
VariableStatement = $__12.VariableStatement,
WhileStatement = $__12.WhileStatement,
WithStatement = $__12.WithStatement,
YieldExpression = $__12.YieldExpression;
var Expression = {
NO_IN: 'NO_IN',
NORMAL: 'NORMAL'
};
var DestructuringInitializer = {
REQUIRED: 'REQUIRED',
OPTIONAL: 'OPTIONAL'
};
var Initializer = {
ALLOWED: 'ALLOWED',
REQUIRED: 'REQUIRED'
};
var ValidateObjectLiteral = function ValidateObjectLiteral(tree) {
this.errorToken = null;
$traceurRuntime.superConstructor($ValidateObjectLiteral).call(this, tree);
};
var $ValidateObjectLiteral = ValidateObjectLiteral;
($traceurRuntime.createClass)(ValidateObjectLiteral, {visitCoverInitializedName: function(tree) {
this.errorToken = tree.equalToken;
this.found = true;
}}, {}, FindVisitor);
function containsInitializer(declarations) {
return declarations.some((function(v) {
return v.initializer;
}));
}
var Parser = function Parser(file) {
var errorReporter = arguments[1] !== (void 0) ? arguments[1] : new SyntaxErrorReporter();
var options = arguments[2] !== (void 0) ? arguments[2] : traceurOptions;
this.errorReporter_ = errorReporter;
this.scanner_ = new Scanner(errorReporter, file, this);
this.options_ = options;
this.allowYield = false;
this.allowAwait = false;
this.coverInitializedNameCount_ = 0;
this.strictMode_ = false;
this.annotations_ = [];
};
($traceurRuntime.createClass)(Parser, {
parseScript: function() {
this.strictMode_ = false;
var start = this.getTreeStartLocation_();
var scriptItemList = this.parseStatementList_(true);
this.eat_(END_OF_FILE);
return new Script(this.getTreeLocation_(start), scriptItemList);
},
parseStatementList_: function(checkUseStrictDirective) {
var result = [];
var type;
while ((type = this.peekType_()) !== CLOSE_CURLY && type !== END_OF_FILE) {
var statement = this.parseStatementListItem_(type);
if (checkUseStrictDirective) {
if (!statement.isDirectivePrologue()) {
checkUseStrictDirective = false;
} else if (statement.isUseStrictDirective()) {
this.strictMode_ = true;
checkUseStrictDirective = false;
}
}
result.push(statement);
}
return result;
},
parseStatementListItem_: function(type) {
return this.parseStatementWithType_(type);
},
parseModule: function() {
var start = this.getTreeStartLocation_();
var scriptItemList = this.parseModuleItemList_();
this.eat_(END_OF_FILE);
return new Module(this.getTreeLocation_(start), scriptItemList, null);
},
parseModuleItemList_: function() {
this.strictMode_ = true;
var result = [];
var type;
while ((type = this.peekType_()) !== END_OF_FILE) {
var statement = this.parseModuleItem_(type);
result.push(statement);
}
return result;
},
parseModuleItem_: function(type) {
switch (type) {
case IMPORT:
return this.parseImportDeclaration_();
case EXPORT:
return this.parseExportDeclaration_();
case AT:
if (this.options_.annotations)
return this.parseAnnotatedDeclarations_(true);
break;
}
return this.parseStatementListItem_(type);
},
parseModuleSpecifier_: function() {
var start = this.getTreeStartLocation_();
var token = this.eat_(STRING);
return new ModuleSpecifier(this.getTreeLocation_(start), token);
},
parseImportDeclaration_: function() {
var start = this.getTreeStartLocation_();
this.eat_(IMPORT);
if (this.peek_(STAR)) {
this.eat_(STAR);
this.eatId_(AS);
var binding = this.parseImportedBinding_();
this.eatId_(FROM);
var moduleSpecifier = this.parseModuleSpecifier_();
this.eatPossibleImplicitSemiColon_();
return new ModuleDeclaration(this.getTreeLocation_(start), binding, moduleSpecifier);
}
var importClause = null;
if (this.peekImportClause_(this.peekType_())) {
importClause = this.parseImportClause_();
this.eatId_(FROM);
}
var moduleSpecifier = this.parseModuleSpecifier_();
this.eatPossibleImplicitSemiColon_();
return new ImportDeclaration(this.getTreeLocation_(start), importClause, moduleSpecifier);
},
peekImportClause_: function(type) {
return type === OPEN_CURLY || this.peekBindingIdentifier_(type);
},
parseImportClause_: function() {
var start = this.getTreeStartLocation_();
if (this.eatIf_(OPEN_CURLY)) {
var specifiers = [];
while (!this.peek_(CLOSE_CURLY) && !this.isAtEnd()) {
specifiers.push(this.parseImportSpecifier_());
if (!this.eatIf_(COMMA))
break;
}
this.eat_(CLOSE_CURLY);
return new ImportSpecifierSet(this.getTreeLocation_(start), specifiers);
}
return this.parseImportedBinding_();
},
parseImportedBinding_: function() {
var start = this.getTreeStartLocation_();
var binding = this.parseBindingIdentifier_();
return new ImportedBinding(this.getTreeLocation_(start), binding);
},
parseImportSpecifier_: function() {
var start = this.getTreeStartLocation_();
var token = this.peekToken_();
var isKeyword = token.isKeyword();
var binding;
var name = this.eatIdName_();
if (isKeyword || this.peekPredefinedString_(AS)) {
this.eatId_(AS);
binding = this.parseImportedBinding_();
} else {
binding = new ImportedBinding(name.location, new BindingIdentifier(name.location, name));
name = null;
}
return new ImportSpecifier(this.getTreeLocation_(start), binding, name);
},
parseExportDeclaration_: function() {
var start = this.getTreeStartLocation_();
this.eat_(EXPORT);
var exportTree;
var annotations = this.popAnnotations_();
var type = this.peekType_();
switch (type) {
case CONST:
case LET:
case VAR:
exportTree = this.parseVariableStatement_();
break;
case FUNCTION:
exportTree = this.parseFunctionDeclaration_();
break;
case CLASS:
exportTree = this.parseClassDeclaration_();
break;
case DEFAULT:
exportTree = this.parseExportDefault_();
break;
case OPEN_CURLY:
case STAR:
exportTree = this.parseNamedExport_();
break;
case IDENTIFIER:
if (this.options_.asyncFunctions && this.peekPredefinedString_(ASYNC)) {
var asyncToken = this.eatId_();
exportTree = this.parseAsyncFunctionDeclaration_(asyncToken);
break;
}
default:
return this.parseUnexpectedToken_(type);
}
return new ExportDeclaration(this.getTreeLocation_(start), exportTree, annotations);
},
parseExportDefault_: function() {
var start = this.getTreeStartLocation_();
this.eat_(DEFAULT);
var exportValue;
switch (this.peekType_()) {
case FUNCTION:
var tree = this.parseFunctionExpression_();
if (tree.name) {
tree = new FunctionDeclaration(tree.location, tree.name, tree.functionKind, tree.parameterList, tree.typeAnnotation, tree.annotations, tree.body);
}
exportValue = tree;
break;
case CLASS:
if (this.options_.classes) {
var tree = this.parseClassExpression_();
if (tree.name) {
tree = new ClassDeclaration(tree.location, tree.name, tree.superClass, tree.elements, tree.annotations);
}
exportValue = tree;
break;
}
default:
exportValue = this.parseAssignmentExpression();
this.eatPossibleImplicitSemiColon_();
}
return new ExportDefault(this.getTreeLocation_(start), exportValue);
},
parseNamedExport_: function() {
var start = this.getTreeStartLocation_();
var specifierSet,
expression = null;
if (this.peek_(OPEN_CURLY)) {
specifierSet = this.parseExportSpecifierSet_();
if (this.peekPredefinedString_(FROM)) {
this.eatId_(FROM);
expression = this.parseModuleSpecifier_();
} else {
this.validateExportSpecifierSet_(specifierSet);
}
} else {
this.eat_(STAR);
specifierSet = new ExportStar(this.getTreeLocation_(start));
this.eatId_(FROM);
expression = this.parseModuleSpecifier_();
}
this.eatPossibleImplicitSemiColon_();
return new NamedExport(this.getTreeLocation_(start), expression, specifierSet);
},
parseExportSpecifierSet_: function() {
var start = this.getTreeStartLocation_();
this.eat_(OPEN_CURLY);
var specifiers = [this.parseExportSpecifier_()];
while (this.eatIf_(COMMA)) {
if (this.peek_(CLOSE_CURLY))
break;
specifiers.push(this.parseExportSpecifier_());
}
this.eat_(CLOSE_CURLY);
return new ExportSpecifierSet(this.getTreeLocation_(start), specifiers);
},
parseExportSpecifier_: function() {
var start = this.getTreeStartLocation_();
var lhs = this.eatIdName_();
var rhs = null;
if (this.peekPredefinedString_(AS)) {
this.eatId_();
rhs = this.eatIdName_();
}
return new ExportSpecifier(this.getTreeLocation_(start), lhs, rhs);
},
validateExportSpecifierSet_: function(tree) {
for (var i = 0; i < tree.specifiers.length; i++) {
var specifier = tree.specifiers[i];
if (getKeywordType(specifier.lhs.value)) {
this.reportError_(specifier.lhs.location, ("Unexpected token " + specifier.lhs.value));
}
}
},
peekId_: function(type) {
if (type === IDENTIFIER)
return true;
if (this.strictMode_)
return false;
return this.peekToken_().isStrictKeyword();
},
peekIdName_: function(token) {
return token.type === IDENTIFIER || token.isKeyword();
},
parseClassShared_: function(constr) {
var start = this.getTreeStartLocation_();
var strictMode = this.strictMode_;
this.strictMode_ = true;
this.eat_(CLASS);
var name = null;
var annotations = [];
if (constr == ClassDeclaration || !this.peek_(EXTENDS) && !this.peek_(OPEN_CURLY)) {
name = this.parseBindingIdentifier_();
annotations = this.popAnnotations_();
}
var superClass = null;
if (this.eatIf_(EXTENDS)) {
superClass = this.parseAssignmentExpression();
}
this.eat_(OPEN_CURLY);
var elements = this.parseClassElements_();
this.eat_(CLOSE_CURLY);
this.strictMode_ = strictMode;
return new constr(this.getTreeLocation_(start), name, superClass, elements, annotations);
},
parseClassDeclaration_: function() {
return this.parseClassShared_(ClassDeclaration);
},
parseClassExpression_: function() {
return this.parseClassShared_(ClassExpression);
},
parseClassElements_: function() {
var result = [];
while (true) {
var type = this.peekType_();
if (type === SEMI_COLON) {
this.nextToken_();
} else if (this.peekClassElement_(this.peekType_())) {
result.push(this.parseClassElement_());
} else {
break;
}
}
return result;
},
peekClassElement_: function(type) {
return this.peekPropertyName_(type) || type === STAR && this.options_.generators || type === AT && this.options_.annotations;
},
parsePropertyName_: function() {
if (this.peek_(OPEN_SQUARE))
return this.parseComputedPropertyName_();
return this.parseLiteralPropertyName_();
},
parseLiteralPropertyName_: function() {
var start = this.getTreeStartLocation_();
var token = this.nextToken_();
return new LiteralPropertyName(this.getTreeLocation_(start), token);
},
parseComputedPropertyName_: function() {
var start = this.getTreeStartLocation_();
this.eat_(OPEN_SQUARE);
var expression = this.parseAssignmentExpression();
this.eat_(CLOSE_SQUARE);
return new ComputedPropertyName(this.getTreeLocation_(start), expression);
},
parseStatement: function() {
return this.parseModuleItem_(this.peekType_());
},
parseStatements: function() {
return this.parseModuleItemList_();
},
parseStatement_: function() {
return this.parseStatementWithType_(this.peekType_());
},
parseStatementWithType_: function(type) {
switch (type) {
case RETURN:
return this.parseReturnStatement_();
case CONST:
case LET:
if (!this.options_.blockBinding)
break;
case VAR:
return this.parseVariableStatement_();
case IF:
return this.parseIfStatement_();
case FOR:
return this.parseForStatement_();
case BREAK:
return this.parseBreakStatement_();
case SWITCH:
return this.parseSwitchStatement_();
case THROW:
return this.parseThrowStatement_();
case WHILE:
return this.parseWhileStatement_();
case FUNCTION:
return this.parseFunctionDeclaration_();
case AT:
if (this.options_.annotations)
return this.parseAnnotatedDeclarations_(false);
break;
case CLASS:
if (this.options_.classes)
return this.parseClassDeclaration_();
break;
case CONTINUE:
return this.parseContinueStatement_();
case DEBUGGER:
return this.parseDebuggerStatement_();
case DO:
return this.parseDoWhileStatement_();
case OPEN_CURLY:
return this.parseBlock_();
case SEMI_COLON:
return this.parseEmptyStatement_();
case TRY:
return this.parseTryStatement_();
case WITH:
return this.parseWithStatement_();
}
return this.parseFallThroughStatement_();
},
parseFunctionDeclaration_: function() {
return this.parseFunction_(FunctionDeclaration);
},
parseFunctionExpression_: function() {
return this.parseFunction_(FunctionExpression);
},
parseAsyncFunctionDeclaration_: function(asyncToken) {
return this.parseAsyncFunction_(asyncToken, FunctionDeclaration);
},
parseAsyncFunctionExpression_: function(asyncToken) {
return this.parseAsyncFunction_(asyncToken, FunctionExpression);
},
parseAsyncFunction_: function(asyncToken, ctor) {
var start = asyncToken.location.start;
this.eat_(FUNCTION);
return this.parseFunction2_(start, asyncToken, ctor);
},
parseFunction_: function(ctor) {
var start = this.getTreeStartLocation_();
this.eat_(FUNCTION);
var functionKind = null;
if (this.options_.generators && this.peek_(STAR))
functionKind = this.eat_(STAR);
return this.parseFunction2_(start, functionKind, ctor);
},
parseFunction2_: function(start, functionKind, ctor) {
var name = null;
var annotations = [];
if (ctor === FunctionDeclaration || this.peekBindingIdentifier_(this.peekType_())) {
name = this.parseBindingIdentifier_();
annotations = this.popAnnotations_();
}
this.eat_(OPEN_PAREN);
var parameters = this.parseFormalParameters_();
this.eat_(CLOSE_PAREN);
var typeAnnotation = this.parseTypeAnnotationOpt_();
var body = this.parseFunctionBody_(functionKind, parameters);
return new ctor(this.getTreeLocation_(start), name, functionKind, parameters, typeAnnotation, annotations, body);
},
peekRest_: function(type) {
return type === DOT_DOT_DOT && this.options_.restParameters;
},
parseFormalParameters_: function() {
var start = this.getTreeStartLocation_();
var formals = [];
this.pushAnnotations_();
var type = this.peekType_();
if (this.peekRest_(type)) {
formals.push(this.parseFormalRestParameter_());
} else {
if (this.peekFormalParameter_(this.peekType_()))
formals.push(this.parseFormalParameter_());
while (this.eatIf_(COMMA)) {
this.pushAnnotations_();
if (this.peekRest_(this.peekType_())) {
formals.push(this.parseFormalRestParameter_());
break;
}
formals.push(this.parseFormalParameter_());
}
}
return new FormalParameterList(this.getTreeLocation_(start), formals);
},
peekFormalParameter_: function(type) {
return this.peekBindingElement_(type);
},
parseFormalParameter_: function() {
var initializerAllowed = arguments[0];
var start = this.getTreeStartLocation_();
var binding = this.parseBindingElementBinding_();
var typeAnnotation = this.parseTypeAnnotationOpt_();
var initializer = this.parseBindingElementInitializer_(initializerAllowed);
return new FormalParameter(this.getTreeLocation_(start), new BindingElement(this.getTreeLocation_(start), binding, initializer), typeAnnotation, this.popAnnotations_());
},
parseFormalRestParameter_: function() {
var start = this.getTreeStartLocation_();
var restParameter = this.parseRestParameter_();
var typeAnnotation = this.parseTypeAnnotationOpt_();
return new FormalParameter(this.getTreeLocation_(start), restParameter, typeAnnotation, this.popAnnotations_());
},
parseRestParameter_: function() {
var start = this.getTreeStartLocation_();
this.eat_(DOT_DOT_DOT);
var id = this.parseBindingIdentifier_();
return new RestParameter(this.getTreeLocation_(start), id);
},
parseFunctionBody_: function(functionKind, params) {
var start = this.getTreeStartLocation_();
this.eat_(OPEN_CURLY);
var allowYield = this.allowYield;
var allowAwait = this.allowAwait;
var strictMode = this.strictMode_;
this.allowYield = functionKind && functionKind.type === STAR;
this.allowAwait = functionKind && functionKind.type === IDENTIFIER && functionKind.value === ASYNC;
var result = this.parseStatementList_(!strictMode);
if (!strictMode && this.strictMode_ && params)
StrictParams.visit(params, this.errorReporter_);
this.strictMode_ = strictMode;
this.allowYield = allowYield;
this.allowAwait = allowAwait;
this.eat_(CLOSE_CURLY);
return new FunctionBody(this.getTreeLocation_(start), result);
},
parseSpreadExpression_: function() {
if (!this.options_.spread)
return this.parseUnexpectedToken_(DOT_DOT_DOT);
var start = this.getTreeStartLocation_();
this.eat_(DOT_DOT_DOT);
var operand = this.parseAssignmentExpression();
return new SpreadExpression(this.getTreeLocation_(start), operand);
},
parseBlock_: function() {
var start = this.getTreeStartLocation_();
this.eat_(OPEN_CURLY);
var result = this.parseStatementList_(false);
this.eat_(CLOSE_CURLY);
return new Block(this.getTreeLocation_(start), result);
},
parseVariableStatement_: function() {
var start = this.getTreeStartLocation_();
var declarations = this.parseVariableDeclarationList_();
this.checkInitializers_(declarations);
this.eatPossibleImplicitSemiColon_();
return new VariableStatement(this.getTreeLocation_(start), declarations);
},
parseVariableDeclarationList_: function() {
var expressionIn = arguments[0] !== (void 0) ? arguments[0] : Expression.NORMAL;
var initializer = arguments[1] !== (void 0) ? arguments[1] : DestructuringInitializer.REQUIRED;
var type = this.peekType_();
switch (type) {
case CONST:
case LET:
if (!this.options_.blockBinding)
debugger;
case VAR:
this.nextToken_();
break;
default:
throw Error('unreachable');
}
var start = this.getTreeStartLocation_();
var declarations = [];
declarations.push(this.parseVariableDeclaration_(type, expressionIn, initializer));
while (this.eatIf_(COMMA)) {
declarations.push(this.parseVariableDeclaration_(type, expressionIn, initializer));
}
return new VariableDeclarationList(this.getTreeLocation_(start), type, declarations);
},
parseVariableDeclaration_: function(binding, expressionIn) {
var initializer = arguments[2] !== (void 0) ? arguments[2] : DestructuringInitializer.REQUIRED;
var initRequired = initializer !== DestructuringInitializer.OPTIONAL;
var start = this.getTreeStartLocation_();
var lvalue;
var typeAnnotation;
if (this.peekPattern_(this.peekType_())) {
lvalue = this.parseBindingPattern_();
typeAnnotation = null;
} else {
lvalue = this.parseBindingIdentifier_();
typeAnnotation = this.parseTypeAnnotationOpt_();
}
var initializer = null;
if (this.peek_(EQUAL))
initializer = this.parseInitializer_(expressionIn);
else if (lvalue.isPattern() && initRequired)
this.reportError_('destructuring must have an initializer');
return new VariableDeclaration(this.getTreeLocation_(start), lvalue, typeAnnotation, initializer);
},
parseInitializer_: function(expressionIn) {
this.eat_(EQUAL);
return this.parseAssignmentExpression(expressionIn);
},
parseInitializerOpt_: function(expressionIn) {
if (this.eatIf_(EQUAL))
return this.parseAssignmentExpression(expressionIn);
return null;
},
parseEmptyStatement_: function() {
var start = this.getTreeStartLocation_();
this.eat_(SEMI_COLON);
return new EmptyStatement(this.getTreeLocation_(start));
},
parseFallThroughStatement_: function() {
var start = this.getTreeStartLocation_();
var expression;
if (this.options_.asyncFunctions && this.peekPredefinedString_(ASYNC) && this.peek_(FUNCTION, 1)) {
var asyncToken = this.eatId_();
var functionToken = this.peekTokenNoLineTerminator_();
if (functionToken !== null)
return this.parseAsyncFunctionDeclaration_(asyncToken);
expression = new IdentifierExpression(this.getTreeLocation_(start), asyncToken);
} else {
expression = this.parseExpression();
}
if (expression.type === IDENTIFIER_EXPRESSION) {
if (this.eatIf_(COLON)) {
var nameToken = expression.identifierToken;
var statement = this.parseStatement_();
return new LabelledStatement(this.getTreeLocation_(start), nameToken, statement);
}
}
this.eatPossibleImplicitSemiColon_();
return new ExpressionStatement(this.getTreeLocation_(start), expression);
},
parseIfStatement_: function() {
var start = this.getTreeStartLocation_();
this.eat_(IF);
this.eat_(OPEN_PAREN);
var condition = this.parseExpression();
this.eat_(CLOSE_PAREN);
var ifClause = this.parseStatement_();
var elseClause = null;
if (this.eatIf_(ELSE)) {
elseClause = this.parseStatement_();
}
return new IfStatement(this.getTreeLocation_(start), condition, ifClause, elseClause);
},
parseDoWhileStatement_: function() {
var start = this.getTreeStartLocation_();
this.eat_(DO);
var body = this.parseStatement_();
this.eat_(WHILE);
this.eat_(OPEN_PAREN);
var condition = this.parseExpression();
this.eat_(CLOSE_PAREN);
this.eatPossibleImplicitSemiColon_();
return new DoWhileStatement(this.getTreeLocation_(start), body, condition);
},
parseWhileStatement_: function() {
var start = this.getTreeStartLocation_();
this.eat_(WHILE);
this.eat_(OPEN_PAREN);
var condition = this.parseExpression();
this.eat_(CLOSE_PAREN);
var body = this.parseStatement_();
return new WhileStatement(this.getTreeLocation_(start), condition, body);
},
parseForStatement_: function() {
var start = this.getTreeStartLocation_();
this.eat_(FOR);
this.eat_(OPEN_PAREN);
var type = this.peekType_();
if (this.peekVariableDeclarationList_(type)) {
var variables = this.parseVariableDeclarationList_(Expression.NO_IN, DestructuringInitializer.OPTIONAL);
var declarations = variables.declarations;
if (declarations.length > 1 || containsInitializer(declarations)) {
return this.parseForStatement2_(start, variables);
}
type = this.peekType_();
if (type === IN) {
return this.parseForInStatement_(start, variables);
} else if (this.peekOf_(type)) {
return this.parseForOfStatement_(start, variables);
} else {
this.checkInitializers_(variables);
return this.parseForStatement2_(start, variables);
}
}
if (type === SEMI_COLON) {
return this.parseForStatement2_(start, null);
}
var coverInitializedNameCount = this.coverInitializedNameCount_;
var initializer = this.parseExpressionAllowPattern_(Expression.NO_IN);
type = this.peekType_();
if (initializer.isLeftHandSideExpression() && (type === IN || this.peekOf_(type))) {
initializer = this.transformLeftHandSideExpression_(initializer);
if (this.peekOf_(type))
return this.parseForOfStatement_(start, initializer);
return this.parseForInStatement_(start, initializer);
}
this.ensureNoCoverInitializedNames_(initializer, coverInitializedNameCount);
return this.parseForStatement2_(start, initializer);
},
peekOf_: function(type) {
return type === IDENTIFIER && this.options_.forOf && this.peekToken_().value === OF;
},
parseForOfStatement_: function(start, initializer) {
this.eatId_();
var collection = this.parseExpression();
this.eat_(CLOSE_PAREN);
var body = this.parseStatement_();
return new ForOfStatement(this.getTreeLocation_(start), initializer, collection, body);
},
checkInitializers_: function(variables) {
if (this.options_.blockBinding && variables.declarationType == CONST) {
var type = variables.declarationType;
for (var i = 0; i < variables.declarations.length; i++) {
if (!this.checkInitializer_(type, variables.declarations[i])) {
break;
}
}
}
},
checkInitializer_: function(type, declaration) {
if (this.options_.blockBinding && type == CONST && declaration.initializer == null) {
this.reportError_('const variables must have an initializer');
return false;
}
return true;
},
peekVariableDeclarationList_: function(type) {
switch (type) {
case VAR:
return true;
case CONST:
case LET:
return this.options_.blockBinding;
default:
return false;
}
},
parseForStatement2_: function(start, initializer) {
this.eat_(SEMI_COLON);
var condition = null;
if (!this.peek_(SEMI_COLON)) {
condition = this.parseExpression();
}
this.eat_(SEMI_COLON);
var increment = null;
if (!this.peek_(CLOSE_PAREN)) {
increment = this.parseExpression();
}
this.eat_(CLOSE_PAREN);
var body = this.parseStatement_();
return new ForStatement(this.getTreeLocation_(start), initializer, condition, increment, body);
},
parseForInStatement_: function(start, initializer) {
this.eat_(IN);
var collection = this.parseExpression();
this.eat_(CLOSE_PAREN);
var body = this.parseStatement_();
return new ForInStatement(this.getTreeLocation_(start), initializer, collection, body);
},
parseContinueStatement_: function() {
var start = this.getTreeStartLocation_();
this.eat_(CONTINUE);
var name = null;
if (!this.peekImplicitSemiColon_(this.peekType_())) {
name = this.eatIdOpt_();
}
this.eatPossibleImplicitSemiColon_();
return new ContinueStatement(this.getTreeLocation_(start), name);
},
parseBreakStatement_: function() {
var start = this.getTreeStartLocation_();
this.eat_(BREAK);
var name = null;
if (!this.peekImplicitSemiColon_(this.peekType_())) {
name = this.eatIdOpt_();
}
this.eatPossibleImplicitSemiColon_();
return new BreakStatement(this.getTreeLocation_(start), name);
},
parseReturnStatement_: function() {
var start = this.getTreeStartLocation_();
this.eat_(RETURN);
var expression = null;
if (!this.peekImplicitSemiColon_(this.peekType_())) {
expression = this.parseExpression();
}
this.eatPossibleImplicitSemiColon_();
return new ReturnStatement(this.getTreeLocation_(start), expression);
},
parseYieldExpression_: function() {
var start = this.getTreeStartLocation_();
this.eat_(YIELD);
var expression = null;
var isYieldFor = false;
if (!this.peekImplicitSemiColon_(this.peekType_())) {
isYieldFor = this.eatIf_(STAR);
expression = this.parseAssignmentExpression();
}
return new YieldExpression(this.getTreeLocation_(start), expression, isYieldFor);
},
parseWithStatement_: function() {
if (this.strictMode_)
this.reportError_('Strict mode code may not include a with statement');
var start = this.getTreeStartLocation_();
this.eat_(WITH);
this.eat_(OPEN_PAREN);
var expression = this.parseExpression();
this.eat_(CLOSE_PAREN);
var body = this.parseStatement_();
return new WithStatement(this.getTreeLocation_(start), expression, body);
},
parseSwitchStatement_: function() {
var start = this.getTreeStartLocation_();
this.eat_(SWITCH);
this.eat_(OPEN_PAREN);
var expression = this.parseExpression();
this.eat_(CLOSE_PAREN);
this.eat_(OPEN_CURLY);
var caseClauses = this.parseCaseClauses_();
this.eat_(CLOSE_CURLY);
return new SwitchStatement(this.getTreeLocation_(start), expression, caseClauses);
},
parseCaseClauses_: function() {
var foundDefaultClause = false;
var result = [];
while (true) {
var start = this.getTreeStartLocation_();
switch (this.peekType_()) {
case CASE:
this.nextToken_();
var expression = this.parseExpression();
this.eat_(COLON);
var statements = this.parseCaseStatementsOpt_();
result.push(new CaseClause(this.getTreeLocation_(start), expression, statements));
break;
case DEFAULT:
if (foundDefaultClause) {
this.reportError_('Switch statements may have at most one default clause');
} else {
foundDefaultClause = true;
}
this.nextToken_();
this.eat_(COLON);
result.push(new DefaultClause(this.getTreeLocation_(start), this.parseCaseStatementsOpt_()));
break;
default:
return result;
}
}
},
parseCaseStatementsOpt_: function() {
var result = [];
var type;
while (true) {
switch (type = this.peekType_()) {
case CASE:
case DEFAULT:
case CLOSE_CURLY:
case END_OF_FILE:
return result;
}
result.push(this.parseStatementWithType_(type));
}
},
parseThrowStatement_: function() {
var start = this.getTreeStartLocation_();
this.eat_(THROW);
var value = null;
if (!this.peekImplicitSemiColon_(this.peekType_())) {
value = this.parseExpression();
}
this.eatPossibleImplicitSemiColon_();
return new ThrowStatement(this.getTreeLocation_(start), value);
},
parseTryStatement_: function() {
var start = this.getTreeStartLocation_();
this.eat_(TRY);
var body = this.parseBlock_();
var catchBlock = null;
if (this.peek_(CATCH)) {
catchBlock = this.parseCatch_();
}
var finallyBlock = null;
if (this.peek_(FINALLY)) {
finallyBlock = this.parseFinallyBlock_();
}
if (catchBlock == null && finallyBlock == null) {
this.reportError_("'catch' or 'finally' expected.");
}
return new TryStatement(this.getTreeLocation_(start), body, catchBlock, finallyBlock);
},
parseCatch_: function() {
var start = this.getTreeStartLocation_();
var catchBlock;
this.eat_(CATCH);
this.eat_(OPEN_PAREN);
var binding;
if (this.peekPattern_(this.peekType_()))
binding = this.parseBindingPattern_();
else
binding = this.parseBindingIdentifier_();
this.eat_(CLOSE_PAREN);
var catchBody = this.parseBlock_();
catchBlock = new Catch(this.getTreeLocation_(start), binding, catchBody);
return catchBlock;
},
parseFinallyBlock_: function() {
var start = this.getTreeStartLocation_();
this.eat_(FINALLY);
var finallyBlock = this.parseBlock_();
return new Finally(this.getTreeLocation_(start), finallyBlock);
},
parseDebuggerStatement_: function() {
var start = this.getTreeStartLocation_();
this.eat_(DEBUGGER);
this.eatPossibleImplicitSemiColon_();
return new DebuggerStatement(this.getTreeLocation_(start));
},
parsePrimaryExpression_: function() {
switch (this.peekType_()) {
case CLASS:
return this.options_.classes ? this.parseClassExpression_() : this.parseSyntaxError_('Unexpected reserved word');
case THIS:
return this.parseThisExpression_();
case IDENTIFIER:
var identifier = this.parseIdentifierExpression_();
if (this.options_.asyncFunctions && identifier.identifierToken.value === ASYNC) {
var token = this.peekTokenNoLineTerminator_();
if (token && token.type === FUNCTION) {
var asyncToken = identifier.identifierToken;
return this.parseAsyncFunctionExpression_(asyncToken);
}
}
return identifier;
case NUMBER:
case STRING:
case TRUE:
case FALSE:
case NULL:
return this.parseLiteralExpression_();
case OPEN_SQUARE:
return this.parseArrayLiteral_();
case OPEN_CURLY:
return this.parseObjectLiteral_();
case OPEN_PAREN:
return this.parsePrimaryExpressionStartingWithParen_();
case SLASH:
case SLASH_EQUAL:
return this.parseRegularExpressionLiteral_();
case NO_SUBSTITUTION_TEMPLATE:
case TEMPLATE_HEAD:
return this.parseTemplateLiteral_(null);
case IMPLEMENTS:
case INTERFACE:
case PACKAGE:
case PRIVATE:
case PROTECTED:
case PUBLIC:
case STATIC:
case YIELD:
if (!this.strictMode_)
return this.parseIdentifierExpression_();
this.reportReservedIdentifier_(this.nextToken_());
case END_OF_FILE:
return this.parseSyntaxError_('Unexpected end of input');
default:
return this.parseUnexpectedToken_(this.peekToken_());
}
},
parseSuperExpression_: function() {
var start = this.getTreeStartLocation_();
this.eat_(SUPER);
return new SuperExpression(this.getTreeLocation_(start));
},
parseThisExpression_: function() {
var start = this.getTreeStartLocation_();
this.eat_(THIS);
return new ThisExpression(this.getTreeLocation_(start));
},
peekBindingIdentifier_: function(type) {
return this.peekId_(type);
},
parseBindingIdentifier_: function() {
var start = this.getTreeStartLocation_();
var identifier = this.eatId_();
return new BindingIdentifier(this.getTreeLocation_(start), identifier);
},
parseIdentifierExpression_: function() {
var start = this.getTreeStartLocation_();
var identifier = this.eatId_();
return new IdentifierExpression(this.getTreeLocation_(start), identifier);
},
parseIdentifierNameExpression_: function() {
var start = this.getTreeStartLocation_();
var identifier = this.eatIdName_();
return new IdentifierExpression(this.getTreeLocation_(start), identifier);
},
parseLiteralExpression_: function() {
var start = this.getTreeStartLocation_();
var literal = this.nextLiteralToken_();
return new LiteralExpression(this.getTreeLocation_(start), literal);
},
nextLiteralToken_: function() {
return this.nextToken_();
},
parseRegularExpressionLiteral_: function() {
var start = this.getTreeStartLocation_();
var literal = this.nextRegularExpressionLiteralToken_();
return new LiteralExpression(this.getTreeLocation_(start), literal);
},
peekSpread_: function(type) {
return type === DOT_DOT_DOT && this.options_.spread;
},
parseArrayLiteral_: function() {
var start = this.getTreeStartLocation_();
var expression;
var elements = [];
this.eat_(OPEN_SQUARE);
var type = this.peekType_();
if (type === FOR && this.options_.arrayComprehension)
return this.parseArrayComprehension_(start);
while (true) {
type = this.peekType_();
if (type === COMMA) {
expression = null;
} else if (this.peekSpread_(type)) {
expression = this.parseSpreadExpression_();
} else if (this.peekAssignmentExpression_(type)) {
expression = this.parseAssignmentExpression();
} else {
break;
}
elements.push(expression);
type = this.peekType_();
if (type !== CLOSE_SQUARE)
this.eat_(COMMA);
}
this.eat_(CLOSE_SQUARE);
return new ArrayLiteralExpression(this.getTreeLocation_(start), elements);
},
parseArrayComprehension_: function(start) {
var list = this.parseComprehensionList_();
var expression = this.parseAssignmentExpression();
this.eat_(CLOSE_SQUARE);
return new ArrayComprehension(this.getTreeLocation_(start), list, expression);
},
parseComprehensionList_: function() {
var list = [this.parseComprehensionFor_()];
while (true) {
var type = this.peekType_();
switch (type) {
case FOR:
list.push(this.parseComprehensionFor_());
break;
case IF:
list.push(this.parseComprehensionIf_());
break;
default:
return list;
}
}
},
parseComprehensionFor_: function() {
var start = this.getTreeStartLocation_();
this.eat_(FOR);
this.eat_(OPEN_PAREN);
var left = this.parseForBinding_();
this.eatId_(OF);
var iterator = this.parseExpression();
this.eat_(CLOSE_PAREN);
return new ComprehensionFor(this.getTreeLocation_(start), left, iterator);
},
parseComprehensionIf_: function() {
var start = this.getTreeStartLocation_();
this.eat_(IF);
this.eat_(OPEN_PAREN);
var expression = this.parseExpression();
this.eat_(CLOSE_PAREN);
return new ComprehensionIf(this.getTreeLocation_(start), expression);
},
parseObjectLiteral_: function() {
var start = this.getTreeStartLocation_();
var result = [];
this.eat_(OPEN_CURLY);
while (this.peekPropertyDefinition_(this.peekType_())) {
var propertyDefinition = this.parsePropertyDefinition();
result.push(propertyDefinition);
if (!this.eatIf_(COMMA))
break;
}
this.eat_(CLOSE_CURLY);
return new ObjectLiteralExpression(this.getTreeLocation_(start), result);
},
parsePropertyDefinition: function() {
var start = this.getTreeStartLocation_();
var functionKind = null;
var isStatic = false;
if (this.options_.generators && this.options_.propertyMethods && this.peek_(STAR)) {
return this.parseGeneratorMethod_(start, isStatic, []);
}
var token = this.peekToken_();
var name = this.parsePropertyName_();
if (this.options_.propertyMethods && this.peek_(OPEN_PAREN))
return this.parseMethod_(start, isStatic, functionKind, name, []);
if (this.eatIf_(COLON)) {
var value = this.parseAssignmentExpression();
return new PropertyNameAssignment(this.getTreeLocation_(start), name, value);
}
var type = this.peekType_();
if (name.type === LITERAL_PROPERTY_NAME) {
var nameLiteral = name.literalToken;
if (nameLiteral.value === GET && this.peekPropertyName_(type)) {
return this.parseGetAccessor_(start, isStatic, []);
}
if (nameLiteral.value === SET && this.peekPropertyName_(type)) {
return this.parseSetAccessor_(start, isStatic, []);
}
if (this.options_.asyncFunctions && nameLiteral.value === ASYNC && this.peekPropertyName_(type)) {
var async = nameLiteral;
var name = this.parsePropertyName_();
return this.parseMethod_(start, isStatic, async, name, []);
}
if (this.options_.propertyNameShorthand && nameLiteral.type === IDENTIFIER || !this.strictMode_ && nameLiteral.type === YIELD) {
if (this.peek_(EQUAL)) {
token = this.nextToken_();
var coverInitializedNameCount = this.coverInitializedNameCount_;
var expr = this.parseAssignmentExpression();
this.ensureNoCoverInitializedNames_(expr, coverInitializedNameCount);
this.coverInitializedNameCount_++;
return new CoverInitializedName(this.getTreeLocation_(start), nameLiteral, token, expr);
}
if (nameLiteral.type === YIELD)
nameLiteral = new IdentifierToken(nameLiteral.location, YIELD);
return new PropertyNameShorthand(this.getTreeLocation_(start), nameLiteral);
}
if (this.strictMode_ && nameLiteral.isStrictKeyword())
this.reportReservedIdentifier_(nameLiteral);
}
if (name.type === COMPUTED_PROPERTY_NAME)
token = this.peekToken_();
return this.parseUnexpectedToken_(token);
},
parseClassElement_: function() {
var start = this.getTreeStartLocation_();
var annotations = this.parseAnnotations_();
var type = this.peekType_();
var isStatic = false,
functionKind = null;
switch (type) {
case STATIC:
var staticToken = this.nextToken_();
type = this.peekType_();
switch (type) {
case OPEN_PAREN:
var name = new LiteralPropertyName(start, staticToken);
return this.parseMethod_(start, isStatic, functionKind, name, annotations);
default:
isStatic = true;
if (type === STAR && this.options_.generators)
return this.parseGeneratorMethod_(start, true, annotations);
return this.parseClassElement2_(start, isStatic, annotations);
}
break;
case STAR:
return this.parseGeneratorMethod_(start, isStatic, annotations);
default:
return this.parseClassElement2_(start, isStatic, annotations);
}
},
parseGeneratorMethod_: function(start, isStatic, annotations) {
var functionKind = this.eat_(STAR);
var name = this.parsePropertyName_();
return this.parseMethod_(start, isStatic, functionKind, name, annotations);
},
parseMethod_: function(start, isStatic, functionKind, name, annotations) {
this.eat_(OPEN_PAREN);
var parameterList = this.parseFormalParameters_();
this.eat_(CLOSE_PAREN);
var typeAnnotation = this.parseTypeAnnotationOpt_();
var body = this.parseFunctionBody_(functionKind, parameterList);
return new PropertyMethodAssignment(this.getTreeLocation_(start), isStatic, functionKind, name, parameterList, typeAnnotation, annotations, body);
},
parsePropertyVariableDeclaration_: function(start, isStatic, name, annotations) {
var typeAnnotation = this.parseTypeAnnotationOpt_();
this.eat_(SEMI_COLON);
return new PropertyVariableDeclaration(this.getTreeLocation_(start), isStatic, name, typeAnnotation, annotations);
},
parseClassElement2_: function(start, isStatic, annotations) {
var functionKind = null;
var name = this.parsePropertyName_();
var type = this.peekType_();
if (name.type === LITERAL_PROPERTY_NAME && name.literalToken.value === GET && this.peekPropertyName_(type)) {
return this.parseGetAccessor_(start, isStatic, annotations);
}
if (name.type === LITERAL_PROPERTY_NAME && name.literalToken.value === SET && this.peekPropertyName_(type)) {
return this.parseSetAccessor_(start, isStatic, annotations);
}
if (this.options_.asyncFunctions && name.type === LITERAL_PROPERTY_NAME && name.literalToken.value === ASYNC && this.peekPropertyName_(type)) {
var async = name.literalToken;
var name = this.parsePropertyName_();
return this.parseMethod_(start, isStatic, async, name, annotations);
}
if (!this.options_.memberVariables || type === OPEN_PAREN) {
return this.parseMethod_(start, isStatic, functionKind, name, annotations);
}
return this.parsePropertyVariableDeclaration_(start, isStatic, name, annotations);
},
parseGetAccessor_: function(start, isStatic, annotations) {
var functionKind = null;
var name = this.parsePropertyName_();
this.eat_(OPEN_PAREN);
this.eat_(CLOSE_PAREN);
var typeAnnotation = this.parseTypeAnnotationOpt_();
var body = this.parseFunctionBody_(functionKind, null);
return new GetAccessor(this.getTreeLocation_(start), isStatic, name, typeAnnotation, annotations, body);
},
parseSetAccessor_: function(start, isStatic, annotations) {
var functionKind = null;
var name = this.parsePropertyName_();
this.eat_(OPEN_PAREN);
var parameterList = this.parsePropertySetParameterList_();
this.eat_(CLOSE_PAREN);
var body = this.parseFunctionBody_(functionKind, parameterList);
return new SetAccessor(this.getTreeLocation_(start), isStatic, name, parameterList, annotations, body);
},
peekPropertyDefinition_: function(type) {
return this.peekPropertyName_(type) || type == STAR && this.options_.propertyMethods && this.options_.generators;
},
peekPropertyName_: function(type) {
switch (type) {
case IDENTIFIER:
case STRING:
case NUMBER:
return true;
case OPEN_SQUARE:
return this.options_.computedPropertyNames;
default:
return this.peekToken_().isKeyword();
}
},
peekPredefinedString_: function(string) {
var token = this.peekToken_();
return token.type === IDENTIFIER && token.value === string;
},
parsePropertySetParameterList_: function() {
var start = this.getTreeStartLocation_();
var binding;
this.pushAnnotations_();
if (this.peekPattern_(this.peekType_()))
binding = this.parseBindingPattern_();
else
binding = this.parseBindingIdentifier_();
var typeAnnotation = this.parseTypeAnnotationOpt_();
var parameter = new FormalParameter(this.getTreeLocation_(start), new BindingElement(this.getTreeLocation_(start), binding, null), typeAnnotation, this.popAnnotations_());
return new FormalParameterList(parameter.location, [parameter]);
},
parsePrimaryExpressionStartingWithParen_: function() {
var start = this.getTreeStartLocation_();
this.eat_(OPEN_PAREN);
if (this.peek_(FOR) && this.options_.generatorComprehension)
return this.parseGeneratorComprehension_(start);
return this.parseCoverFormals_(start);
},
parseSyntaxError_: function(message) {
var start = this.getTreeStartLocation_();
this.reportError_(message);
var token = this.nextToken_();
return new SyntaxErrorTree(this.getTreeLocation_(start), token, message);
},
parseUnexpectedToken_: function(name) {
return this.parseSyntaxError_(("Unexpected token " + name));
},
peekExpression_: function(type) {
switch (type) {
case NO_SUBSTITUTION_TEMPLATE:
case TEMPLATE_HEAD:
return this.options_.templateLiterals;
case BANG:
case CLASS:
case DELETE:
case FALSE:
case FUNCTION:
case IDENTIFIER:
case MINUS:
case MINUS_MINUS:
case NEW:
case NULL:
case NUMBER:
case OPEN_CURLY:
case OPEN_PAREN:
case OPEN_SQUARE:
case PLUS:
case PLUS_PLUS:
case SLASH:
case SLASH_EQUAL:
case STRING:
case SUPER:
case THIS:
case TILDE:
case TRUE:
case TYPEOF:
case VOID:
case YIELD:
return true;
default:
return false;
}
},
parseExpression: function() {
var expressionIn = arguments[0] !== (void 0) ? arguments[0] : Expression.IN;
var coverInitializedNameCount = this.coverInitializedNameCount_;
var expression = this.parseExpressionAllowPattern_(expressionIn);
this.ensureNoCoverInitializedNames_(expression, coverInitializedNameCount);
return expression;
},
parseExpressionAllowPattern_: function(expressionIn) {
var start = this.getTreeStartLocation_();
var expression = this.parseAssignmentExpression(expressionIn);
if (this.peek_(COMMA)) {
var expressions = [expression];
while (this.eatIf_(COMMA)) {
expressions.push(this.parseAssignmentExpression(expressionIn));
}
return new CommaExpression(this.getTreeLocation_(start), expressions);
}
return expression;
},
peekAssignmentExpression_: function(type) {
return this.peekExpression_(type);
},
parseAssignmentExpression: function() {
var expressionIn = arguments[0] !== (void 0) ? arguments[0] : Expression.NORMAL;
if (this.allowYield && this.peek_(YIELD))
return this.parseYieldExpression_();
var start = this.getTreeStartLocation_();
var validAsyncParen = false;
if (this.options_.asyncFunctions && this.peekPredefinedString_(ASYNC)) {
var asyncToken = this.peekToken_();
var maybeOpenParenToken = this.peekToken_(1);
validAsyncParen = maybeOpenParenToken.type === OPEN_PAREN && asyncToken.location.end.line === maybeOpenParenToken.location.start.line;
}
var left = this.parseConditional_(expressionIn);
var type = this.peekType_();
if (this.options_.asyncFunctions && left.type === IDENTIFIER_EXPRESSION && left.identifierToken.value === ASYNC && type === IDENTIFIER) {
if (this.peekTokenNoLineTerminator_() !== null) {
var bindingIdentifier = this.parseBindingIdentifier_();
var asyncToken = left.IdentifierToken;
return this.parseArrowFunction_(start, bindingIdentifier, asyncToken);
}
}
if (type === ARROW) {
if (left.type === COVER_FORMALS || left.type === IDENTIFIER_EXPRESSION)
return this.parseArrowFunction_(start, left, null);
if (validAsyncParen && left.type === CALL_EXPRESSION) {
var arrowToken = this.peekTokenNoLineTerminator_();
if (arrowToken !== null) {
var asyncToken = left.operand.identifierToken;
return this.parseArrowFunction_(start, left.args, asyncToken);
}
}
}
left = this.coverFormalsToParenExpression_(left);
if (this.peekAssignmentOperator_(type)) {
if (type === EQUAL)
left = this.transformLeftHandSideExpression_(left);
if (!left.isLeftHandSideExpression() && !left.isPattern()) {
this.reportError_('Left hand side of assignment must be new, call, member, function, primary expressions or destructuring pattern');
}
var operator = this.nextToken_();
var right = this.parseAssignmentExpression(expressionIn);
return new BinaryExpression(this.getTreeLocation_(start), left, operator, right);
}
return left;
},
transformLeftHandSideExpression_: function(tree) {
switch (tree.type) {
case ARRAY_LITERAL_EXPRESSION:
case OBJECT_LITERAL_EXPRESSION:
this.scanner_.index = tree.location.start.offset;
return this.parseAssignmentPattern_();
}
return tree;
},
peekAssignmentOperator_: function(type) {
return isAssignmentOperator(type);
},
parseConditional_: function(expressionIn) {
var start = this.getTreeStartLocation_();
var condition = this.parseLogicalOR_(expressionIn);
if (this.eatIf_(QUESTION)) {
condition = this.toPrimaryExpression_(condition);
var left = this.parseAssignmentExpression();
this.eat_(COLON);
var right = this.parseAssignmentExpression(expressionIn);
return new ConditionalExpression(this.getTreeLocation_(start), condition, left, right);
}
return condition;
},
newBinaryExpression_: function(start, left, operator, right) {
left = this.toPrimaryExpression_(left);
right = this.toPrimaryExpression_(right);
return new BinaryExpression(this.getTreeLocation_(start), left, operator, right);
},
parseLogicalOR_: function(expressionIn) {
var start = this.getTreeStartLocation_();
var left = this.parseLogicalAND_(expressionIn);
var operator;
while (operator = this.eatOpt_(OR)) {
var right = this.parseLogicalAND_(expressionIn);
left = this.newBinaryExpression_(start, left, operator, right);
}
return left;
},
parseLogicalAND_: function(expressionIn) {
var start = this.getTreeStartLocation_();
var left = this.parseBitwiseOR_(expressionIn);
var operator;
while (operator = this.eatOpt_(AND)) {
var right = this.parseBitwiseOR_(expressionIn);
left = this.newBinaryExpression_(start, left, operator, right);
}
return left;
},
parseBitwiseOR_: function(expressionIn) {
var start = this.getTreeStartLocation_();
var left = this.parseBitwiseXOR_(expressionIn);
var operator;
while (operator = this.eatOpt_(BAR)) {
var right = this.parseBitwiseXOR_(expressionIn);
left = this.newBinaryExpression_(start, left, operator, right);
}
return left;
},
parseBitwiseXOR_: function(expressionIn) {
var start = this.getTreeStartLocation_();
var left = this.parseBitwiseAND_(expressionIn);
var operator;
while (operator = this.eatOpt_(CARET)) {
var right = this.parseBitwiseAND_(expressionIn);
left = this.newBinaryExpression_(start, left, operator, right);
}
return left;
},
parseBitwiseAND_: function(expressionIn) {
var start = this.getTreeStartLocation_();
var left = this.parseEquality_(expressionIn);
var operator;
while (operator = this.eatOpt_(AMPERSAND)) {
var right = this.parseEquality_(expressionIn);
left = this.newBinaryExpression_(start, left, operator, right);
}
return left;
},
parseEquality_: function(expressionIn) {
var start = this.getTreeStartLocation_();
var left = this.parseRelational_(expressionIn);
while (this.peekEqualityOperator_(this.peekType_())) {
var operator = this.nextToken_();
var right = this.parseRelational_(expressionIn);
left = this.newBinaryExpression_(start, left, operator, right);
}
return left;
},
peekEqualityOperator_: function(type) {
switch (type) {
case EQUAL_EQUAL:
case NOT_EQUAL:
case EQUAL_EQUAL_EQUAL:
case NOT_EQUAL_EQUAL:
return true;
}
return false;
},
parseRelational_: function(expressionIn) {
var start = this.getTreeStartLocation_();
var left = this.parseShiftExpression_();
while (this.peekRelationalOperator_(expressionIn)) {
var operator = this.nextToken_();
var right = this.parseShiftExpression_();
left = this.newBinaryExpression_(start, left, operator, right);
}
return left;
},
peekRelationalOperator_: function(expressionIn) {
switch (this.peekType_()) {
case OPEN_ANGLE:
case CLOSE_ANGLE:
case GREATER_EQUAL:
case LESS_EQUAL:
case INSTANCEOF:
return true;
case IN:
return expressionIn == Expression.NORMAL;
default:
return false;
}
},
parseShiftExpression_: function() {
var start = this.getTreeStartLocation_();
var left = this.parseAdditiveExpression_();
while (this.peekShiftOperator_(this.peekType_())) {
var operator = this.nextToken_();
var right = this.parseAdditiveExpression_();
left = this.newBinaryExpression_(start, left, operator, right);
}
return left;
},
peekShiftOperator_: function(type) {
switch (type) {
case LEFT_SHIFT:
case RIGHT_SHIFT:
case UNSIGNED_RIGHT_SHIFT:
return true;
default:
return false;
}
},
parseAdditiveExpression_: function() {
var start = this.getTreeStartLocation_();
var left = this.parseMultiplicativeExpression_();
while (this.peekAdditiveOperator_(this.peekType_())) {
var operator = this.nextToken_();
var right = this.parseMultiplicativeExpression_();
left = this.newBinaryExpression_(start, left, operator, right);
}
return left;
},
peekAdditiveOperator_: function(type) {
switch (type) {
case PLUS:
case MINUS:
return true;
default:
return false;
}
},
parseMultiplicativeExpression_: function() {
var start = this.getTreeStartLocation_();
var left = this.parseExponentiationExpression_();
while (this.peekMultiplicativeOperator_(this.peekType_())) {
var operator = this.nextToken_();
var right = this.parseExponentiationExpression_();
left = this.newBinaryExpression_(start, left, operator, right);
}
return left;
},
parseExponentiationExpression_: function() {
var start = this.getTreeStartLocation_();
var left = this.parseUnaryExpression_();
while (this.peekExponentiationExpression_(this.peekType_())) {
var operator = this.nextToken_();
var right = this.parseExponentiationExpression_();
left = this.newBinaryExpression_(start, left, operator, right);
}
return left;
},
peekMultiplicativeOperator_: function(type) {
switch (type) {
case STAR:
case SLASH:
case PERCENT:
return true;
default:
return false;
}
},
peekExponentiationExpression_: function(type) {
return type === STAR_STAR;
},
parseUnaryExpression_: function() {
var start = this.getTreeStartLocation_();
if (this.allowAwait && this.peekPredefinedString_(AWAIT)) {
this.eatId_();
var operand = this.parseUnaryExpression_();
operand = this.toPrimaryExpression_(operand);
return new AwaitExpression(this.getTreeLocation_(start), operand);
}
if (this.peekUnaryOperator_(this.peekType_())) {
var operator = this.nextToken_();
var operand = this.parseUnaryExpression_();
operand = this.toPrimaryExpression_(operand);
return new UnaryExpression(this.getTreeLocation_(start), operator, operand);
}
return this.parsePostfixExpression_();
},
peekUnaryOperator_: function(type) {
switch (type) {
case DELETE:
case VOID:
case TYPEOF:
case PLUS_PLUS:
case MINUS_MINUS:
case PLUS:
case MINUS:
case TILDE:
case BANG:
return true;
default:
return false;
}
},
parsePostfixExpression_: function() {
var start = this.getTreeStartLocation_();
var operand = this.parseLeftHandSideExpression_();
while (this.peekPostfixOperator_(this.peekType_())) {
operand = this.toPrimaryExpression_(operand);
var operator = this.nextToken_();
operand = new PostfixExpression(this.getTreeLocation_(start), operand, operator);
}
return operand;
},
peekPostfixOperator_: function(type) {
switch (type) {
case PLUS_PLUS:
case MINUS_MINUS:
var token = this.peekTokenNoLineTerminator_();
return token !== null;
}
return false;
},
parseLeftHandSideExpression_: function() {
var start = this.getTreeStartLocation_();
var operand = this.parseNewExpression_();
if (!(operand instanceof NewExpression) || operand.args != null) {
loop: while (true) {
switch (this.peekType_()) {
case OPEN_PAREN:
operand = this.toPrimaryExpression_(operand);
operand = this.parseCallExpression_(start, operand);
break;
case OPEN_SQUARE:
operand = this.toPrimaryExpression_(operand);
operand = this.parseMemberLookupExpression_(start, operand);
break;
case PERIOD:
operand = this.toPrimaryExpression_(operand);
operand = this.parseMemberExpression_(start, operand);
break;
case NO_SUBSTITUTION_TEMPLATE:
case TEMPLATE_HEAD:
if (!this.options_.templateLiterals)
break loop;
operand = this.toPrimaryExpression_(operand);
operand = this.parseTemplateLiteral_(operand);
break;
default:
break loop;
}
}
}
return operand;
},
parseMemberExpressionNoNew_: function() {
var start = this.getTreeStartLocation_();
var operand;
if (this.peekType_() === FUNCTION) {
operand = this.parseFunctionExpression_();
} else {
operand = this.parsePrimaryExpression_();
}
loop: while (true) {
switch (this.peekType_()) {
case OPEN_SQUARE:
operand = this.toPrimaryExpression_(operand);
operand = this.parseMemberLookupExpression_(start, operand);
break;
case PERIOD:
operand = this.toPrimaryExpression_(operand);
operand = this.parseMemberExpression_(start, operand);
break;
case NO_SUBSTITUTION_TEMPLATE:
case TEMPLATE_HEAD:
if (!this.options_.templateLiterals)
break loop;
operand = this.toPrimaryExpression_(operand);
operand = this.parseTemplateLiteral_(operand);
break;
default:
break loop;
}
}
return operand;
},
parseMemberExpression_: function(start, operand) {
this.nextToken_();
var name = this.eatIdName_();
return new MemberExpression(this.getTreeLocation_(start), operand, name);
},
parseMemberLookupExpression_: function(start, operand) {
this.nextToken_();
var member = this.parseExpression();
this.eat_(CLOSE_SQUARE);
return new MemberLookupExpression(this.getTreeLocation_(start), operand, member);
},
parseCallExpression_: function(start, operand) {
var args = this.parseArguments_();
return new CallExpression(this.getTreeLocation_(start), operand, args);
},
parseNewExpression_: function() {
var operand;
switch (this.peekType_()) {
case NEW:
var start = this.getTreeStartLocation_();
this.eat_(NEW);
if (this.peek_(SUPER))
operand = this.parseSuperExpression_();
else
operand = this.toPrimaryExpression_(this.parseNewExpression_());
var args = null;
if (this.peek_(OPEN_PAREN)) {
args = this.parseArguments_();
}
return new NewExpression(this.getTreeLocation_(start), operand, args);
case SUPER:
operand = this.parseSuperExpression_();
var type = this.peekType_();
switch (type) {
case OPEN_SQUARE:
return this.parseMemberLookupExpression_(start, operand);
case PERIOD:
return this.parseMemberExpression_(start, operand);
case OPEN_PAREN:
return this.parseCallExpression_(start, operand);
default:
return this.parseUnexpectedToken_(type);
}
break;
default:
return this.parseMemberExpressionNoNew_();
}
},
parseArguments_: function() {
var start = this.getTreeStartLocation_();
var args = [];
this.eat_(OPEN_PAREN);
if (!this.peek_(CLOSE_PAREN)) {
args.push(this.parseArgument_());
while (this.eatIf_(COMMA)) {
args.push(this.parseArgument_());
}
}
this.eat_(CLOSE_PAREN);
return new ArgumentList(this.getTreeLocation_(start), args);
},
parseArgument_: function() {
if (this.peekSpread_(this.peekType_()))
return this.parseSpreadExpression_();
return this.parseAssignmentExpression();
},
parseArrowFunction_: function(start, tree, asyncToken) {
var formals;
switch (tree.type) {
case IDENTIFIER_EXPRESSION:
tree = new BindingIdentifier(tree.location, tree.identifierToken);
case BINDING_IDENTIFIER:
formals = new FormalParameterList(this.getTreeLocation_(start), [new FormalParameter(tree.location, new BindingElement(tree.location, tree, null), null, [])]);
break;
case FORMAL_PARAMETER_LIST:
formals = tree;
break;
default:
formals = this.toFormalParameters_(start, tree, asyncToken);
}
this.eat_(ARROW);
var body = this.parseConciseBody_(asyncToken);
return new ArrowFunctionExpression(this.getTreeLocation_(start), asyncToken, formals, body);
},
parseCoverFormals_: function(start) {
var expressions = [];
if (!this.peek_(CLOSE_PAREN)) {
do {
var type = this.peekType_();
if (this.peekRest_(type)) {
expressions.push(this.parseRestParameter_());
break;
} else {
expressions.push(this.parseAssignmentExpression());
}
if (this.eatIf_(COMMA))
continue;
} while (!this.peek_(CLOSE_PAREN) && !this.isAtEnd());
}
this.eat_(CLOSE_PAREN);
return new CoverFormals(this.getTreeLocation_(start), expressions);
},
ensureNoCoverInitializedNames_: function(tree, coverInitializedNameCount) {
if (coverInitializedNameCount === this.coverInitializedNameCount_)
return;
var finder = new ValidateObjectLiteral(tree);
if (finder.found) {
var token = finder.errorToken;
this.reportError_(token.location, ("Unexpected token " + token));
}
},
toPrimaryExpression_: function(tree) {
if (tree.type === COVER_FORMALS)
return this.coverFormalsToParenExpression_(tree);
return tree;
},
validateCoverFormalsAsParenExpression_: function(tree) {
for (var i = 0; i < tree.expressions.length; i++) {
if (tree.expressions[i].type === REST_PARAMETER) {
var token = new Token(DOT_DOT_DOT, tree.expressions[i].location);
this.reportError_(token.location, ("Unexpected token " + token));
return;
}
}
},
coverFormalsToParenExpression_: function(tree) {
if (tree.type === COVER_FORMALS) {
var expressions = tree.expressions;
if (expressions.length === 0) {
var message = 'Unexpected token )';
this.reportError_(tree.location, message);
} else {
this.validateCoverFormalsAsParenExpression_(tree);
var expression;
if (expressions.length > 1)
expression = new CommaExpression(expressions[0].location, expressions);
else
expression = expressions[0];
return new ParenExpression(tree.location, expression);
}
}
return tree;
},
toFormalParameters_: function(start, tree, asyncToken) {
this.scanner_.index = start.offset;
return this.parseArrowFormalParameters_(asyncToken);
},
parseArrowFormalParameters_: function(asyncToken) {
if (asyncToken)
this.eat_(IDENTIFIER);
this.eat_(OPEN_PAREN);
var parameters = this.parseFormalParameters_();
this.eat_(CLOSE_PAREN);
return parameters;
},
peekArrow_: function(type) {
return type === ARROW && this.options_.arrowFunctions;
},
parseConciseBody_: function(asyncToken) {
if (this.peek_(OPEN_CURLY))
return this.parseFunctionBody_(asyncToken);
var allowAwait = this.allowAwait;
this.allowAwait = asyncToken !== null;
var expression = this.parseAssignmentExpression();
this.allowAwait = allowAwait;
return expression;
},
parseGeneratorComprehension_: function(start) {
var comprehensionList = this.parseComprehensionList_();
var expression = this.parseAssignmentExpression();
this.eat_(CLOSE_PAREN);
return new GeneratorComprehension(this.getTreeLocation_(start), comprehensionList, expression);
},
parseForBinding_: function() {
if (this.peekPattern_(this.peekType_()))
return this.parseBindingPattern_();
return this.parseBindingIdentifier_();
},
peekPattern_: function(type) {
return this.options_.destructuring && (this.peekObjectPattern_(type) || this.peekArrayPattern_(type));
},
peekArrayPattern_: function(type) {
return type === OPEN_SQUARE;
},
peekObjectPattern_: function(type) {
return type === OPEN_CURLY;
},
parseBindingPattern_: function() {
return this.parsePattern_(true);
},
parsePattern_: function(useBinding) {
if (this.peekArrayPattern_(this.peekType_()))
return this.parseArrayPattern_(useBinding);
return this.parseObjectPattern_(useBinding);
},
parseArrayBindingPattern_: function() {
return this.parseArrayPattern_(true);
},
parsePatternElement_: function(useBinding) {
return useBinding ? this.parseBindingElement_() : this.parseAssignmentElement_();
},
parsePatternRestElement_: function(useBinding) {
return useBinding ? this.parseBindingRestElement_() : this.parseAssignmentRestElement_();
},
parseArrayPattern_: function(useBinding) {
var start = this.getTreeStartLocation_();
var elements = [];
this.eat_(OPEN_SQUARE);
var type;
while ((type = this.peekType_()) !== CLOSE_SQUARE && type !== END_OF_FILE) {
this.parseElisionOpt_(elements);
if (this.peekRest_(this.peekType_())) {
elements.push(this.parsePatternRestElement_(useBinding));
break;
} else {
elements.push(this.parsePatternElement_(useBinding));
if (this.peek_(COMMA) && !this.peek_(CLOSE_SQUARE, 1)) {
this.nextToken_();
}
}
}
this.eat_(CLOSE_SQUARE);
return new ArrayPattern(this.getTreeLocation_(start), elements);
},
parseBindingElementList_: function(elements) {
this.parseElisionOpt_(elements);
elements.push(this.parseBindingElement_());
while (this.eatIf_(COMMA)) {
this.parseElisionOpt_(elements);
elements.push(this.parseBindingElement_());
}
},
parseElisionOpt_: function(elements) {
while (this.eatIf_(COMMA)) {
elements.push(null);
}
},
peekBindingElement_: function(type) {
return this.peekBindingIdentifier_(type) || this.peekPattern_(type);
},
parseBindingElement_: function() {
var initializer = arguments[0] !== (void 0) ? arguments[0] : Initializer.OPTIONAL;
var start = this.getTreeStartLocation_();
var binding = this.parseBindingElementBinding_();
var initializer = this.parseBindingElementInitializer_(initializer);
return new BindingElement(this.getTreeLocation_(start), binding, initializer);
},
parseBindingElementBinding_: function() {
if (this.peekPattern_(this.peekType_()))
return this.parseBindingPattern_();
return this.parseBindingIdentifier_();
},
parseBindingElementInitializer_: function() {
var initializer = arguments[0] !== (void 0) ? arguments[0] : Initializer.OPTIONAL;
if (this.peek_(EQUAL) || initializer === Initializer.REQUIRED) {
return this.parseInitializer_();
}
return null;
},
parseBindingRestElement_: function() {
var start = this.getTreeStartLocation_();
this.eat_(DOT_DOT_DOT);
var identifier = this.parseBindingIdentifier_();
return new SpreadPatternElement(this.getTreeLocation_(start), identifier);
},
parseObjectPattern_: function(useBinding) {
var start = this.getTreeStartLocation_();
var elements = [];
this.eat_(OPEN_CURLY);
var type;
while ((type = this.peekType_()) !== CLOSE_CURLY && type !== END_OF_FILE) {
elements.push(this.parsePatternProperty_(useBinding));
if (!this.eatIf_(COMMA))
break;
}
this.eat_(CLOSE_CURLY);
return new ObjectPattern(this.getTreeLocation_(start), elements);
},
parsePatternProperty_: function(useBinding) {
var start = this.getTreeStartLocation_();
var name = this.parsePropertyName_();
var requireColon = name.type !== LITERAL_PROPERTY_NAME || !name.literalToken.isStrictKeyword() && name.literalToken.type !== IDENTIFIER;
if (requireColon || this.peek_(COLON)) {
this.eat_(COLON);
var element = this.parsePatternElement_(useBinding);
return new ObjectPatternField(this.getTreeLocation_(start), name, element);
}
var token = name.literalToken;
if (this.strictMode_ && token.isStrictKeyword())
this.reportReservedIdentifier_(token);
if (useBinding) {
var binding = new BindingIdentifier(name.location, token);
var initializer = this.parseInitializerOpt_(Expression.NORMAL);
return new BindingElement(this.getTreeLocation_(start), binding, initializer);
}
var assignment = new IdentifierExpression(name.location, token);
var initializer = this.parseInitializerOpt_(Expression.NORMAL);
return new AssignmentElement(this.getTreeLocation_(start), assignment, initializer);
},
parseAssignmentPattern_: function() {
return this.parsePattern_(false);
},
parseArrayAssignmentPattern_: function() {
return this.parseArrayPattern_(false);
},
parseAssignmentElement_: function() {
var start = this.getTreeStartLocation_();
var assignment = this.parseDestructuringAssignmentTarget_();
var initializer = this.parseInitializerOpt_(Expression.NORMAL);
return new AssignmentElement(this.getTreeLocation_(start), assignment, initializer);
},
parseDestructuringAssignmentTarget_: function() {
switch (this.peekType_()) {
case OPEN_SQUARE:
return this.parseArrayAssignmentPattern_();
case OPEN_CURLY:
return this.parseObjectAssignmentPattern_();
}
var expression = this.parseLeftHandSideExpression_();
return this.coverFormalsToParenExpression_(expression);
},
parseAssignmentRestElement_: function() {
var start = this.getTreeStartLocation_();
this.eat_(DOT_DOT_DOT);
var id = this.parseDestructuringAssignmentTarget_();
return new SpreadPatternElement(this.getTreeLocation_(start), id);
},
parseObjectAssignmentPattern_: function() {
return this.parseObjectPattern_(false);
},
parseAssignmentProperty_: function() {
return this.parsePatternProperty_(false);
},
parseTemplateLiteral_: function(operand) {
if (!this.options_.templateLiterals)
return this.parseUnexpectedToken_('`');
var start = operand ? operand.location.start : this.getTreeStartLocation_();
var token = this.nextToken_();
var elements = [new TemplateLiteralPortion(token.location, token)];
if (token.type === NO_SUBSTITUTION_TEMPLATE) {
return new TemplateLiteralExpression(this.getTreeLocation_(start), operand, elements);
}
var expression = this.parseExpression();
elements.push(new TemplateSubstitution(expression.location, expression));
while (expression.type !== SYNTAX_ERROR_TREE) {
token = this.nextTemplateLiteralToken_();
if (token.type === ERROR || token.type === END_OF_FILE)
break;
elements.push(new TemplateLiteralPortion(token.location, token));
if (token.type === TEMPLATE_TAIL)
break;
expression = this.parseExpression();
elements.push(new TemplateSubstitution(expression.location, expression));
}
return new TemplateLiteralExpression(this.getTreeLocation_(start), operand, elements);
},
parseTypeAnnotationOpt_: function() {
if (this.options_.types && this.eatOpt_(COLON)) {
return this.parseType_();
}
return null;
},
parseType_: function() {
var start = this.getTreeStartLocation_();
var elementType;
switch (this.peekType_()) {
case VOID:
var token = this.nextToken_();
return new PredefinedType(this.getTreeLocation_(start), token);
case IDENTIFIER:
switch (this.peekToken_().value) {
case 'any':
case 'boolean':
case 'number':
case 'string':
case 'symbol':
var token = this.nextToken_();
return new PredefinedType(this.getTreeLocation_(start), token);
}
return this.parseTypeReference_(start);
case NEW:
elementType = this.parseConstructorType_();
break;
case OPEN_CURLY:
elementType = this.parseObjectType_();
break;
case OPEN_PAREN:
elementType = this.parseFunctionType_();
break;
case TYPEOF:
return this.parseTypeQuery_(start);
default:
return this.parseUnexpectedToken_(this.peekToken_());
}
return this.parseArrayTypeSuffix_(start, elementType);
},
peekTypeAnnotation_: function() {
switch (this.peekType_()) {
case IDENTIFIER:
case NEW:
case OPEN_CURLY:
case OPEN_PAREN:
case TYPEOF:
case VOID:
return true;
}
return false;
},
parseTypeReference_: function() {
var start = this.getTreeStartLocation_();
var typeName = this.parseTypeName_();
var args = null;
if (this.peek_(OPEN_ANGLE)) {
var args = this.parseTypeArguments_();
return new TypeReference(this.getTreeLocation_(start), typeName, args);
}
return typeName;
},
parseArrayTypeSuffix_: function(start, elementType) {
return elementType;
},
parseTypeArguments_: function() {
var start = this.getTreeStartLocation_();
this.eat_(OPEN_ANGLE);
var args = [this.parseType_()];
while (this.peek_(COMMA)) {
this.eat_(COMMA);
args.push(this.parseType_());
}
var token = this.nextCloseAngle_();
if (token.type !== CLOSE_ANGLE) {
return this.parseUnexpectedToken_(token.type);
}
return new TypeArguments(this.getTreeLocation_(start), args);
},
parseConstructorType_: function() {
throw 'NYI';
},
parseObjectType_: function() {
throw 'NYI';
},
parseFunctionType_: function() {
throw 'NYI';
},
parseTypeQuery_: function(start) {
throw 'NYI';
},
parseNamedOrPredefinedType_: function() {
var start = this.getTreeStartLocation_();
switch (this.peekToken_().value) {
case 'any':
case 'number':
case 'boolean':
case 'string':
var token = this.nextToken_();
return new PredefinedType(this.getTreeLocation_(start), token);
default:
return this.parseTypeName_();
}
},
parseTypeName_: function() {
var start = this.getTreeStartLocation_();
var id = this.eatId_();
var typeName = new TypeName(this.getTreeLocation_(start), null, id);
while (this.eatIf_(PERIOD)) {
var memberName = this.eatIdName_();
typeName = new TypeName(this.getTreeLocation_(start), typeName, memberName);
}
return typeName;
},
parseAnnotatedDeclarations_: function(parsingModuleItem) {
this.pushAnnotations_();
var declaration;
var type = this.peekType_();
if (parsingModuleItem) {
declaration = this.parseModuleItem_(type);
} else {
declaration = this.parseStatementListItem_(type);
}
if (this.annotations_.length > 0) {
return this.parseSyntaxError_('Unsupported annotated expression');
}
return declaration;
},
parseAnnotations_: function() {
var annotations = [];
while (this.eatIf_(AT)) {
annotations.push(this.parseAnnotation_());
}
return annotations;
},
pushAnnotations_: function() {
this.annotations_ = this.parseAnnotations_();
},
popAnnotations_: function() {
var annotations = this.annotations_;
this.annotations_ = [];
return annotations;
},
parseAnnotation_: function() {
var start = this.getTreeStartLocation_();
var expression = this.parseMemberExpressionNoNew_();
var args = null;
if (this.peek_(OPEN_PAREN))
args = this.parseArguments_();
return new Annotation(this.getTreeLocation_(start), expression, args);
},
eatPossibleImplicitSemiColon_: function() {
var token = this.peekTokenNoLineTerminator_();
if (!token)
return;
switch (token.type) {
case SEMI_COLON:
this.nextToken_();
return;
case END_OF_FILE:
case CLOSE_CURLY:
return;
}
this.reportError_('Semi-colon expected');
},
peekImplicitSemiColon_: function() {
switch (this.peekType_()) {
case SEMI_COLON:
case CLOSE_CURLY:
case END_OF_FILE:
return true;
}
var token = this.peekTokenNoLineTerminator_();
return token === null;
},
eatOpt_: function(expectedTokenType) {
if (this.peek_(expectedTokenType))
return this.nextToken_();
return null;
},
eatIdOpt_: function() {
return this.peek_(IDENTIFIER) ? this.eatId_() : null;
},
eatId_: function() {
var expected = arguments[0];
var token = this.nextToken_();
if (!token) {
if (expected)
this.reportError_(this.peekToken_(), ("expected '" + expected + "'"));
return null;
}
if (token.type === IDENTIFIER) {
if (expected && token.value !== expected)
this.reportExpectedError_(token, expected);
return token;
}
if (token.isStrictKeyword()) {
if (this.strictMode_) {
this.reportReservedIdentifier_(token);
} else {
return new IdentifierToken(token.location, token.type);
}
} else {
this.reportExpectedError_(token, expected || 'identifier');
}
return token;
},
eatIdName_: function() {
var t = this.nextToken_();
if (t.type != IDENTIFIER) {
if (!t.isKeyword()) {
this.reportExpectedError_(t, 'identifier');
return null;
}
return new IdentifierToken(t.location, t.type);
}
return t;
},
eat_: function(expectedTokenType) {
var token = this.nextToken_();
if (token.type != expectedTokenType) {
this.reportExpectedError_(token, expectedTokenType);
return null;
}
return token;
},
eatIf_: function(expectedTokenType) {
if (this.peek_(expectedTokenType)) {
this.nextToken_();
return true;
}
return false;
},
reportExpectedError_: function(token, expected) {
this.reportError_(token, ("Unexpected token " + token));
},
getTreeStartLocation_: function() {
return this.peekToken_().location.start;
},
getTreeEndLocation_: function() {
return this.scanner_.lastToken.location.end;
},
getTreeLocation_: function(start) {
return new SourceRange(start, this.getTreeEndLocation_());
},
handleComment: function(range) {},
nextToken_: function() {
return this.scanner_.nextToken();
},
nextRegularExpressionLiteralToken_: function() {
return this.scanner_.nextRegularExpressionLiteralToken();
},
nextTemplateLiteralToken_: function() {
return this.scanner_.nextTemplateLiteralToken();
},
nextCloseAngle_: function() {
return this.scanner_.nextCloseAngle();
},
isAtEnd: function() {
return this.scanner_.isAtEnd();
},
peek_: function(expectedType, opt_index) {
return this.peekToken_(opt_index).type === expectedType;
},
peekType_: function() {
return this.peekToken_().type;
},
peekToken_: function(opt_index) {
return this.scanner_.peekToken(opt_index);
},
peekTokenNoLineTerminator_: function() {
return this.scanner_.peekTokenNoLineTerminator();
},
reportError_: function() {
for (var args = [],
$__14 = 0; $__14 < arguments.length; $__14++)
args[$__14] = arguments[$__14];
if (args.length == 1) {
this.errorReporter_.reportError(this.scanner_.getPosition(), args[0]);
} else {
var location = args[0];
if (location instanceof Token) {
location = location.location;
}
this.errorReporter_.reportError(location.start, args[1]);
}
},
reportReservedIdentifier_: function(token) {
this.reportError_(token, (token.type + " is a reserved identifier"));
}
}, {});
return {get Parser() {
return Parser;
}};
});
System.register("traceur@0.0.74/src/util/SourcePosition", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/util/SourcePosition";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/util/SourcePosition", path);
}
var SourcePosition = function SourcePosition(source, offset) {
this.source = source;
this.offset = offset;
this.line_ = -1;
this.column_ = -1;
};
($traceurRuntime.createClass)(SourcePosition, {
get line() {
if (this.line_ === -1)
this.line_ = this.source.lineNumberTable.getLine(this.offset);
return this.line_;
},
get column() {
if (this.column_ === -1)
this.column_ = this.source.lineNumberTable.getColumn(this.offset);
return this.column_;
},
toString: function() {
var name = this.source ? this.source.name : '';
return (name + ":" + (this.line + 1) + ":" + (this.column + 1));
}
}, {});
return {get SourcePosition() {
return SourcePosition;
}};
});
System.register("traceur@0.0.74/src/syntax/LineNumberTable", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/syntax/LineNumberTable";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/syntax/LineNumberTable", path);
}
var SourcePosition = System.get("traceur@0.0.74/src/util/SourcePosition").SourcePosition;
var SourceRange = System.get("traceur@0.0.74/src/util/SourceRange").SourceRange;
var isLineTerminator = System.get("traceur@0.0.74/src/syntax/Scanner").isLineTerminator;
var MAX_INT_REPRESENTATION = 9007199254740992;
function computeLineStartOffsets(source) {
var lineStartOffsets = [0];
var k = 1;
for (var index = 0; index < source.length; index++) {
var code = source.charCodeAt(index);
if (isLineTerminator(code)) {
if (code === 13 && source.charCodeAt(index + 1) === 10) {
index++;
}
lineStartOffsets[k++] = index + 1;
}
}
lineStartOffsets[k++] = MAX_INT_REPRESENTATION;
return lineStartOffsets;
}
var LineNumberTable = function LineNumberTable(sourceFile) {
this.sourceFile_ = sourceFile;
this.lineStartOffsets_ = null;
this.lastLine_ = 0;
this.lastOffset_ = -1;
};
($traceurRuntime.createClass)(LineNumberTable, {
ensureLineStartOffsets_: function() {
if (!this.lineStartOffsets_) {
this.lineStartOffsets_ = computeLineStartOffsets(this.sourceFile_.contents);
}
},
getSourcePosition: function(offset) {
return new SourcePosition(this.sourceFile_, offset);
},
getLine: function(offset) {
if (offset === this.lastOffset_)
return this.lastLine_;
this.ensureLineStartOffsets_();
if (offset < 0)
return 0;
var line;
if (offset < this.lastOffset_) {
for (var i = this.lastLine_; i >= 0; i--) {
if (this.lineStartOffsets_[i] <= offset) {
line = i;
break;
}
}
} else {
for (var i = this.lastLine_; true; i++) {
if (this.lineStartOffsets_[i] > offset) {
line = i - 1;
break;
}
}
}
this.lastLine_ = line;
this.lastOffset_ = offset;
return line;
},
offsetOfLine: function(line) {
this.ensureLineStartOffsets_();
return this.lineStartOffsets_[line];
},
getColumn: function(offset) {
var line = this.getLine(offset);
return offset - this.lineStartOffsets_[line];
},
getSourceRange: function(startOffset, endOffset) {
return new SourceRange(this.getSourcePosition(startOffset), this.getSourcePosition(endOffset));
}
}, {});
return {get LineNumberTable() {
return LineNumberTable;
}};
});
System.register("traceur@0.0.74/src/syntax/SourceFile", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/syntax/SourceFile";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/syntax/SourceFile", path);
}
var LineNumberTable = System.get("traceur@0.0.74/src/syntax/LineNumberTable").LineNumberTable;
var SourceFile = function SourceFile(name, contents) {
this.name = name;
this.contents = contents;
this.lineNumberTable = new LineNumberTable(this);
};
($traceurRuntime.createClass)(SourceFile, {}, {});
return {get SourceFile() {
return SourceFile;
}};
});
System.register("traceur@0.0.74/src/util/CollectingErrorReporter", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/util/CollectingErrorReporter";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/util/CollectingErrorReporter", path);
}
var ErrorReporter = System.get("traceur@0.0.74/src/util/ErrorReporter").ErrorReporter;
var MultipleErrors = function MultipleErrors(errors) {
this.message = errors ? errors.join('\n') + '' : '';
this.name = errors && (errors.length > 1) ? 'MultipleErrors' : '';
this.errors = errors;
};
($traceurRuntime.createClass)(MultipleErrors, {}, {}, Error);
var CollectingErrorReporter = function CollectingErrorReporter() {
$traceurRuntime.superConstructor($CollectingErrorReporter).call(this);
this.errors = [];
};
var $CollectingErrorReporter = CollectingErrorReporter;
($traceurRuntime.createClass)(CollectingErrorReporter, {
reportMessageInternal: function(location, message) {
if (location)
message = (location + ": " + message);
this.errors.push(message);
},
errorsAsString: function() {
return this.toError().message;
},
toError: function() {
return new MultipleErrors(this.errors);
}
}, {}, ErrorReporter);
return {
get MultipleErrors() {
return MultipleErrors;
},
get CollectingErrorReporter() {
return CollectingErrorReporter;
}
};
});
System.register("traceur@0.0.74/src/codegeneration/ParseTreeTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/ParseTreeTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/ParseTreeTransformer", path);
}
var $__0 = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees"),
Annotation = $__0.Annotation,
AnonBlock = $__0.AnonBlock,
ArgumentList = $__0.ArgumentList,
ArrayComprehension = $__0.ArrayComprehension,
ArrayLiteralExpression = $__0.ArrayLiteralExpression,
ArrayPattern = $__0.ArrayPattern,
ArrowFunctionExpression = $__0.ArrowFunctionExpression,
AssignmentElement = $__0.AssignmentElement,
AwaitExpression = $__0.AwaitExpression,
BinaryExpression = $__0.BinaryExpression,
BindingElement = $__0.BindingElement,
BindingIdentifier = $__0.BindingIdentifier,
Block = $__0.Block,
BreakStatement = $__0.BreakStatement,
CallExpression = $__0.CallExpression,
CaseClause = $__0.CaseClause,
Catch = $__0.Catch,
ClassDeclaration = $__0.ClassDeclaration,
ClassExpression = $__0.ClassExpression,
CommaExpression = $__0.CommaExpression,
ComprehensionFor = $__0.ComprehensionFor,
ComprehensionIf = $__0.ComprehensionIf,
ComputedPropertyName = $__0.ComputedPropertyName,
ConditionalExpression = $__0.ConditionalExpression,
ContinueStatement = $__0.ContinueStatement,
CoverFormals = $__0.CoverFormals,
CoverInitializedName = $__0.CoverInitializedName,
DebuggerStatement = $__0.DebuggerStatement,
DefaultClause = $__0.DefaultClause,
DoWhileStatement = $__0.DoWhileStatement,
EmptyStatement = $__0.EmptyStatement,
ExportDeclaration = $__0.ExportDeclaration,
ExportDefault = $__0.ExportDefault,
ExportSpecifier = $__0.ExportSpecifier,
ExportSpecifierSet = $__0.ExportSpecifierSet,
ExportStar = $__0.ExportStar,
ExpressionStatement = $__0.ExpressionStatement,
Finally = $__0.Finally,
ForInStatement = $__0.ForInStatement,
ForOfStatement = $__0.ForOfStatement,
ForStatement = $__0.ForStatement,
FormalParameter = $__0.FormalParameter,
FormalParameterList = $__0.FormalParameterList,
FunctionBody = $__0.FunctionBody,
FunctionDeclaration = $__0.FunctionDeclaration,
FunctionExpression = $__0.FunctionExpression,
GeneratorComprehension = $__0.GeneratorComprehension,
GetAccessor = $__0.GetAccessor,
IdentifierExpression = $__0.IdentifierExpression,
IfStatement = $__0.IfStatement,
ImportedBinding = $__0.ImportedBinding,
ImportDeclaration = $__0.ImportDeclaration,
ImportSpecifier = $__0.ImportSpecifier,
ImportSpecifierSet = $__0.ImportSpecifierSet,
LabelledStatement = $__0.LabelledStatement,
LiteralExpression = $__0.LiteralExpression,
LiteralPropertyName = $__0.LiteralPropertyName,
MemberExpression = $__0.MemberExpression,
MemberLookupExpression = $__0.MemberLookupExpression,
Module = $__0.Module,
ModuleDeclaration = $__0.ModuleDeclaration,
ModuleSpecifier = $__0.ModuleSpecifier,
NamedExport = $__0.NamedExport,
NewExpression = $__0.NewExpression,
ObjectLiteralExpression = $__0.ObjectLiteralExpression,
ObjectPattern = $__0.ObjectPattern,
ObjectPatternField = $__0.ObjectPatternField,
ParenExpression = $__0.ParenExpression,
PostfixExpression = $__0.PostfixExpression,
PredefinedType = $__0.PredefinedType,
Script = $__0.Script,
PropertyMethodAssignment = $__0.PropertyMethodAssignment,
PropertyNameAssignment = $__0.PropertyNameAssignment,
PropertyNameShorthand = $__0.PropertyNameShorthand,
PropertyVariableDeclaration = $__0.PropertyVariableDeclaration,
RestParameter = $__0.RestParameter,
ReturnStatement = $__0.ReturnStatement,
SetAccessor = $__0.SetAccessor,
SpreadExpression = $__0.SpreadExpression,
SpreadPatternElement = $__0.SpreadPatternElement,
SuperExpression = $__0.SuperExpression,
SwitchStatement = $__0.SwitchStatement,
SyntaxErrorTree = $__0.SyntaxErrorTree,
TemplateLiteralExpression = $__0.TemplateLiteralExpression,
TemplateLiteralPortion = $__0.TemplateLiteralPortion,
TemplateSubstitution = $__0.TemplateSubstitution,
ThisExpression = $__0.ThisExpression,
ThrowStatement = $__0.ThrowStatement,
TryStatement = $__0.TryStatement,
TypeArguments = $__0.TypeArguments,
TypeName = $__0.TypeName,
TypeReference = $__0.TypeReference,
UnaryExpression = $__0.UnaryExpression,
VariableDeclaration = $__0.VariableDeclaration,
VariableDeclarationList = $__0.VariableDeclarationList,
VariableStatement = $__0.VariableStatement,
WhileStatement = $__0.WhileStatement,
WithStatement = $__0.WithStatement,
YieldExpression = $__0.YieldExpression;
var ParseTreeTransformer = function ParseTreeTransformer() {};
($traceurRuntime.createClass)(ParseTreeTransformer, {
transformAny: function(tree) {
return tree && tree.transform(this);
},
transformList: function(list) {
var $__2;
var builder = null;
for (var index = 0; index < list.length; index++) {
var element = list[index];
var transformed = this.transformAny(element);
if (builder != null || element != transformed) {
if (builder == null) {
builder = list.slice(0, index);
}
if (transformed instanceof AnonBlock)
($__2 = builder).push.apply($__2, $traceurRuntime.spread(transformed.statements));
else
builder.push(transformed);
}
}
return builder || list;
},
transformStateMachine: function(tree) {
throw Error('State machines should not live outside of the GeneratorTransformer.');
},
transformToBlockOrStatement: function(tree) {
var transformed = this.transformAny(tree);
if (transformed instanceof AnonBlock) {
return new Block(transformed.location, transformed.statements);
}
return transformed;
},
transformAnnotation: function(tree) {
var name = this.transformAny(tree.name);
var args = this.transformAny(tree.args);
if (name === tree.name && args === tree.args) {
return tree;
}
return new Annotation(tree.location, name, args);
},
transformAnonBlock: function(tree) {
var statements = this.transformList(tree.statements);
if (statements === tree.statements) {
return tree;
}
return new AnonBlock(tree.location, statements);
},
transformArgumentList: function(tree) {
var args = this.transformList(tree.args);
if (args === tree.args) {
return tree;
}
return new ArgumentList(tree.location, args);
},
transformArrayComprehension: function(tree) {
var comprehensionList = this.transformList(tree.comprehensionList);
var expression = this.transformAny(tree.expression);
if (comprehensionList === tree.comprehensionList && expression === tree.expression) {
return tree;
}
return new ArrayComprehension(tree.location, comprehensionList, expression);
},
transformArrayLiteralExpression: function(tree) {
var elements = this.transformList(tree.elements);
if (elements === tree.elements) {
return tree;
}
return new ArrayLiteralExpression(tree.location, elements);
},
transformArrayPattern: function(tree) {
var elements = this.transformList(tree.elements);
if (elements === tree.elements) {
return tree;
}
return new ArrayPattern(tree.location, elements);
},
transformArrowFunctionExpression: function(tree) {
var parameterList = this.transformAny(tree.parameterList);
var body = this.transformAny(tree.body);
if (parameterList === tree.parameterList && body === tree.body) {
return tree;
}
return new ArrowFunctionExpression(tree.location, tree.functionKind, parameterList, body);
},
transformAssignmentElement: function(tree) {
var assignment = this.transformAny(tree.assignment);
var initializer = this.transformAny(tree.initializer);
if (assignment === tree.assignment && initializer === tree.initializer) {
return tree;
}
return new AssignmentElement(tree.location, assignment, initializer);
},
transformAwaitExpression: function(tree) {
var expression = this.transformAny(tree.expression);
if (expression === tree.expression) {
return tree;
}
return new AwaitExpression(tree.location, expression);
},
transformBinaryExpression: function(tree) {
var left = this.transformAny(tree.left);
var right = this.transformAny(tree.right);
if (left === tree.left && right === tree.right) {
return tree;
}
return new BinaryExpression(tree.location, left, tree.operator, right);
},
transformBindingElement: function(tree) {
var binding = this.transformAny(tree.binding);
var initializer = this.transformAny(tree.initializer);
if (binding === tree.binding && initializer === tree.initializer) {
return tree;
}
return new BindingElement(tree.location, binding, initializer);
},
transformBindingIdentifier: function(tree) {
return tree;
},
transformBlock: function(tree) {
var statements = this.transformList(tree.statements);
if (statements === tree.statements) {
return tree;
}
return new Block(tree.location, statements);
},
transformBreakStatement: function(tree) {
return tree;
},
transformCallExpression: function(tree) {
var operand = this.transformAny(tree.operand);
var args = this.transformAny(tree.args);
if (operand === tree.operand && args === tree.args) {
return tree;
}
return new CallExpression(tree.location, operand, args);
},
transformCaseClause: function(tree) {
var expression = this.transformAny(tree.expression);
var statements = this.transformList(tree.statements);
if (expression === tree.expression && statements === tree.statements) {
return tree;
}
return new CaseClause(tree.location, expression, statements);
},
transformCatch: function(tree) {
var binding = this.transformAny(tree.binding);
var catchBody = this.transformAny(tree.catchBody);
if (binding === tree.binding && catchBody === tree.catchBody) {
return tree;
}
return new Catch(tree.location, binding, catchBody);
},
transformClassDeclaration: function(tree) {
var name = this.transformAny(tree.name);
var superClass = this.transformAny(tree.superClass);
var elements = this.transformList(tree.elements);
var annotations = this.transformList(tree.annotations);
if (name === tree.name && superClass === tree.superClass && elements === tree.elements && annotations === tree.annotations) {
return tree;
}
return new ClassDeclaration(tree.location, name, superClass, elements, annotations);
},
transformClassExpression: function(tree) {
var name = this.transformAny(tree.name);
var superClass = this.transformAny(tree.superClass);
var elements = this.transformList(tree.elements);
var annotations = this.transformList(tree.annotations);
if (name === tree.name && superClass === tree.superClass && elements === tree.elements && annotations === tree.annotations) {
return tree;
}
return new ClassExpression(tree.location, name, superClass, elements, annotations);
},
transformCommaExpression: function(tree) {
var expressions = this.transformList(tree.expressions);
if (expressions === tree.expressions) {
return tree;
}
return new CommaExpression(tree.location, expressions);
},
transformComprehensionFor: function(tree) {
var left = this.transformAny(tree.left);
var iterator = this.transformAny(tree.iterator);
if (left === tree.left && iterator === tree.iterator) {
return tree;
}
return new ComprehensionFor(tree.location, left, iterator);
},
transformComprehensionIf: function(tree) {
var expression = this.transformAny(tree.expression);
if (expression === tree.expression) {
return tree;
}
return new ComprehensionIf(tree.location, expression);
},
transformComputedPropertyName: function(tree) {
var expression = this.transformAny(tree.expression);
if (expression === tree.expression) {
return tree;
}
return new ComputedPropertyName(tree.location, expression);
},
transformConditionalExpression: function(tree) {
var condition = this.transformAny(tree.condition);
var left = this.transformAny(tree.left);
var right = this.transformAny(tree.right);
if (condition === tree.condition && left === tree.left && right === tree.right) {
return tree;
}
return new ConditionalExpression(tree.location, condition, left, right);
},
transformContinueStatement: function(tree) {
return tree;
},
transformCoverFormals: function(tree) {
var expressions = this.transformList(tree.expressions);
if (expressions === tree.expressions) {
return tree;
}
return new CoverFormals(tree.location, expressions);
},
transformCoverInitializedName: function(tree) {
var initializer = this.transformAny(tree.initializer);
if (initializer === tree.initializer) {
return tree;
}
return new CoverInitializedName(tree.location, tree.name, tree.equalToken, initializer);
},
transformDebuggerStatement: function(tree) {
return tree;
},
transformDefaultClause: function(tree) {
var statements = this.transformList(tree.statements);
if (statements === tree.statements) {
return tree;
}
return new DefaultClause(tree.location, statements);
},
transformDoWhileStatement: function(tree) {
var body = this.transformToBlockOrStatement(tree.body);
var condition = this.transformAny(tree.condition);
if (body === tree.body && condition === tree.condition) {
return tree;
}
return new DoWhileStatement(tree.location, body, condition);
},
transformEmptyStatement: function(tree) {
return tree;
},
transformExportDeclaration: function(tree) {
var declaration = this.transformAny(tree.declaration);
var annotations = this.transformList(tree.annotations);
if (declaration === tree.declaration && annotations === tree.annotations) {
return tree;
}
return new ExportDeclaration(tree.location, declaration, annotations);
},
transformExportDefault: function(tree) {
var expression = this.transformAny(tree.expression);
if (expression === tree.expression) {
return tree;
}
return new ExportDefault(tree.location, expression);
},
transformExportSpecifier: function(tree) {
return tree;
},
transformExportSpecifierSet: function(tree) {
var specifiers = this.transformList(tree.specifiers);
if (specifiers === tree.specifiers) {
return tree;
}
return new ExportSpecifierSet(tree.location, specifiers);
},
transformExportStar: function(tree) {
return tree;
},
transformExpressionStatement: function(tree) {
var expression = this.transformAny(tree.expression);
if (expression === tree.expression) {
return tree;
}
return new ExpressionStatement(tree.location, expression);
},
transformFinally: function(tree) {
var block = this.transformAny(tree.block);
if (block === tree.block) {
return tree;
}
return new Finally(tree.location, block);
},
transformForInStatement: function(tree) {
var initializer = this.transformAny(tree.initializer);
var collection = this.transformAny(tree.collection);
var body = this.transformToBlockOrStatement(tree.body);
if (initializer === tree.initializer && collection === tree.collection && body === tree.body) {
return tree;
}
return new ForInStatement(tree.location, initializer, collection, body);
},
transformForOfStatement: function(tree) {
var initializer = this.transformAny(tree.initializer);
var collection = this.transformAny(tree.collection);
var body = this.transformToBlockOrStatement(tree.body);
if (initializer === tree.initializer && collection === tree.collection && body === tree.body) {
return tree;
}
return new ForOfStatement(tree.location, initializer, collection, body);
},
transformForStatement: function(tree) {
var initializer = this.transformAny(tree.initializer);
var condition = this.transformAny(tree.condition);
var increment = this.transformAny(tree.increment);
var body = this.transformToBlockOrStatement(tree.body);
if (initializer === tree.initializer && condition === tree.condition && increment === tree.increment && body === tree.body) {
return tree;
}
return new ForStatement(tree.location, initializer, condition, increment, body);
},
transformFormalParameter: function(tree) {
var parameter = this.transformAny(tree.parameter);
var typeAnnotation = this.transformAny(tree.typeAnnotation);
var annotations = this.transformList(tree.annotations);
if (parameter === tree.parameter && typeAnnotation === tree.typeAnnotation && annotations === tree.annotations) {
return tree;
}
return new FormalParameter(tree.location, parameter, typeAnnotation, annotations);
},
transformFormalParameterList: function(tree) {
var parameters = this.transformList(tree.parameters);
if (parameters === tree.parameters) {
return tree;
}
return new FormalParameterList(tree.location, parameters);
},
transformFunctionBody: function(tree) {
var statements = this.transformList(tree.statements);
if (statements === tree.statements) {
return tree;
}
return new FunctionBody(tree.location, statements);
},
transformFunctionDeclaration: function(tree) {
var name = this.transformAny(tree.name);
var parameterList = this.transformAny(tree.parameterList);
var typeAnnotation = this.transformAny(tree.typeAnnotation);
var annotations = this.transformList(tree.annotations);
var body = this.transformAny(tree.body);
if (name === tree.name && parameterList === tree.parameterList && typeAnnotation === tree.typeAnnotation && annotations === tree.annotations && body === tree.body) {
return tree;
}
return new FunctionDeclaration(tree.location, name, tree.functionKind, parameterList, typeAnnotation, annotations, body);
},
transformFunctionExpression: function(tree) {
var name = this.transformAny(tree.name);
var parameterList = this.transformAny(tree.parameterList);
var typeAnnotation = this.transformAny(tree.typeAnnotation);
var annotations = this.transformList(tree.annotations);
var body = this.transformAny(tree.body);
if (name === tree.name && parameterList === tree.parameterList && typeAnnotation === tree.typeAnnotation && annotations === tree.annotations && body === tree.body) {
return tree;
}
return new FunctionExpression(tree.location, name, tree.functionKind, parameterList, typeAnnotation, annotations, body);
},
transformGeneratorComprehension: function(tree) {
var comprehensionList = this.transformList(tree.comprehensionList);
var expression = this.transformAny(tree.expression);
if (comprehensionList === tree.comprehensionList && expression === tree.expression) {
return tree;
}
return new GeneratorComprehension(tree.location, comprehensionList, expression);
},
transformGetAccessor: function(tree) {
var name = this.transformAny(tree.name);
var typeAnnotation = this.transformAny(tree.typeAnnotation);
var annotations = this.transformList(tree.annotations);
var body = this.transformAny(tree.body);
if (name === tree.name && typeAnnotation === tree.typeAnnotation && annotations === tree.annotations && body === tree.body) {
return tree;
}
return new GetAccessor(tree.location, tree.isStatic, name, typeAnnotation, annotations, body);
},
transformIdentifierExpression: function(tree) {
return tree;
},
transformIfStatement: function(tree) {
var condition = this.transformAny(tree.condition);
var ifClause = this.transformToBlockOrStatement(tree.ifClause);
var elseClause = this.transformToBlockOrStatement(tree.elseClause);
if (condition === tree.condition && ifClause === tree.ifClause && elseClause === tree.elseClause) {
return tree;
}
return new IfStatement(tree.location, condition, ifClause, elseClause);
},
transformImportedBinding: function(tree) {
var binding = this.transformAny(tree.binding);
if (binding === tree.binding) {
return tree;
}
return new ImportedBinding(tree.location, binding);
},
transformImportDeclaration: function(tree) {
var importClause = this.transformAny(tree.importClause);
var moduleSpecifier = this.transformAny(tree.moduleSpecifier);
if (importClause === tree.importClause && moduleSpecifier === tree.moduleSpecifier) {
return tree;
}
return new ImportDeclaration(tree.location, importClause, moduleSpecifier);
},
transformImportSpecifier: function(tree) {
var binding = this.transformAny(tree.binding);
if (binding === tree.binding) {
return tree;
}
return new ImportSpecifier(tree.location, binding, tree.name);
},
transformImportSpecifierSet: function(tree) {
var specifiers = this.transformList(tree.specifiers);
if (specifiers === tree.specifiers) {
return tree;
}
return new ImportSpecifierSet(tree.location, specifiers);
},
transformLabelledStatement: function(tree) {
var statement = this.transformAny(tree.statement);
if (statement === tree.statement) {
return tree;
}
return new LabelledStatement(tree.location, tree.name, statement);
},
transformLiteralExpression: function(tree) {
return tree;
},
transformLiteralPropertyName: function(tree) {
return tree;
},
transformMemberExpression: function(tree) {
var operand = this.transformAny(tree.operand);
if (operand === tree.operand) {
return tree;
}
return new MemberExpression(tree.location, operand, tree.memberName);
},
transformMemberLookupExpression: function(tree) {
var operand = this.transformAny(tree.operand);
var memberExpression = this.transformAny(tree.memberExpression);
if (operand === tree.operand && memberExpression === tree.memberExpression) {
return tree;
}
return new MemberLookupExpression(tree.location, operand, memberExpression);
},
transformModule: function(tree) {
var scriptItemList = this.transformList(tree.scriptItemList);
if (scriptItemList === tree.scriptItemList) {
return tree;
}
return new Module(tree.location, scriptItemList, tree.moduleName);
},
transformModuleDeclaration: function(tree) {
var binding = this.transformAny(tree.binding);
var expression = this.transformAny(tree.expression);
if (binding === tree.binding && expression === tree.expression) {
return tree;
}
return new ModuleDeclaration(tree.location, binding, expression);
},
transformModuleSpecifier: function(tree) {
return tree;
},
transformNamedExport: function(tree) {
var moduleSpecifier = this.transformAny(tree.moduleSpecifier);
var specifierSet = this.transformAny(tree.specifierSet);
if (moduleSpecifier === tree.moduleSpecifier && specifierSet === tree.specifierSet) {
return tree;
}
return new NamedExport(tree.location, moduleSpecifier, specifierSet);
},
transformNewExpression: function(tree) {
var operand = this.transformAny(tree.operand);
var args = this.transformAny(tree.args);
if (operand === tree.operand && args === tree.args) {
return tree;
}
return new NewExpression(tree.location, operand, args);
},
transformObjectLiteralExpression: function(tree) {
var propertyNameAndValues = this.transformList(tree.propertyNameAndValues);
if (propertyNameAndValues === tree.propertyNameAndValues) {
return tree;
}
return new ObjectLiteralExpression(tree.location, propertyNameAndValues);
},
transformObjectPattern: function(tree) {
var fields = this.transformList(tree.fields);
if (fields === tree.fields) {
return tree;
}
return new ObjectPattern(tree.location, fields);
},
transformObjectPatternField: function(tree) {
var name = this.transformAny(tree.name);
var element = this.transformAny(tree.element);
if (name === tree.name && element === tree.element) {
return tree;
}
return new ObjectPatternField(tree.location, name, element);
},
transformParenExpression: function(tree) {
var expression = this.transformAny(tree.expression);
if (expression === tree.expression) {
return tree;
}
return new ParenExpression(tree.location, expression);
},
transformPostfixExpression: function(tree) {
var operand = this.transformAny(tree.operand);
if (operand === tree.operand) {
return tree;
}
return new PostfixExpression(tree.location, operand, tree.operator);
},
transformPredefinedType: function(tree) {
return tree;
},
transformScript: function(tree) {
var scriptItemList = this.transformList(tree.scriptItemList);
if (scriptItemList === tree.scriptItemList) {
return tree;
}
return new Script(tree.location, scriptItemList, tree.moduleName);
},
transformPropertyMethodAssignment: function(tree) {
var name = this.transformAny(tree.name);
var parameterList = this.transformAny(tree.parameterList);
var typeAnnotation = this.transformAny(tree.typeAnnotation);
var annotations = this.transformList(tree.annotations);
var body = this.transformAny(tree.body);
if (name === tree.name && parameterList === tree.parameterList && typeAnnotation === tree.typeAnnotation && annotations === tree.annotations && body === tree.body) {
return tree;
}
return new PropertyMethodAssignment(tree.location, tree.isStatic, tree.functionKind, name, parameterList, typeAnnotation, annotations, body);
},
transformPropertyNameAssignment: function(tree) {
var name = this.transformAny(tree.name);
var value = this.transformAny(tree.value);
if (name === tree.name && value === tree.value) {
return tree;
}
return new PropertyNameAssignment(tree.location, name, value);
},
transformPropertyNameShorthand: function(tree) {
return tree;
},
transformPropertyVariableDeclaration: function(tree) {
var name = this.transformAny(tree.name);
var typeAnnotation = this.transformAny(tree.typeAnnotation);
var annotations = this.transformList(tree.annotations);
if (name === tree.name && typeAnnotation === tree.typeAnnotation && annotations === tree.annotations) {
return tree;
}
return new PropertyVariableDeclaration(tree.location, tree.isStatic, name, typeAnnotation, annotations);
},
transformRestParameter: function(tree) {
var identifier = this.transformAny(tree.identifier);
if (identifier === tree.identifier) {
return tree;
}
return new RestParameter(tree.location, identifier);
},
transformReturnStatement: function(tree) {
var expression = this.transformAny(tree.expression);
if (expression === tree.expression) {
return tree;
}
return new ReturnStatement(tree.location, expression);
},
transformSetAccessor: function(tree) {
var name = this.transformAny(tree.name);
var parameterList = this.transformAny(tree.parameterList);
var annotations = this.transformList(tree.annotations);
var body = this.transformAny(tree.body);
if (name === tree.name && parameterList === tree.parameterList && annotations === tree.annotations && body === tree.body) {
return tree;
}
return new SetAccessor(tree.location, tree.isStatic, name, parameterList, annotations, body);
},
transformSpreadExpression: function(tree) {
var expression = this.transformAny(tree.expression);
if (expression === tree.expression) {
return tree;
}
return new SpreadExpression(tree.location, expression);
},
transformSpreadPatternElement: function(tree) {
var lvalue = this.transformAny(tree.lvalue);
if (lvalue === tree.lvalue) {
return tree;
}
return new SpreadPatternElement(tree.location, lvalue);
},
transformSuperExpression: function(tree) {
return tree;
},
transformSwitchStatement: function(tree) {
var expression = this.transformAny(tree.expression);
var caseClauses = this.transformList(tree.caseClauses);
if (expression === tree.expression && caseClauses === tree.caseClauses) {
return tree;
}
return new SwitchStatement(tree.location, expression, caseClauses);
},
transformSyntaxErrorTree: function(tree) {
return tree;
},
transformTemplateLiteralExpression: function(tree) {
var operand = this.transformAny(tree.operand);
var elements = this.transformList(tree.elements);
if (operand === tree.operand && elements === tree.elements) {
return tree;
}
return new TemplateLiteralExpression(tree.location, operand, elements);
},
transformTemplateLiteralPortion: function(tree) {
return tree;
},
transformTemplateSubstitution: function(tree) {
var expression = this.transformAny(tree.expression);
if (expression === tree.expression) {
return tree;
}
return new TemplateSubstitution(tree.location, expression);
},
transformThisExpression: function(tree) {
return tree;
},
transformThrowStatement: function(tree) {
var value = this.transformAny(tree.value);
if (value === tree.value) {
return tree;
}
return new ThrowStatement(tree.location, value);
},
transformTryStatement: function(tree) {
var body = this.transformAny(tree.body);
var catchBlock = this.transformAny(tree.catchBlock);
var finallyBlock = this.transformAny(tree.finallyBlock);
if (body === tree.body && catchBlock === tree.catchBlock && finallyBlock === tree.finallyBlock) {
return tree;
}
return new TryStatement(tree.location, body, catchBlock, finallyBlock);
},
transformTypeArguments: function(tree) {
var args = this.transformList(tree.args);
if (args === tree.args) {
return tree;
}
return new TypeArguments(tree.location, args);
},
transformTypeName: function(tree) {
var moduleName = this.transformAny(tree.moduleName);
if (moduleName === tree.moduleName) {
return tree;
}
return new TypeName(tree.location, moduleName, tree.name);
},
transformTypeReference: function(tree) {
var typeName = this.transformAny(tree.typeName);
var args = this.transformAny(tree.args);
if (typeName === tree.typeName && args === tree.args) {
return tree;
}
return new TypeReference(tree.location, typeName, args);
},
transformUnaryExpression: function(tree) {
var operand = this.transformAny(tree.operand);
if (operand === tree.operand) {
return tree;
}
return new UnaryExpression(tree.location, tree.operator, operand);
},
transformVariableDeclaration: function(tree) {
var lvalue = this.transformAny(tree.lvalue);
var typeAnnotation = this.transformAny(tree.typeAnnotation);
var initializer = this.transformAny(tree.initializer);
if (lvalue === tree.lvalue && typeAnnotation === tree.typeAnnotation && initializer === tree.initializer) {
return tree;
}
return new VariableDeclaration(tree.location, lvalue, typeAnnotation, initializer);
},
transformVariableDeclarationList: function(tree) {
var declarations = this.transformList(tree.declarations);
if (declarations === tree.declarations) {
return tree;
}
return new VariableDeclarationList(tree.location, tree.declarationType, declarations);
},
transformVariableStatement: function(tree) {
var declarations = this.transformAny(tree.declarations);
if (declarations === tree.declarations) {
return tree;
}
return new VariableStatement(tree.location, declarations);
},
transformWhileStatement: function(tree) {
var condition = this.transformAny(tree.condition);
var body = this.transformToBlockOrStatement(tree.body);
if (condition === tree.condition && body === tree.body) {
return tree;
}
return new WhileStatement(tree.location, condition, body);
},
transformWithStatement: function(tree) {
var expression = this.transformAny(tree.expression);
var body = this.transformToBlockOrStatement(tree.body);
if (expression === tree.expression && body === tree.body) {
return tree;
}
return new WithStatement(tree.location, expression, body);
},
transformYieldExpression: function(tree) {
var expression = this.transformAny(tree.expression);
if (expression === tree.expression) {
return tree;
}
return new YieldExpression(tree.location, expression, tree.isYieldFor);
}
}, {});
return {get ParseTreeTransformer() {
return ParseTreeTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/PlaceholderParser", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/PlaceholderParser";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/PlaceholderParser", path);
}
var $__0 = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType"),
ARGUMENT_LIST = $__0.ARGUMENT_LIST,
BLOCK = $__0.BLOCK,
EXPRESSION_STATEMENT = $__0.EXPRESSION_STATEMENT,
IDENTIFIER_EXPRESSION = $__0.IDENTIFIER_EXPRESSION;
var IdentifierToken = System.get("traceur@0.0.74/src/syntax/IdentifierToken").IdentifierToken;
var LiteralToken = System.get("traceur@0.0.74/src/syntax/LiteralToken").LiteralToken;
var Map = System.get("traceur@0.0.74/src/runtime/polyfills/Map").Map;
var CollectingErrorReporter = System.get("traceur@0.0.74/src/util/CollectingErrorReporter").CollectingErrorReporter;
var Options = System.get("traceur@0.0.74/src/Options").Options;
var ParseTree = System.get("traceur@0.0.74/src/syntax/trees/ParseTree").ParseTree;
var ParseTreeTransformer = System.get("traceur@0.0.74/src/codegeneration/ParseTreeTransformer").ParseTreeTransformer;
var Parser = System.get("traceur@0.0.74/src/syntax/Parser").Parser;
var $__9 = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees"),
LiteralExpression = $__9.LiteralExpression,
LiteralPropertyName = $__9.LiteralPropertyName,
TypeName = $__9.TypeName;
var SourceFile = System.get("traceur@0.0.74/src/syntax/SourceFile").SourceFile;
var IDENTIFIER = System.get("traceur@0.0.74/src/syntax/TokenType").IDENTIFIER;
var $__12 = System.get("traceur@0.0.74/src/codegeneration/ParseTreeFactory"),
createArrayLiteralExpression = $__12.createArrayLiteralExpression,
createBindingIdentifier = $__12.createBindingIdentifier,
createBlock = $__12.createBlock,
createBooleanLiteral = $__12.createBooleanLiteral,
createCommaExpression = $__12.createCommaExpression,
createExpressionStatement = $__12.createExpressionStatement,
createFunctionBody = $__12.createFunctionBody,
createIdentifierExpression = $__12.createIdentifierExpression,
createIdentifierToken = $__12.createIdentifierToken,
createMemberExpression = $__12.createMemberExpression,
createNullLiteral = $__12.createNullLiteral,
createNumberLiteral = $__12.createNumberLiteral,
createParenExpression = $__12.createParenExpression,
createStringLiteral = $__12.createStringLiteral,
createVoid0 = $__12.createVoid0;
var NOT_FOUND = {};
var cache = new Map();
function makeParseFunction(doParse) {
return (function(sourceLiterals) {
for (var values = [],
$__14 = 1; $__14 < arguments.length; $__14++)
values[$__14 - 1] = arguments[$__14];
return parse(sourceLiterals, values, doParse);
});
}
var parseExpression = makeParseFunction((function(p) {
return p.parseExpression();
}));
var parseStatement = makeParseFunction((function(p) {
return p.parseStatement();
}));
var parseModule = makeParseFunction((function(p) {
return p.parseModule();
}));
var parseScript = makeParseFunction((function(p) {
return p.parseScript();
}));
var parseStatements = makeParseFunction((function(p) {
return p.parseStatements();
}));
var parsePropertyDefinition = makeParseFunction((function(p) {
return p.parsePropertyDefinition();
}));
function parse(sourceLiterals, values, doParse) {
var tree = cache.get(sourceLiterals);
if (!tree) {
var source = insertPlaceholderIdentifiers(sourceLiterals);
var errorReporter = new CollectingErrorReporter();
var parser = getParser(source, errorReporter);
tree = doParse(parser);
if (errorReporter.hadError() || !tree || !parser.isAtEnd()) {
throw new Error(("Internal error trying to parse:\n\n" + source + "\n\n" + errorReporter.errorsAsString()));
}
cache.set(sourceLiterals, tree);
}
if (!values.length)
return tree;
if (tree instanceof ParseTree)
return new PlaceholderTransformer(values).transformAny(tree);
return new PlaceholderTransformer(values).transformList(tree);
}
var PREFIX = '$__placeholder__';
function insertPlaceholderIdentifiers(sourceLiterals) {
var source = sourceLiterals[0];
for (var i = 1; i < sourceLiterals.length; i++) {
source += PREFIX + (i - 1) + sourceLiterals[i];
}
return source;
}
var counter = 0;
function getParser(source, errorReporter) {
var file = new SourceFile('@traceur/generated/TemplateParser/' + counter++, source);
var options = new Options();
options.types = true;
var parser = new Parser(file, errorReporter, options);
parser.allowYield = true;
parser.allowAwait = true;
return parser;
}
function convertValueToExpression(value) {
if (value instanceof ParseTree)
return value;
if (value instanceof IdentifierToken)
return createIdentifierExpression(value);
if (value instanceof LiteralToken)
return new LiteralExpression(value.location, value);
if (Array.isArray(value)) {
if (value[0] instanceof ParseTree) {
if (value.length === 1)
return value[0];
if (value[0].isStatement())
return createBlock(value);
else
return createParenExpression(createCommaExpression(value));
}
return createArrayLiteralExpression(value.map(convertValueToExpression));
}
if (value === null)
return createNullLiteral();
if (value === undefined)
return createVoid0();
switch (typeof value) {
case 'string':
return createStringLiteral(value);
case 'boolean':
return createBooleanLiteral(value);
case 'number':
return createNumberLiteral(value);
}
throw new Error('Not implemented');
}
function convertValueToIdentifierToken(value) {
if (value instanceof IdentifierToken)
return value;
return createIdentifierToken(value);
}
function convertValueToType(value) {
if (value === null)
return null;
if (value instanceof ParseTree)
return value;
if (typeof value === 'string') {
return new TypeName(null, null, convertValueToIdentifierToken(value));
}
if (value instanceof IdentifierToken) {
return new TypeName(null, null, value);
}
throw new Error('Not implemented');
}
var PlaceholderTransformer = function PlaceholderTransformer(values) {
$traceurRuntime.superConstructor($PlaceholderTransformer).call(this);
this.values = values;
};
var $PlaceholderTransformer = PlaceholderTransformer;
($traceurRuntime.createClass)(PlaceholderTransformer, {
getValueAt: function(index) {
return this.values[index];
},
getValue_: function(str) {
if (str.indexOf(PREFIX) !== 0)
return NOT_FOUND;
return this.getValueAt(Number(str.slice(PREFIX.length)));
},
transformIdentifierExpression: function(tree) {
var value = this.getValue_(tree.identifierToken.value);
if (value === NOT_FOUND)
return tree;
return convertValueToExpression(value);
},
transformBindingIdentifier: function(tree) {
var value = this.getValue_(tree.identifierToken.value);
if (value === NOT_FOUND)
return tree;
return createBindingIdentifier(value);
},
transformExpressionStatement: function(tree) {
if (tree.expression.type === IDENTIFIER_EXPRESSION) {
var transformedExpression = this.transformIdentifierExpression(tree.expression);
if (transformedExpression === tree.expression)
return tree;
if (transformedExpression.isStatement())
return transformedExpression;
return createExpressionStatement(transformedExpression);
}
return $traceurRuntime.superGet(this, $PlaceholderTransformer.prototype, "transformExpressionStatement").call(this, tree);
},
transformBlock: function(tree) {
if (tree.statements.length === 1 && tree.statements[0].type === EXPRESSION_STATEMENT) {
var transformedStatement = this.transformExpressionStatement(tree.statements[0]);
if (transformedStatement === tree.statements[0])
return tree;
if (transformedStatement.type === BLOCK)
return transformedStatement;
}
return $traceurRuntime.superGet(this, $PlaceholderTransformer.prototype, "transformBlock").call(this, tree);
},
transformFunctionBody: function(tree) {
if (tree.statements.length === 1 && tree.statements[0].type === EXPRESSION_STATEMENT) {
var transformedStatement = this.transformExpressionStatement(tree.statements[0]);
if (transformedStatement === tree.statements[0])
return tree;
if (transformedStatement.type === BLOCK)
return createFunctionBody(transformedStatement.statements);
}
return $traceurRuntime.superGet(this, $PlaceholderTransformer.prototype, "transformFunctionBody").call(this, tree);
},
transformMemberExpression: function(tree) {
var value = this.getValue_(tree.memberName.value);
if (value === NOT_FOUND)
return $traceurRuntime.superGet(this, $PlaceholderTransformer.prototype, "transformMemberExpression").call(this, tree);
var operand = this.transformAny(tree.operand);
return createMemberExpression(operand, value);
},
transformLiteralPropertyName: function(tree) {
if (tree.literalToken.type === IDENTIFIER) {
var value = this.getValue_(tree.literalToken.value);
if (value !== NOT_FOUND) {
return new LiteralPropertyName(null, convertValueToIdentifierToken(value));
}
}
return $traceurRuntime.superGet(this, $PlaceholderTransformer.prototype, "transformLiteralPropertyName").call(this, tree);
},
transformArgumentList: function(tree) {
if (tree.args.length === 1 && tree.args[0].type === IDENTIFIER_EXPRESSION) {
var arg0 = this.transformAny(tree.args[0]);
if (arg0 === tree.args[0])
return tree;
if (arg0.type === ARGUMENT_LIST)
return arg0;
}
return $traceurRuntime.superGet(this, $PlaceholderTransformer.prototype, "transformArgumentList").call(this, tree);
},
transformTypeName: function(tree) {
var value = this.getValue_(tree.name.value);
if (value === NOT_FOUND)
return $traceurRuntime.superGet(this, $PlaceholderTransformer.prototype, "transformTypeName").call(this, tree);
var moduleName = this.transformAny(tree.moduleName);
if (moduleName !== null) {
return new TypeName(null, moduleName, convertValueToIdentifierToken(value));
}
return convertValueToType(value);
}
}, {}, ParseTreeTransformer);
return {
get parseExpression() {
return parseExpression;
},
get parseStatement() {
return parseStatement;
},
get parseModule() {
return parseModule;
},
get parseScript() {
return parseScript;
},
get parseStatements() {
return parseStatements;
},
get parsePropertyDefinition() {
return parsePropertyDefinition;
},
get PlaceholderTransformer() {
return PlaceholderTransformer;
}
};
});
System.register("traceur@0.0.74/src/codegeneration/PrependStatements", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/PrependStatements";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/PrependStatements", path);
}
var $__0 = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType"),
EXPRESSION_STATEMENT = $__0.EXPRESSION_STATEMENT,
LITERAL_EXPRESSION = $__0.LITERAL_EXPRESSION;
var STRING = System.get("traceur@0.0.74/src/syntax/TokenType").STRING;
function isStringExpressionStatement(tree) {
return tree.type === EXPRESSION_STATEMENT && tree.expression.type === LITERAL_EXPRESSION && tree.expression.literalToken.type === STRING;
}
function prependStatements(statements) {
for (var statementsToPrepend = [],
$__2 = 1; $__2 < arguments.length; $__2++)
statementsToPrepend[$__2 - 1] = arguments[$__2];
if (!statements.length)
return statementsToPrepend;
if (!statementsToPrepend.length)
return statements;
var transformed = [];
var inProlog = true;
statements.forEach((function(statement) {
var $__3;
if (inProlog && !isStringExpressionStatement(statement)) {
($__3 = transformed).push.apply($__3, $traceurRuntime.spread(statementsToPrepend));
inProlog = false;
}
transformed.push(statement);
}));
return transformed;
}
return {get prependStatements() {
return prependStatements;
}};
});
System.register("traceur@0.0.74/src/codegeneration/TempVarTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/TempVarTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/TempVarTransformer", path);
}
var ParseTreeTransformer = System.get("traceur@0.0.74/src/codegeneration/ParseTreeTransformer").ParseTreeTransformer;
var $__1 = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees"),
Module = $__1.Module,
Script = $__1.Script;
var ARGUMENTS = System.get("traceur@0.0.74/src/syntax/PredefinedName").ARGUMENTS;
var VAR = System.get("traceur@0.0.74/src/syntax/TokenType").VAR;
var $__4 = System.get("traceur@0.0.74/src/codegeneration/ParseTreeFactory"),
createFunctionBody = $__4.createFunctionBody,
createThisExpression = $__4.createThisExpression,
createIdentifierExpression = $__4.createIdentifierExpression,
createVariableDeclaration = $__4.createVariableDeclaration,
createVariableDeclarationList = $__4.createVariableDeclarationList,
createVariableStatement = $__4.createVariableStatement;
var prependStatements = System.get("traceur@0.0.74/src/codegeneration/PrependStatements").prependStatements;
var TempVarStatement = function TempVarStatement(name, initializer) {
this.name = name;
this.initializer = initializer;
};
($traceurRuntime.createClass)(TempVarStatement, {}, {});
var TempScope = function TempScope() {
this.identifiers = [];
};
($traceurRuntime.createClass)(TempScope, {
push: function(identifier) {
this.identifiers.push(identifier);
},
pop: function() {
return this.identifiers.pop();
},
release: function(obj) {
for (var i = this.identifiers.length - 1; i >= 0; i--) {
obj.release_(this.identifiers[i]);
}
}
}, {});
var VarScope = function VarScope() {
this.thisName = null;
this.argumentName = null;
this.tempVarStatements = [];
};
($traceurRuntime.createClass)(VarScope, {
push: function(tempVarStatement) {
this.tempVarStatements.push(tempVarStatement);
},
pop: function() {
return this.tempVarStatements.pop();
},
release: function(obj) {
for (var i = this.tempVarStatements.length - 1; i >= 0; i--) {
obj.release_(this.tempVarStatements[i].name);
}
},
isEmpty: function() {
return !this.tempVarStatements.length;
},
createVariableStatement: function() {
var declarations = [];
var seenNames = Object.create(null);
for (var i = 0; i < this.tempVarStatements.length; i++) {
var $__7 = this.tempVarStatements[i],
name = $__7.name,
initializer = $__7.initializer;
if (name in seenNames) {
if (seenNames[name].initializer || initializer)
throw new Error('Invalid use of TempVarTransformer');
continue;
}
seenNames[name] = true;
declarations.push(createVariableDeclaration(name, initializer));
}
return createVariableStatement(createVariableDeclarationList(VAR, declarations));
}
}, {});
var TempVarTransformer = function TempVarTransformer(identifierGenerator) {
$traceurRuntime.superConstructor($TempVarTransformer).call(this);
this.identifierGenerator = identifierGenerator;
this.tempVarStack_ = [new VarScope()];
this.tempScopeStack_ = [new TempScope()];
this.namePool_ = [];
};
var $TempVarTransformer = TempVarTransformer;
($traceurRuntime.createClass)(TempVarTransformer, {
transformStatements_: function(statements) {
this.tempVarStack_.push(new VarScope());
var transformedStatements = this.transformList(statements);
var vars = this.tempVarStack_.pop();
if (vars.isEmpty())
return transformedStatements;
var variableStatement = vars.createVariableStatement();
vars.release(this);
return prependStatements(transformedStatements, variableStatement);
},
transformScript: function(tree) {
var scriptItemList = this.transformStatements_(tree.scriptItemList);
if (scriptItemList == tree.scriptItemList) {
return tree;
}
return new Script(tree.location, scriptItemList, tree.moduleName);
},
transformModule: function(tree) {
var scriptItemList = this.transformStatements_(tree.scriptItemList);
if (scriptItemList == tree.scriptItemList) {
return tree;
}
return new Module(tree.location, scriptItemList, tree.moduleName);
},
transformFunctionBody: function(tree) {
this.pushTempScope();
var statements = this.transformStatements_(tree.statements);
this.popTempScope();
if (statements == tree.statements)
return tree;
return createFunctionBody(statements);
},
getTempIdentifier: function() {
var name = this.getName_();
this.tempScopeStack_[this.tempScopeStack_.length - 1].push(name);
return name;
},
getName_: function() {
return this.namePool_.length ? this.namePool_.pop() : this.identifierGenerator.generateUniqueIdentifier();
},
addTempVar: function() {
var initializer = arguments[0] !== (void 0) ? arguments[0] : null;
var vars = this.tempVarStack_[this.tempVarStack_.length - 1];
var name = this.getName_();
vars.push(new TempVarStatement(name, initializer));
return name;
},
addTempVarForThis: function() {
var varScope = this.tempVarStack_[this.tempVarStack_.length - 1];
return varScope.thisName || (varScope.thisName = this.addTempVar(createThisExpression()));
},
addTempVarForArguments: function() {
var varScope = this.tempVarStack_[this.tempVarStack_.length - 1];
return varScope.argumentName || (varScope.argumentName = this.addTempVar(createIdentifierExpression(ARGUMENTS)));
},
pushTempScope: function() {
this.tempScopeStack_.push(new TempScope());
},
popTempScope: function() {
this.tempScopeStack_.pop().release(this);
},
release_: function(name) {
this.namePool_.push(name);
}
}, {}, ParseTreeTransformer);
return {get TempVarTransformer() {
return TempVarTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/DestructuringTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/DestructuringTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/DestructuringTransformer", path);
}
var $__0 = Object.freeze(Object.defineProperties(["Array.prototype.slice.call(", ", ", ")"], {raw: {value: Object.freeze(["Array.prototype.slice.call(", ", ", ")"])}})),
$__1 = Object.freeze(Object.defineProperties(["(", " = ", ".", ") === void 0 ?\n ", " : ", ""], {raw: {value: Object.freeze(["(", " = ", ".", ") === void 0 ?\n ", " : ", ""])}})),
$__2 = Object.freeze(Object.defineProperties(["(", " = ", "[", "]) === void 0 ?\n ", " : ", ""], {raw: {value: Object.freeze(["(", " = ", "[", "]) === void 0 ?\n ", " : ", ""])}}));
var $__3 = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType"),
ARRAY_LITERAL_EXPRESSION = $__3.ARRAY_LITERAL_EXPRESSION,
ARRAY_PATTERN = $__3.ARRAY_PATTERN,
ASSIGNMENT_ELEMENT = $__3.ASSIGNMENT_ELEMENT,
BINDING_ELEMENT = $__3.BINDING_ELEMENT,
BINDING_IDENTIFIER = $__3.BINDING_IDENTIFIER,
BLOCK = $__3.BLOCK,
CALL_EXPRESSION = $__3.CALL_EXPRESSION,
COMPUTED_PROPERTY_NAME = $__3.COMPUTED_PROPERTY_NAME,
IDENTIFIER_EXPRESSION = $__3.IDENTIFIER_EXPRESSION,
LITERAL_EXPRESSION = $__3.LITERAL_EXPRESSION,
MEMBER_EXPRESSION = $__3.MEMBER_EXPRESSION,
MEMBER_LOOKUP_EXPRESSION = $__3.MEMBER_LOOKUP_EXPRESSION,
OBJECT_LITERAL_EXPRESSION = $__3.OBJECT_LITERAL_EXPRESSION,
OBJECT_PATTERN = $__3.OBJECT_PATTERN,
OBJECT_PATTERN_FIELD = $__3.OBJECT_PATTERN_FIELD,
PAREN_EXPRESSION = $__3.PAREN_EXPRESSION,
VARIABLE_DECLARATION_LIST = $__3.VARIABLE_DECLARATION_LIST;
var $__4 = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees"),
AssignmentElement = $__4.AssignmentElement,
BindingElement = $__4.BindingElement,
Catch = $__4.Catch,
ForInStatement = $__4.ForInStatement,
ForOfStatement = $__4.ForOfStatement;
var TempVarTransformer = System.get("traceur@0.0.74/src/codegeneration/TempVarTransformer").TempVarTransformer;
var $__6 = System.get("traceur@0.0.74/src/syntax/TokenType"),
EQUAL = $__6.EQUAL,
LET = $__6.LET,
VAR = $__6.VAR;
var $__7 = System.get("traceur@0.0.74/src/codegeneration/ParseTreeFactory"),
createAssignmentExpression = $__7.createAssignmentExpression,
createBindingIdentifier = $__7.createBindingIdentifier,
createBlock = $__7.createBlock,
createCommaExpression = $__7.createCommaExpression,
createExpressionStatement = $__7.createExpressionStatement,
createFunctionBody = $__7.createFunctionBody,
createIdentifierExpression = $__7.createIdentifierExpression,
createMemberExpression = $__7.createMemberExpression,
createMemberLookupExpression = $__7.createMemberLookupExpression,
createNumberLiteral = $__7.createNumberLiteral,
createParenExpression = $__7.createParenExpression,
createVariableDeclaration = $__7.createVariableDeclaration,
createVariableDeclarationList = $__7.createVariableDeclarationList,
createVariableStatement = $__7.createVariableStatement;
var options = System.get("traceur@0.0.74/src/Options").options;
var parseExpression = System.get("traceur@0.0.74/src/codegeneration/PlaceholderParser").parseExpression;
var prependStatements = System.get("traceur@0.0.74/src/codegeneration/PrependStatements").prependStatements;
var Desugaring = function Desugaring(rvalue) {
this.rvalue = rvalue;
};
($traceurRuntime.createClass)(Desugaring, {}, {});
var AssignmentExpressionDesugaring = function AssignmentExpressionDesugaring(rvalue) {
$traceurRuntime.superConstructor($AssignmentExpressionDesugaring).call(this, rvalue);
this.expressions = [];
};
var $AssignmentExpressionDesugaring = AssignmentExpressionDesugaring;
($traceurRuntime.createClass)(AssignmentExpressionDesugaring, {assign: function(lvalue, rvalue) {
lvalue = lvalue instanceof AssignmentElement ? lvalue.assignment : lvalue;
this.expressions.push(createAssignmentExpression(lvalue, rvalue));
}}, {}, Desugaring);
var VariableDeclarationDesugaring = function VariableDeclarationDesugaring(rvalue) {
$traceurRuntime.superConstructor($VariableDeclarationDesugaring).call(this, rvalue);
this.declarations = [];
};
var $VariableDeclarationDesugaring = VariableDeclarationDesugaring;
($traceurRuntime.createClass)(VariableDeclarationDesugaring, {assign: function(lvalue, rvalue) {
var binding = lvalue instanceof BindingElement ? lvalue.binding : createBindingIdentifier(lvalue);
this.declarations.push(createVariableDeclaration(binding, rvalue));
}}, {}, Desugaring);
var DestructuringTransformer = function DestructuringTransformer(identifierGenerator) {
$traceurRuntime.superConstructor($DestructuringTransformer).call(this, identifierGenerator);
this.parameterDeclarations = null;
};
var $DestructuringTransformer = DestructuringTransformer;
($traceurRuntime.createClass)(DestructuringTransformer, {
transformArrayPattern: function(tree) {
throw new Error('unreachable');
},
transformObjectPattern: function(tree) {
throw new Error('unreachable');
},
transformBinaryExpression: function(tree) {
this.pushTempScope();
var rv;
if (tree.operator.type == EQUAL && tree.left.isPattern()) {
rv = this.transformAny(this.desugarAssignment_(tree.left, tree.right));
} else {
rv = $traceurRuntime.superGet(this, $DestructuringTransformer.prototype, "transformBinaryExpression").call(this, tree);
}
this.popTempScope();
return rv;
},
desugarAssignment_: function(lvalue, rvalue) {
var tempIdent = createIdentifierExpression(this.addTempVar());
var desugaring = new AssignmentExpressionDesugaring(tempIdent);
this.desugarPattern_(desugaring, lvalue);
desugaring.expressions.unshift(createAssignmentExpression(tempIdent, rvalue));
desugaring.expressions.push(tempIdent);
return createParenExpression(createCommaExpression(desugaring.expressions));
},
transformVariableDeclarationList: function(tree) {
var $__11 = this;
if (!this.destructuringInDeclaration_(tree)) {
return $traceurRuntime.superGet(this, $DestructuringTransformer.prototype, "transformVariableDeclarationList").call(this, tree);
}
var desugaredDeclarations = [];
tree.declarations.forEach((function(declaration) {
var $__13;
if (declaration.lvalue.isPattern()) {
($__13 = desugaredDeclarations).push.apply($__13, $traceurRuntime.spread($__11.desugarVariableDeclaration_(declaration)));
} else {
desugaredDeclarations.push(declaration);
}
}));
var transformedTree = this.transformVariableDeclarationList(createVariableDeclarationList(tree.declarationType, desugaredDeclarations));
return transformedTree;
},
transformForInStatement: function(tree) {
return this.transformForInOrOf_(tree, $traceurRuntime.superGet(this, $DestructuringTransformer.prototype, "transformForInStatement"), ForInStatement);
},
transformForOfStatement: function(tree) {
return this.transformForInOrOf_(tree, $traceurRuntime.superGet(this, $DestructuringTransformer.prototype, "transformForOfStatement"), ForOfStatement);
},
transformForInOrOf_: function(tree, superMethod, constr) {
var $__13;
if (!tree.initializer.isPattern() && (tree.initializer.type !== VARIABLE_DECLARATION_LIST || !this.destructuringInDeclaration_(tree.initializer))) {
return superMethod.call(this, tree);
}
this.pushTempScope();
var declarationType,
lvalue;
if (tree.initializer.isPattern()) {
declarationType = null;
lvalue = tree.initializer;
} else {
declarationType = tree.initializer.declarationType;
lvalue = tree.initializer.declarations[0].lvalue;
}
var statements = [];
var binding = this.desugarBinding_(lvalue, statements, declarationType);
var initializer = createVariableDeclarationList(VAR, binding, null);
var collection = this.transformAny(tree.collection);
var body = this.transformAny(tree.body);
if (body.type === BLOCK)
($__13 = statements).push.apply($__13, $traceurRuntime.spread(body.statements));
else
statements.push(body);
body = createBlock(statements);
this.popTempScope();
return new constr(tree.location, initializer, collection, body);
},
transformAssignmentElement: function(tree) {
throw new Error('unreachable');
},
transformBindingElement: function(tree) {
if (!tree.binding.isPattern() || tree.initializer)
return tree;
if (this.parameterDeclarations === null) {
this.parameterDeclarations = [];
this.pushTempScope();
}
var varName = this.getTempIdentifier();
var binding = createBindingIdentifier(varName);
var initializer = createIdentifierExpression(varName);
var decl = createVariableDeclaration(tree.binding, initializer);
this.parameterDeclarations.push(decl);
return new BindingElement(null, binding, null);
},
transformFunctionBody: function(tree) {
if (this.parameterDeclarations === null)
return $traceurRuntime.superGet(this, $DestructuringTransformer.prototype, "transformFunctionBody").call(this, tree);
var list = createVariableDeclarationList(VAR, this.parameterDeclarations);
var statement = createVariableStatement(list);
var statements = prependStatements(tree.statements, statement);
var newBody = createFunctionBody(statements);
this.parameterDeclarations = null;
var result = $traceurRuntime.superGet(this, $DestructuringTransformer.prototype, "transformFunctionBody").call(this, newBody);
this.popTempScope();
return result;
},
transformCatch: function(tree) {
var $__13;
if (!tree.binding.isPattern())
return $traceurRuntime.superGet(this, $DestructuringTransformer.prototype, "transformCatch").call(this, tree);
var body = this.transformAny(tree.catchBody);
var statements = [];
var kind = options.blockBinding ? LET : VAR;
var binding = this.desugarBinding_(tree.binding, statements, kind);
($__13 = statements).push.apply($__13, $traceurRuntime.spread(body.statements));
return new Catch(tree.location, binding, createBlock(statements));
},
desugarBinding_: function(bindingTree, statements, declarationType) {
var varName = this.getTempIdentifier();
var binding = createBindingIdentifier(varName);
var idExpr = createIdentifierExpression(varName);
var desugaring;
if (declarationType === null)
desugaring = new AssignmentExpressionDesugaring(idExpr);
else
desugaring = new VariableDeclarationDesugaring(idExpr);
this.desugarPattern_(desugaring, bindingTree);
if (declarationType === null) {
statements.push(createExpressionStatement(createCommaExpression(desugaring.expressions)));
} else {
statements.push(createVariableStatement(this.transformVariableDeclarationList(createVariableDeclarationList(declarationType, desugaring.declarations))));
}
return binding;
},
destructuringInDeclaration_: function(tree) {
return tree.declarations.some((function(declaration) {
return declaration.lvalue.isPattern();
}));
},
desugarVariableDeclaration_: function(tree) {
var tempRValueName = this.getTempIdentifier();
var tempRValueIdent = createIdentifierExpression(tempRValueName);
var desugaring;
var initializer;
switch (tree.initializer.type) {
case ARRAY_LITERAL_EXPRESSION:
case CALL_EXPRESSION:
case IDENTIFIER_EXPRESSION:
case LITERAL_EXPRESSION:
case MEMBER_EXPRESSION:
case MEMBER_LOOKUP_EXPRESSION:
case OBJECT_LITERAL_EXPRESSION:
case PAREN_EXPRESSION:
initializer = tree.initializer;
default:
desugaring = new VariableDeclarationDesugaring(tempRValueIdent);
desugaring.assign(desugaring.rvalue, tree.initializer);
var initializerFound = this.desugarPattern_(desugaring, tree.lvalue);
if (initializerFound || desugaring.declarations.length > 2) {
return desugaring.declarations;
}
if (!initializer) {
initializer = createParenExpression(tree.initializer);
}
desugaring = new VariableDeclarationDesugaring(initializer);
this.desugarPattern_(desugaring, tree.lvalue);
return desugaring.declarations;
}
},
desugarPattern_: function(desugaring, tree) {
var $__11 = this;
var initializerFound = false;
switch (tree.type) {
case ARRAY_PATTERN:
var pattern = tree;
for (var i = 0; i < pattern.elements.length; i++) {
var lvalue = pattern.elements[i];
if (lvalue === null) {
continue;
} else if (lvalue.isSpreadPatternElement()) {
desugaring.assign(lvalue.lvalue, parseExpression($__0, desugaring.rvalue, i));
} else {
if (lvalue.initializer)
initializerFound = true;
desugaring.assign(lvalue, this.createConditionalMemberLookupExpression(desugaring.rvalue, createNumberLiteral(i), lvalue.initializer));
}
}
break;
case OBJECT_PATTERN:
var pattern = tree;
var elementHelper = (function(lvalue, initializer) {
if (initializer)
initializerFound = true;
var lookup = $__11.createConditionalMemberExpression(desugaring.rvalue, lvalue, initializer);
desugaring.assign(lvalue, lookup);
});
pattern.fields.forEach((function(field) {
var lookup;
switch (field.type) {
case ASSIGNMENT_ELEMENT:
elementHelper(field.assignment, field.initializer);
break;
case BINDING_ELEMENT:
elementHelper(field.binding, field.initializer);
break;
case OBJECT_PATTERN_FIELD:
if (field.element.initializer)
initializerFound = true;
var name = field.name;
lookup = $__11.createConditionalMemberExpression(desugaring.rvalue, name, field.element.initializer);
desugaring.assign(field.element, lookup);
break;
default:
throw Error('unreachable');
}
}));
break;
case PAREN_EXPRESSION:
return this.desugarPattern_(desugaring, tree.expression);
default:
throw new Error('unreachable');
}
if (desugaring instanceof VariableDeclarationDesugaring && desugaring.declarations.length === 0) {
desugaring.assign(createBindingIdentifier(this.getTempIdentifier()), desugaring.rvalue);
}
return initializerFound;
},
createConditionalMemberExpression: function(rvalue, name, initializer) {
if (name.type === COMPUTED_PROPERTY_NAME) {
return this.createConditionalMemberLookupExpression(rvalue, name.expression, initializer);
}
var token;
switch (name.type) {
case BINDING_IDENTIFIER:
case IDENTIFIER_EXPRESSION:
token = name.identifierToken;
break;
default:
token = name.literalToken;
}
if (!initializer)
return createMemberExpression(rvalue, token);
var tempIdent = createIdentifierExpression(this.addTempVar());
return parseExpression($__1, tempIdent, rvalue, token, initializer, tempIdent);
},
createConditionalMemberLookupExpression: function(rvalue, index, initializer) {
if (!initializer)
return createMemberLookupExpression(rvalue, index);
var tempIdent = createIdentifierExpression(this.addTempVar());
return parseExpression($__2, tempIdent, rvalue, index, initializer, tempIdent);
}
}, {}, TempVarTransformer);
return {get DestructuringTransformer() {
return DestructuringTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/module/ModuleSymbol", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/module/ModuleSymbol";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/module/ModuleSymbol", path);
}
var assert = System.get("traceur@0.0.74/src/util/assert").assert;
var ExportsList = function ExportsList(normalizedName) {
this.exports_ = Object.create(null);
if (normalizedName !== null)
this.normalizedName = normalizedName.replace(/\\/g, '/');
else
this.normalizedName = null;
};
($traceurRuntime.createClass)(ExportsList, {
addExport: function(name, tree) {
assert(!this.exports_[name]);
this.exports_[name] = tree;
},
getExport: function(name) {
return this.exports_[name];
},
getExports: function() {
return Object.keys(this.exports_);
},
addExportsFromModule: function(module) {
var $__1 = this;
Object.getOwnPropertyNames(module).forEach((function(name) {
$__1.addExport(name, true);
}));
}
}, {});
var ModuleSymbol = function ModuleSymbol(tree, normalizedName) {
$traceurRuntime.superConstructor($ModuleSymbol).call(this, normalizedName);
this.tree = tree;
this.imports_ = Object.create(null);
};
var $ModuleSymbol = ModuleSymbol;
($traceurRuntime.createClass)(ModuleSymbol, {
addImport: function(name, tree) {
assert(!this.imports_[name]);
this.imports_[name] = tree;
},
getImport: function(name) {
return this.imports_[name];
}
}, {}, ExportsList);
return {
get ExportsList() {
return ExportsList;
},
get ModuleSymbol() {
return ModuleSymbol;
}
};
});
System.register("traceur@0.0.74/src/codegeneration/module/ModuleVisitor", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/module/ModuleVisitor";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/module/ModuleVisitor", path);
}
var ExportsList = System.get("traceur@0.0.74/src/codegeneration/module/ModuleSymbol").ExportsList;
var ParseTreeVisitor = System.get("traceur@0.0.74/src/syntax/ParseTreeVisitor").ParseTreeVisitor;
var $__2 = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType"),
MODULE_DECLARATION = $__2.MODULE_DECLARATION,
EXPORT_DECLARATION = $__2.EXPORT_DECLARATION,
IMPORT_DECLARATION = $__2.IMPORT_DECLARATION;
var ModuleVisitor = function ModuleVisitor(reporter, loader, moduleSymbol) {
this.reporter = reporter;
this.loader_ = loader;
this.moduleSymbol = moduleSymbol;
};
($traceurRuntime.createClass)(ModuleVisitor, {
getExportsListForModuleSpecifier: function(name) {
var referrer = this.moduleSymbol.normalizedName;
return this.loader_.getExportsListForModuleSpecifier(name, referrer);
},
visitFunctionDeclaration: function(tree) {},
visitFunctionExpression: function(tree) {},
visitFunctionBody: function(tree) {},
visitBlock: function(tree) {},
visitClassDeclaration: function(tree) {},
visitClassExpression: function(tree) {},
visitModuleElement_: function(element) {
switch (element.type) {
case MODULE_DECLARATION:
case EXPORT_DECLARATION:
case IMPORT_DECLARATION:
this.visitAny(element);
}
},
visitScript: function(tree) {
tree.scriptItemList.forEach(this.visitModuleElement_, this);
},
visitModule: function(tree) {
tree.scriptItemList.forEach(this.visitModuleElement_, this);
},
reportError: function(tree, message) {
this.reporter.reportError(tree.location.start, message);
}
}, {}, ParseTreeVisitor);
return {get ModuleVisitor() {
return ModuleVisitor;
}};
});
System.register("traceur@0.0.74/src/codegeneration/module/ExportVisitor", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/module/ExportVisitor";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/module/ExportVisitor", path);
}
var ModuleVisitor = System.get("traceur@0.0.74/src/codegeneration/module/ModuleVisitor").ModuleVisitor;
var assert = System.get("traceur@0.0.74/src/util/assert").assert;
var ExportVisitor = function ExportVisitor(reporter, loader, moduleSymbol) {
$traceurRuntime.superConstructor($ExportVisitor).call(this, reporter, loader, moduleSymbol);
this.inExport_ = false;
this.moduleSpecifier = null;
};
var $ExportVisitor = ExportVisitor;
($traceurRuntime.createClass)(ExportVisitor, {
addExport_: function(name, tree) {
assert(typeof name == 'string');
if (this.inExport_)
this.addExport(name, tree);
},
addExport: function(name, tree) {
var moduleSymbol = this.moduleSymbol;
var existingExport = moduleSymbol.getExport(name);
if (existingExport) {
this.reportError(tree, ("Duplicate export. '" + name + "' was previously ") + ("exported at " + existingExport.location.start));
} else {
moduleSymbol.addExport(name, tree);
}
},
visitClassDeclaration: function(tree) {
this.addExport_(tree.name.identifierToken.value, tree);
},
visitExportDeclaration: function(tree) {
this.inExport_ = true;
this.visitAny(tree.declaration);
this.inExport_ = false;
},
visitNamedExport: function(tree) {
this.moduleSpecifier = tree.moduleSpecifier;
this.visitAny(tree.specifierSet);
this.moduleSpecifier = null;
},
visitExportDefault: function(tree) {
this.addExport_('default', tree);
},
visitExportSpecifier: function(tree) {
this.addExport_((tree.rhs || tree.lhs).value, tree);
},
visitExportStar: function(tree) {
var $__2 = this;
var name = this.moduleSpecifier.token.processedValue;
var exportList = this.getExportsListForModuleSpecifier(name);
if (exportList) {
exportList.getExports().forEach((function(name) {
return $__2.addExport(name, tree);
}));
}
},
visitFunctionDeclaration: function(tree) {
this.addExport_(tree.name.getStringValue(), tree);
},
visitModuleDeclaration: function(tree) {
var name = tree.binding.getStringValue();
this.addExport_(name, tree);
},
visitVariableDeclaration: function(tree) {
this.addExport_(tree.lvalue.getStringValue(), tree);
}
}, {}, ModuleVisitor);
return {get ExportVisitor() {
return ExportVisitor;
}};
});
System.register("traceur@0.0.74/src/codegeneration/module/DirectExportVisitor", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/module/DirectExportVisitor";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/module/DirectExportVisitor", path);
}
var ExportVisitor = System.get("traceur@0.0.74/src/codegeneration/module/ExportVisitor").ExportVisitor;
var DirectExportVisitor = function DirectExportVisitor() {
$traceurRuntime.superConstructor($DirectExportVisitor).call(this, null, null, null);
this.namedExports = [];
this.starExports = [];
};
var $DirectExportVisitor = DirectExportVisitor;
($traceurRuntime.createClass)(DirectExportVisitor, {
addExport: function(name, tree) {
this.namedExports.push({
name: name,
tree: tree,
moduleSpecifier: this.moduleSpecifier
});
},
visitExportStar: function(tree) {
this.starExports.push(this.moduleSpecifier);
},
hasExports: function() {
return this.namedExports.length != 0 || this.starExports.length != 0;
}
}, {}, ExportVisitor);
return {get DirectExportVisitor() {
return DirectExportVisitor;
}};
});
System.register("traceur@0.0.74/src/codegeneration/ModuleTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/ModuleTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/ModuleTransformer", path);
}
var $__0 = Object.freeze(Object.defineProperties(["var __moduleName = ", ";"], {raw: {value: Object.freeze(["var __moduleName = ", ";"])}})),
$__1 = Object.freeze(Object.defineProperties(["function require(path) {\n return $traceurRuntime.require(", ", path);\n }"], {raw: {value: Object.freeze(["function require(path) {\n return $traceurRuntime.require(", ", path);\n }"])}})),
$__2 = Object.freeze(Object.defineProperties(["function() {\n ", "\n }"], {raw: {value: Object.freeze(["function() {\n ", "\n }"])}})),
$__3 = Object.freeze(Object.defineProperties(["$traceurRuntime.ModuleStore.getAnonymousModule(\n ", ");"], {raw: {value: Object.freeze(["$traceurRuntime.ModuleStore.getAnonymousModule(\n ", ");"])}})),
$__4 = Object.freeze(Object.defineProperties(["System.register(", ", [], ", ");"], {raw: {value: Object.freeze(["System.register(", ", [], ", ");"])}})),
$__5 = Object.freeze(Object.defineProperties(["get ", "() { return ", "; }"], {raw: {value: Object.freeze(["get ", "() { return ", "; }"])}})),
$__6 = Object.freeze(Object.defineProperties(["$traceurRuntime.exportStar(", ")"], {raw: {value: Object.freeze(["$traceurRuntime.exportStar(", ")"])}})),
$__7 = Object.freeze(Object.defineProperties(["return ", ""], {raw: {value: Object.freeze(["return ", ""])}})),
$__8 = Object.freeze(Object.defineProperties(["var $__default = ", ""], {raw: {value: Object.freeze(["var $__default = ", ""])}})),
$__9 = Object.freeze(Object.defineProperties(["var $__default = ", ""], {raw: {value: Object.freeze(["var $__default = ", ""])}})),
$__10 = Object.freeze(Object.defineProperties(["System.get(", ")"], {raw: {value: Object.freeze(["System.get(", ")"])}}));
var $__11 = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees"),
AnonBlock = $__11.AnonBlock,
BindingElement = $__11.BindingElement,
EmptyStatement = $__11.EmptyStatement,
LiteralPropertyName = $__11.LiteralPropertyName,
ObjectPattern = $__11.ObjectPattern,
ObjectPatternField = $__11.ObjectPatternField,
Script = $__11.Script;
var DestructuringTransformer = System.get("traceur@0.0.74/src/codegeneration/DestructuringTransformer").DestructuringTransformer;
var DirectExportVisitor = System.get("traceur@0.0.74/src/codegeneration/module/DirectExportVisitor").DirectExportVisitor;
var TempVarTransformer = System.get("traceur@0.0.74/src/codegeneration/TempVarTransformer").TempVarTransformer;
var $__15 = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType"),
CLASS_DECLARATION = $__15.CLASS_DECLARATION,
EXPORT_DEFAULT = $__15.EXPORT_DEFAULT,
EXPORT_SPECIFIER = $__15.EXPORT_SPECIFIER,
FUNCTION_DECLARATION = $__15.FUNCTION_DECLARATION,
IMPORT_SPECIFIER_SET = $__15.IMPORT_SPECIFIER_SET;
var VAR = System.get("traceur@0.0.74/src/syntax/TokenType").VAR;
var assert = System.get("traceur@0.0.74/src/util/assert").assert;
var $__18 = System.get("traceur@0.0.74/src/codegeneration/ParseTreeFactory"),
createArgumentList = $__18.createArgumentList,
createExpressionStatement = $__18.createExpressionStatement,
createIdentifierExpression = $__18.createIdentifierExpression,
createIdentifierToken = $__18.createIdentifierToken,
createMemberExpression = $__18.createMemberExpression,
createObjectLiteralExpression = $__18.createObjectLiteralExpression,
createUseStrictDirective = $__18.createUseStrictDirective,
createVariableStatement = $__18.createVariableStatement;
var $__19 = System.get("traceur@0.0.74/src/Options"),
parseOptions = $__19.parseOptions,
transformOptions = $__19.transformOptions;
var $__20 = System.get("traceur@0.0.74/src/codegeneration/PlaceholderParser"),
parseExpression = $__20.parseExpression,
parsePropertyDefinition = $__20.parsePropertyDefinition,
parseStatement = $__20.parseStatement,
parseStatements = $__20.parseStatements;
var DestructImportVarStatement = function DestructImportVarStatement() {
$traceurRuntime.superConstructor($DestructImportVarStatement).apply(this, arguments);
};
var $DestructImportVarStatement = DestructImportVarStatement;
($traceurRuntime.createClass)(DestructImportVarStatement, {createGuardedExpression: function(tree) {
return tree;
}}, {}, DestructuringTransformer);
var ModuleTransformer = function ModuleTransformer(identifierGenerator) {
$traceurRuntime.superConstructor($ModuleTransformer).call(this, identifierGenerator);
this.exportVisitor_ = new DirectExportVisitor();
this.moduleSpecifierKind_ = null;
this.moduleName = null;
};
var $ModuleTransformer = ModuleTransformer;
($traceurRuntime.createClass)(ModuleTransformer, {
getTempVarNameForModuleName: function(moduleName) {
return '$__' + moduleName.replace(/[^a-zA-Z0-9$]/g, function(c) {
return '_' + c.charCodeAt(0) + '_';
}) + '__';
},
getTempVarNameForModuleSpecifier: function(moduleSpecifier) {
var normalizedName = System.normalize(moduleSpecifier.token.processedValue, this.moduleName);
return this.getTempVarNameForModuleName(normalizedName);
},
transformScript: function(tree) {
this.moduleName = tree.moduleName;
return $traceurRuntime.superGet(this, $ModuleTransformer.prototype, "transformScript").call(this, tree);
},
transformModule: function(tree) {
this.moduleName = tree.moduleName;
this.pushTempScope();
var statements = this.transformList(tree.scriptItemList);
statements = this.appendExportStatement(statements);
this.popTempScope();
statements = this.wrapModule(this.moduleProlog().concat(statements));
return new Script(tree.location, statements);
},
moduleProlog: function() {
var statements = [createUseStrictDirective()];
if (this.moduleName) {
statements.push(parseStatement($__0, this.moduleName));
var callerPathString = this.moduleName;
statements.push(parseStatement($__1, callerPathString));
}
return statements;
},
wrapModule: function(statements) {
var functionExpression = parseExpression($__2, statements);
if (this.moduleName === null) {
return parseStatements($__3, functionExpression);
}
return parseStatements($__4, this.moduleName, functionExpression);
},
getGetterExport: function($__23) {
var $__24 = $__23,
name = $__24.name,
tree = $__24.tree,
moduleSpecifier = $__24.moduleSpecifier;
var returnExpression;
switch (tree.type) {
case EXPORT_DEFAULT:
returnExpression = createIdentifierExpression('$__default');
break;
case EXPORT_SPECIFIER:
if (moduleSpecifier) {
var idName = this.getTempVarNameForModuleSpecifier(moduleSpecifier);
returnExpression = createMemberExpression(idName, tree.lhs);
} else {
returnExpression = createIdentifierExpression(tree.lhs);
}
break;
default:
returnExpression = createIdentifierExpression(name);
break;
}
return parsePropertyDefinition($__5, name, returnExpression);
},
getExportProperties: function() {
var $__21 = this;
return this.exportVisitor_.namedExports.map((function(exp) {
return $__21.getGetterExport(exp);
})).concat(this.exportVisitor_.namedExports.map((function(exp) {
return $__21.getSetterExport(exp);
}))).filter((function(e) {
return e;
}));
},
getSetterExport: function($__23) {
var $__24 = $__23,
name = $__24.name,
tree = $__24.tree,
moduleSpecifier = $__24.moduleSpecifier;
return null;
},
getExportObject: function() {
var $__21 = this;
var exportObject = createObjectLiteralExpression(this.getExportProperties());
if (this.exportVisitor_.starExports.length) {
var starExports = this.exportVisitor_.starExports;
var starIdents = starExports.map((function(moduleSpecifier) {
return createIdentifierExpression($__21.getTempVarNameForModuleSpecifier(moduleSpecifier));
}));
var args = createArgumentList($traceurRuntime.spread([exportObject], starIdents));
return parseExpression($__6, args);
}
return exportObject;
},
appendExportStatement: function(statements) {
var exportObject = this.getExportObject();
statements.push(parseStatement($__7, exportObject));
return statements;
},
hasExports: function() {
return this.exportVisitor_.hasExports();
},
transformExportDeclaration: function(tree) {
this.exportVisitor_.visitAny(tree);
return this.transformAny(tree.declaration);
},
transformExportDefault: function(tree) {
switch (tree.expression.type) {
case CLASS_DECLARATION:
case FUNCTION_DECLARATION:
var nameBinding = tree.expression.name;
var name = createIdentifierExpression(nameBinding.identifierToken);
return new AnonBlock(null, [tree.expression, parseStatement($__8, name)]);
}
return parseStatement($__9, tree.expression);
},
transformNamedExport: function(tree) {
var moduleSpecifier = tree.moduleSpecifier;
if (moduleSpecifier) {
var expression = this.transformAny(moduleSpecifier);
var idName = this.getTempVarNameForModuleSpecifier(moduleSpecifier);
return createVariableStatement(VAR, idName, expression);
}
return new EmptyStatement(null);
},
transformModuleSpecifier: function(tree) {
assert(this.moduleName);
var name = tree.token.processedValue;
var normalizedName = System.normalize(name, this.moduleName);
return parseExpression($__10, normalizedName);
},
transformModuleDeclaration: function(tree) {
this.moduleSpecifierKind_ = 'module';
var initializer = this.transformAny(tree.expression);
var bindingIdentifier = tree.binding.binding;
return createVariableStatement(VAR, bindingIdentifier, initializer);
},
transformImportedBinding: function(tree) {
var bindingElement = new BindingElement(tree.location, tree.binding, null);
var name = new LiteralPropertyName(null, createIdentifierToken('default'));
return new ObjectPattern(null, [new ObjectPatternField(null, name, bindingElement)]);
},
transformImportDeclaration: function(tree) {
this.moduleSpecifierKind_ = 'import';
if (!tree.importClause || (tree.importClause.type === IMPORT_SPECIFIER_SET && tree.importClause.specifiers.length === 0)) {
return createExpressionStatement(this.transformAny(tree.moduleSpecifier));
}
var binding = this.transformAny(tree.importClause);
var initializer = this.transformAny(tree.moduleSpecifier);
var varStatement = createVariableStatement(VAR, binding, initializer);
if (transformOptions.destructuring || !parseOptions.destructuring) {
var destructuringTransformer = new DestructImportVarStatement(this.identifierGenerator);
varStatement = varStatement.transform(destructuringTransformer);
}
return varStatement;
},
transformImportSpecifierSet: function(tree) {
var fields = this.transformList(tree.specifiers);
return new ObjectPattern(null, fields);
},
transformImportSpecifier: function(tree) {
var binding = tree.binding.binding;
var bindingElement = new BindingElement(binding.location, binding, null);
if (tree.name) {
var name = new LiteralPropertyName(tree.name.location, tree.name);
return new ObjectPatternField(tree.location, name, bindingElement);
}
return bindingElement;
}
}, {}, TempVarTransformer);
return {get ModuleTransformer() {
return ModuleTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/globalThis", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/globalThis";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/globalThis", path);
}
var $__0 = Object.freeze(Object.defineProperties(["Reflect.global"], {raw: {value: Object.freeze(["Reflect.global"])}}));
var parseExpression = System.get("traceur@0.0.74/src/codegeneration/PlaceholderParser").parseExpression;
var expr;
function globalThis() {
if (!expr)
expr = parseExpression($__0);
return expr;
}
var $__default = globalThis;
return {get default() {
return $__default;
}};
});
System.register("traceur@0.0.74/src/codegeneration/FindInFunctionScope", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/FindInFunctionScope";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/FindInFunctionScope", path);
}
var FindVisitor = System.get("traceur@0.0.74/src/codegeneration/FindVisitor").FindVisitor;
var FindInFunctionScope = function FindInFunctionScope() {
$traceurRuntime.superConstructor($FindInFunctionScope).apply(this, arguments);
};
var $FindInFunctionScope = FindInFunctionScope;
($traceurRuntime.createClass)(FindInFunctionScope, {
visitFunctionDeclaration: function(tree) {},
visitFunctionExpression: function(tree) {},
visitSetAccessor: function(tree) {},
visitGetAccessor: function(tree) {},
visitPropertyMethodAssignment: function(tree) {}
}, {}, FindVisitor);
return {get FindInFunctionScope() {
return FindInFunctionScope;
}};
});
System.register("traceur@0.0.74/src/codegeneration/scopeContainsThis", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/scopeContainsThis";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/scopeContainsThis", path);
}
var FindInFunctionScope = System.get("traceur@0.0.74/src/codegeneration/FindInFunctionScope").FindInFunctionScope;
var FindThis = function FindThis() {
$traceurRuntime.superConstructor($FindThis).apply(this, arguments);
};
var $FindThis = FindThis;
($traceurRuntime.createClass)(FindThis, {visitThisExpression: function(tree) {
this.found = true;
}}, {}, FindInFunctionScope);
function scopeContainsThis(tree) {
var visitor = new FindThis(tree);
return visitor.found;
}
var $__default = scopeContainsThis;
return {get default() {
return $__default;
}};
});
System.register("traceur@0.0.74/src/codegeneration/AmdTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/AmdTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/AmdTransformer", path);
}
var $__0 = Object.freeze(Object.defineProperties(["__esModule: true"], {raw: {value: Object.freeze(["__esModule: true"])}})),
$__1 = Object.freeze(Object.defineProperties(["if (!", " || !", ".__esModule)\n ", " = {default: ", "}"], {raw: {value: Object.freeze(["if (!", " || !", ".__esModule)\n ", " = {default: ", "}"])}})),
$__2 = Object.freeze(Object.defineProperties(["function(", ") {\n ", "\n }"], {raw: {value: Object.freeze(["function(", ") {\n ", "\n }"])}})),
$__3 = Object.freeze(Object.defineProperties(["", ".bind(", ")"], {raw: {value: Object.freeze(["", ".bind(", ")"])}})),
$__4 = Object.freeze(Object.defineProperties(["define(", ", ", ", ", ");"], {raw: {value: Object.freeze(["define(", ", ", ", ", ");"])}})),
$__5 = Object.freeze(Object.defineProperties(["define(", ", ", ");"], {raw: {value: Object.freeze(["define(", ", ", ");"])}}));
var ModuleTransformer = System.get("traceur@0.0.74/src/codegeneration/ModuleTransformer").ModuleTransformer;
var createIdentifierExpression = System.get("traceur@0.0.74/src/codegeneration/ParseTreeFactory").createIdentifierExpression;
var globalThis = System.get("traceur@0.0.74/src/codegeneration/globalThis").default;
var $__9 = System.get("traceur@0.0.74/src/codegeneration/PlaceholderParser"),
parseExpression = $__9.parseExpression,
parseStatement = $__9.parseStatement,
parseStatements = $__9.parseStatements,
parsePropertyDefinition = $__9.parsePropertyDefinition;
var scopeContainsThis = System.get("traceur@0.0.74/src/codegeneration/scopeContainsThis").default;
var AmdTransformer = function AmdTransformer(identifierGenerator) {
$traceurRuntime.superConstructor($AmdTransformer).call(this, identifierGenerator);
this.dependencies = [];
};
var $AmdTransformer = AmdTransformer;
($traceurRuntime.createClass)(AmdTransformer, {
getExportProperties: function() {
var properties = $traceurRuntime.superGet(this, $AmdTransformer.prototype, "getExportProperties").call(this);
if (this.exportVisitor_.hasExports())
properties.push(parsePropertyDefinition($__0));
return properties;
},
moduleProlog: function() {
var locals = this.dependencies.map((function(dep) {
var local = createIdentifierExpression(dep.local);
return parseStatement($__1, local, local, local, local);
}));
return $traceurRuntime.superGet(this, $AmdTransformer.prototype, "moduleProlog").call(this).concat(locals);
},
wrapModule: function(statements) {
var depPaths = this.dependencies.map((function(dep) {
return dep.path;
}));
var depLocals = this.dependencies.map((function(dep) {
return dep.local;
}));
var hasTopLevelThis = statements.some(scopeContainsThis);
var func = parseExpression($__2, depLocals, statements);
if (hasTopLevelThis)
func = parseExpression($__3, func, globalThis());
if (this.moduleName) {
return parseStatements($__4, this.moduleName, depPaths, func);
} else {
return parseStatements($__5, depPaths, func);
}
},
transformModuleSpecifier: function(tree) {
var localName = this.getTempIdentifier();
this.dependencies.push({
path: tree.token,
local: localName
});
return createIdentifierExpression(localName);
}
}, {}, ModuleTransformer);
return {get AmdTransformer() {
return AmdTransformer;
}};
});
System.register("traceur@0.0.74/src/staticsemantics/PropName", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/staticsemantics/PropName";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/staticsemantics/PropName", path);
}
var $__0 = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType"),
COMPUTED_PROPERTY_NAME = $__0.COMPUTED_PROPERTY_NAME,
GET_ACCESSOR = $__0.GET_ACCESSOR,
LITERAL_PROPERTY_NAME = $__0.LITERAL_PROPERTY_NAME,
PROPERTY_METHOD_ASSIGNMENT = $__0.PROPERTY_METHOD_ASSIGNMENT,
PROPERTY_NAME_ASSIGNMENT = $__0.PROPERTY_NAME_ASSIGNMENT,
PROPERTY_NAME_SHORTHAND = $__0.PROPERTY_NAME_SHORTHAND,
SET_ACCESSOR = $__0.SET_ACCESSOR;
var IDENTIFIER = System.get("traceur@0.0.74/src/syntax/TokenType").IDENTIFIER;
function propName(tree) {
switch (tree.type) {
case LITERAL_PROPERTY_NAME:
var token = tree.literalToken;
if (token.isKeyword() || token.type === IDENTIFIER)
return token.toString();
return String(tree.literalToken.processedValue);
case COMPUTED_PROPERTY_NAME:
return '';
case PROPERTY_NAME_SHORTHAND:
return tree.name.toString();
case PROPERTY_METHOD_ASSIGNMENT:
case PROPERTY_NAME_ASSIGNMENT:
case GET_ACCESSOR:
case SET_ACCESSOR:
return propName(tree.name);
}
}
return {get propName() {
return propName;
}};
});
System.register("traceur@0.0.74/src/codegeneration/AnnotationsTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/AnnotationsTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/AnnotationsTransformer", path);
}
var $__0 = Object.freeze(Object.defineProperties(["Object.getOwnPropertyDescriptor(", ")"], {raw: {value: Object.freeze(["Object.getOwnPropertyDescriptor(", ")"])}})),
$__1 = Object.freeze(Object.defineProperties(["Object.defineProperty(", ", ", ",\n {get: function() {return ", "}});"], {raw: {value: Object.freeze(["Object.defineProperty(", ", ", ",\n {get: function() {return ", "}});"])}}));
var ParseTreeTransformer = System.get("traceur@0.0.74/src/codegeneration/ParseTreeTransformer").ParseTreeTransformer;
var CONSTRUCTOR = System.get("traceur@0.0.74/src/syntax/PredefinedName").CONSTRUCTOR;
var STRING = System.get("traceur@0.0.74/src/syntax/TokenType").STRING;
var $__5 = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees"),
AnonBlock = $__5.AnonBlock,
ClassDeclaration = $__5.ClassDeclaration,
ExportDeclaration = $__5.ExportDeclaration,
FormalParameter = $__5.FormalParameter,
FunctionDeclaration = $__5.FunctionDeclaration,
GetAccessor = $__5.GetAccessor,
LiteralExpression = $__5.LiteralExpression,
PropertyMethodAssignment = $__5.PropertyMethodAssignment,
SetAccessor = $__5.SetAccessor;
var propName = System.get("traceur@0.0.74/src/staticsemantics/PropName").propName;
var $__7 = System.get("traceur@0.0.74/src/codegeneration/ParseTreeFactory"),
createArgumentList = $__7.createArgumentList,
createArrayLiteralExpression = $__7.createArrayLiteralExpression,
createAssignmentStatement = $__7.createAssignmentStatement,
createIdentifierExpression = $__7.createIdentifierExpression,
createMemberExpression = $__7.createMemberExpression,
createNewExpression = $__7.createNewExpression,
createStringLiteralToken = $__7.createStringLiteralToken;
var $__8 = System.get("traceur@0.0.74/src/codegeneration/PlaceholderParser"),
parseExpression = $__8.parseExpression,
parseStatement = $__8.parseStatement;
var AnnotationsScope = function AnnotationsScope() {
this.className = null;
this.isExport = false;
this.constructorParameters = [];
this.annotations = [];
this.metadata = [];
};
($traceurRuntime.createClass)(AnnotationsScope, {get inClassScope() {
return this.className !== null;
}}, {});
var AnnotationsTransformer = function AnnotationsTransformer() {
this.stack_ = [new AnnotationsScope()];
};
var $AnnotationsTransformer = AnnotationsTransformer;
($traceurRuntime.createClass)(AnnotationsTransformer, {
transformExportDeclaration: function(tree) {
var $__11;
var scope = this.pushAnnotationScope_();
scope.isExport = true;
($__11 = scope.annotations).push.apply($__11, $traceurRuntime.spread(tree.annotations));
var declaration = this.transformAny(tree.declaration);
if (declaration !== tree.declaration || tree.annotations.length > 0)
tree = new ExportDeclaration(tree.location, declaration, []);
return this.appendMetadata_(tree);
},
transformClassDeclaration: function(tree) {
var $__11,
$__12;
var elementsChanged = false;
var exportAnnotations = this.scope.isExport ? this.scope.annotations : [];
var scope = this.pushAnnotationScope_();
scope.className = tree.name;
($__11 = scope.annotations).push.apply($__11, $traceurRuntime.spread(exportAnnotations, tree.annotations));
tree = $traceurRuntime.superGet(this, $AnnotationsTransformer.prototype, "transformClassDeclaration").call(this, tree);
($__12 = scope.metadata).unshift.apply($__12, $traceurRuntime.spread(this.transformMetadata_(createIdentifierExpression(tree.name), scope.annotations, scope.constructorParameters)));
if (tree.annotations.length > 0) {
tree = new ClassDeclaration(tree.location, tree.name, tree.superClass, tree.elements, []);
}
return this.appendMetadata_(tree);
},
transformFunctionDeclaration: function(tree) {
var $__11,
$__12;
var exportAnnotations = this.scope.isExport ? this.scope.annotations : [];
var scope = this.pushAnnotationScope_();
($__11 = scope.annotations).push.apply($__11, $traceurRuntime.spread(exportAnnotations, tree.annotations));
($__12 = scope.metadata).push.apply($__12, $traceurRuntime.spread(this.transformMetadata_(createIdentifierExpression(tree.name), scope.annotations, tree.parameterList.parameters)));
tree = $traceurRuntime.superGet(this, $AnnotationsTransformer.prototype, "transformFunctionDeclaration").call(this, tree);
if (tree.annotations.length > 0) {
tree = new FunctionDeclaration(tree.location, tree.name, tree.functionKind, tree.parameterList, tree.typeAnnotation, [], tree.body);
}
return this.appendMetadata_(tree);
},
transformFormalParameter: function(tree) {
if (tree.annotations.length > 0) {
tree = new FormalParameter(tree.location, tree.parameter, tree.typeAnnotation, []);
}
return $traceurRuntime.superGet(this, $AnnotationsTransformer.prototype, "transformFormalParameter").call(this, tree);
},
transformGetAccessor: function(tree) {
var $__11;
if (!this.scope.inClassScope)
return $traceurRuntime.superGet(this, $AnnotationsTransformer.prototype, "transformGetAccessor").call(this, tree);
($__11 = this.scope.metadata).push.apply($__11, $traceurRuntime.spread(this.transformMetadata_(this.transformAccessor_(tree, this.scope.className, 'get'), tree.annotations, [])));
if (tree.annotations.length > 0) {
tree = new GetAccessor(tree.location, tree.isStatic, tree.name, tree.typeAnnotation, [], tree.body);
}
return $traceurRuntime.superGet(this, $AnnotationsTransformer.prototype, "transformGetAccessor").call(this, tree);
},
transformSetAccessor: function(tree) {
var $__11;
if (!this.scope.inClassScope)
return $traceurRuntime.superGet(this, $AnnotationsTransformer.prototype, "transformSetAccessor").call(this, tree);
($__11 = this.scope.metadata).push.apply($__11, $traceurRuntime.spread(this.transformMetadata_(this.transformAccessor_(tree, this.scope.className, 'set'), tree.annotations, tree.parameterList.parameters)));
var parameterList = this.transformAny(tree.parameterList);
if (parameterList !== tree.parameterList || tree.annotations.length > 0) {
tree = new SetAccessor(tree.location, tree.isStatic, tree.name, parameterList, [], tree.body);
}
return $traceurRuntime.superGet(this, $AnnotationsTransformer.prototype, "transformSetAccessor").call(this, tree);
},
transformPropertyMethodAssignment: function(tree) {
var $__11,
$__12;
if (!this.scope.inClassScope)
return $traceurRuntime.superGet(this, $AnnotationsTransformer.prototype, "transformPropertyMethodAssignment").call(this, tree);
if (!tree.isStatic && propName(tree) === CONSTRUCTOR) {
($__11 = this.scope.annotations).push.apply($__11, $traceurRuntime.spread(tree.annotations));
this.scope.constructorParameters = tree.parameterList.parameters;
} else {
($__12 = this.scope.metadata).push.apply($__12, $traceurRuntime.spread(this.transformMetadata_(this.transformPropertyMethod_(tree, this.scope.className), tree.annotations, tree.parameterList.parameters)));
}
var parameterList = this.transformAny(tree.parameterList);
if (parameterList !== tree.parameterList || tree.annotations.length > 0) {
tree = new PropertyMethodAssignment(tree.location, tree.isStatic, tree.functionKind, tree.name, parameterList, tree.typeAnnotation, [], tree.body);
}
return $traceurRuntime.superGet(this, $AnnotationsTransformer.prototype, "transformPropertyMethodAssignment").call(this, tree);
},
appendMetadata_: function(tree) {
var $__11;
var metadata = this.stack_.pop().metadata;
if (metadata.length > 0) {
if (this.scope.isExport) {
($__11 = this.scope.metadata).push.apply($__11, $traceurRuntime.spread(metadata));
} else {
tree = new AnonBlock(null, $traceurRuntime.spread([tree], metadata));
}
}
return tree;
},
transformClassReference_: function(tree, className) {
var parent = createIdentifierExpression(className);
if (!tree.isStatic)
parent = createMemberExpression(parent, 'prototype');
return parent;
},
transformPropertyMethod_: function(tree, className) {
return createMemberExpression(this.transformClassReference_(tree, className), tree.name.literalToken);
},
transformAccessor_: function(tree, className, accessor) {
var args = createArgumentList([this.transformClassReference_(tree, className), this.createLiteralStringExpression_(tree.name)]);
var descriptor = parseExpression($__0, args);
return createMemberExpression(descriptor, accessor);
},
transformParameters_: function(parameters) {
var $__9 = this;
var hasParameterMetadata = false;
parameters = parameters.map((function(param) {
var $__11;
var metadata = [];
if (param.typeAnnotation)
metadata.push($__9.transformAny(param.typeAnnotation));
if (param.annotations && param.annotations.length > 0)
($__11 = metadata).push.apply($__11, $traceurRuntime.spread($__9.transformAnnotations_(param.annotations)));
if (metadata.length > 0) {
hasParameterMetadata = true;
return createArrayLiteralExpression(metadata);
}
return createArrayLiteralExpression([]);
}));
return hasParameterMetadata ? parameters : [];
},
transformAnnotations_: function(annotations) {
return annotations.map((function(annotation) {
return createNewExpression(annotation.name, annotation.args);
}));
},
transformMetadata_: function(target, annotations, parameters) {
var metadataStatements = [];
if (annotations !== null) {
annotations = this.transformAnnotations_(annotations);
if (annotations.length > 0) {
metadataStatements.push(this.createDefinePropertyStatement_(target, 'annotations', createArrayLiteralExpression(annotations)));
}
}
if (parameters !== null) {
parameters = this.transformParameters_(parameters);
if (parameters.length > 0) {
metadataStatements.push(this.createDefinePropertyStatement_(target, 'parameters', createArrayLiteralExpression(parameters)));
}
}
return metadataStatements;
},
createDefinePropertyStatement_: function(target, property, value) {
return parseStatement($__1, target, property, value);
},
createLiteralStringExpression_: function(tree) {
var token = tree.literalToken;
if (tree.literalToken.type !== STRING)
token = createStringLiteralToken(tree.literalToken.value);
return new LiteralExpression(null, token);
},
get scope() {
return this.stack_[this.stack_.length - 1];
},
pushAnnotationScope_: function() {
var scope = new AnnotationsScope();
this.stack_.push(scope);
return scope;
}
}, {}, ParseTreeTransformer);
return {get AnnotationsTransformer() {
return AnnotationsTransformer;
}};
});
System.register("traceur@0.0.74/src/semantics/VariableBinder", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/semantics/VariableBinder";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/semantics/VariableBinder", path);
}
var ScopeChainBuilder = System.get("traceur@0.0.74/src/semantics/ScopeChainBuilder").ScopeChainBuilder;
function variablesInBlock(tree) {
var includeFunctionScope = arguments[1];
var builder = new ScopeChainBuilder(null);
builder.visitAny(tree);
var scope = builder.getScopeForTree(tree);
var names = scope.getLexicalBindingNames();
if (!includeFunctionScope) {
return names;
}
var variableBindingNames = scope.getVariableBindingNames();
for (var name in variableBindingNames) {
names[name] = true;
}
return names;
}
function variablesInFunction(tree) {
var builder = new ScopeChainBuilder(null);
builder.visitAny(tree);
var scope = builder.getScopeForTree(tree);
return scope.getAllBindingNames();
}
return {
get variablesInBlock() {
return variablesInBlock;
},
get variablesInFunction() {
return variablesInFunction;
}
};
});
System.register("traceur@0.0.74/src/codegeneration/ScopeTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/ScopeTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/ScopeTransformer", path);
}
var ParseTreeTransformer = System.get("traceur@0.0.74/src/codegeneration/ParseTreeTransformer").ParseTreeTransformer;
var $__1 = System.get("traceur@0.0.74/src/syntax/PredefinedName"),
ARGUMENTS = $__1.ARGUMENTS,
THIS = $__1.THIS;
var $__2 = System.get("traceur@0.0.74/src/semantics/VariableBinder"),
variablesInBlock = $__2.variablesInBlock,
variablesInFunction = $__2.variablesInFunction;
var ScopeTransformer = function ScopeTransformer(varName) {
$traceurRuntime.superConstructor($ScopeTransformer).call(this);
this.varName_ = varName;
};
var $ScopeTransformer = ScopeTransformer;
($traceurRuntime.createClass)(ScopeTransformer, {
transformBlock: function(tree) {
if (this.varName_ in variablesInBlock(tree)) {
return tree;
} else {
return $traceurRuntime.superGet(this, $ScopeTransformer.prototype, "transformBlock").call(this, tree);
}
},
transformThisExpression: function(tree) {
if (this.varName_ !== THIS)
return tree;
return $traceurRuntime.superGet(this, $ScopeTransformer.prototype, "transformThisExpression").call(this, tree);
},
transformFunctionDeclaration: function(tree) {
if (this.getDoNotRecurse(tree))
return tree;
return $traceurRuntime.superGet(this, $ScopeTransformer.prototype, "transformFunctionDeclaration").call(this, tree);
},
transformFunctionExpression: function(tree) {
if (this.getDoNotRecurse(tree))
return tree;
return $traceurRuntime.superGet(this, $ScopeTransformer.prototype, "transformFunctionExpression").call(this, tree);
},
getDoNotRecurse: function(tree) {
return this.varName_ === ARGUMENTS || this.varName_ === THIS || this.varName_ in variablesInFunction(tree);
},
transformCatch: function(tree) {
if (!tree.binding.isPattern() && this.varName_ === tree.binding.identifierToken.value) {
return tree;
}
return $traceurRuntime.superGet(this, $ScopeTransformer.prototype, "transformCatch").call(this, tree);
}
}, {}, ParseTreeTransformer);
return {get ScopeTransformer() {
return ScopeTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/AlphaRenamer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/AlphaRenamer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/AlphaRenamer", path);
}
var ScopeTransformer = System.get("traceur@0.0.74/src/codegeneration/ScopeTransformer").ScopeTransformer;
var $__1 = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees"),
FunctionDeclaration = $__1.FunctionDeclaration,
FunctionExpression = $__1.FunctionExpression;
var THIS = System.get("traceur@0.0.74/src/syntax/PredefinedName").THIS;
var createIdentifierExpression = System.get("traceur@0.0.74/src/codegeneration/ParseTreeFactory").createIdentifierExpression;
var AlphaRenamer = function AlphaRenamer(varName, newName) {
$traceurRuntime.superConstructor($AlphaRenamer).call(this, varName);
this.newName_ = newName;
};
var $AlphaRenamer = AlphaRenamer;
($traceurRuntime.createClass)(AlphaRenamer, {
transformIdentifierExpression: function(tree) {
if (this.varName_ == tree.identifierToken.value) {
return createIdentifierExpression(this.newName_);
} else {
return tree;
}
},
transformThisExpression: function(tree) {
if (this.varName_ !== THIS)
return tree;
return createIdentifierExpression(this.newName_);
},
transformFunctionDeclaration: function(tree) {
if (this.varName_ === tree.name) {
tree = new FunctionDeclaration(tree.location, this.newName_, tree.functionKind, tree.parameterList, tree.typeAnnotation, tree.annotations, tree.body);
}
return $traceurRuntime.superGet(this, $AlphaRenamer.prototype, "transformFunctionDeclaration").call(this, tree);
},
transformFunctionExpression: function(tree) {
if (this.varName_ === tree.name) {
tree = new FunctionExpression(tree.location, this.newName_, tree.functionKind, tree.parameterList, tree.typeAnnotation, tree.annotations, tree.body);
}
return $traceurRuntime.superGet(this, $AlphaRenamer.prototype, "transformFunctionExpression").call(this, tree);
}
}, {rename: function(tree, varName, newName) {
return new $AlphaRenamer(varName, newName).transformAny(tree);
}}, ScopeTransformer);
return {get AlphaRenamer() {
return AlphaRenamer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/alphaRenameThisAndArguments", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/alphaRenameThisAndArguments";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/alphaRenameThisAndArguments", path);
}
var $__0 = System.get("traceur@0.0.74/src/syntax/PredefinedName"),
ARGUMENTS = $__0.ARGUMENTS,
THIS = $__0.THIS;
var AlphaRenamer = System.get("traceur@0.0.74/src/codegeneration/AlphaRenamer").AlphaRenamer;
var FindInFunctionScope = System.get("traceur@0.0.74/src/codegeneration/FindInFunctionScope").FindInFunctionScope;
var FindThisOrArguments = function FindThisOrArguments(tree) {
this.foundThis = false;
this.foundArguments = false;
$traceurRuntime.superConstructor($FindThisOrArguments).call(this, tree);
};
var $FindThisOrArguments = FindThisOrArguments;
($traceurRuntime.createClass)(FindThisOrArguments, {
visitThisExpression: function(tree) {
this.foundThis = true;
this.found = this.foundArguments;
},
visitIdentifierExpression: function(tree) {
if (tree.identifierToken.value === ARGUMENTS) {
this.foundArguments = true;
this.found = this.foundThis;
}
}
}, {}, FindInFunctionScope);
function alphaRenameThisAndArguments(tempVarTransformer, tree) {
var finder = new FindThisOrArguments(tree);
if (finder.foundArguments) {
var argumentsTempName = tempVarTransformer.addTempVarForArguments();
tree = AlphaRenamer.rename(tree, ARGUMENTS, argumentsTempName);
}
if (finder.foundThis) {
var thisTempName = tempVarTransformer.addTempVarForThis();
tree = AlphaRenamer.rename(tree, THIS, thisTempName);
}
return tree;
}
var $__default = alphaRenameThisAndArguments;
return {get default() {
return $__default;
}};
});
System.register("traceur@0.0.74/src/codegeneration/ComprehensionTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/ComprehensionTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/ComprehensionTransformer", path);
}
var alphaRenameThisAndArguments = System.get("traceur@0.0.74/src/codegeneration/alphaRenameThisAndArguments").default;
var FunctionExpression = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees").FunctionExpression;
var TempVarTransformer = System.get("traceur@0.0.74/src/codegeneration/TempVarTransformer").TempVarTransformer;
var $__3 = System.get("traceur@0.0.74/src/syntax/TokenType"),
LET = $__3.LET,
STAR = $__3.STAR,
VAR = $__3.VAR;
var $__4 = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType"),
COMPREHENSION_FOR = $__4.COMPREHENSION_FOR,
COMPREHENSION_IF = $__4.COMPREHENSION_IF;
var Token = System.get("traceur@0.0.74/src/syntax/Token").Token;
var $__6 = System.get("traceur@0.0.74/src/codegeneration/ParseTreeFactory"),
createCallExpression = $__6.createCallExpression,
createEmptyParameterList = $__6.createEmptyParameterList,
createForOfStatement = $__6.createForOfStatement,
createFunctionBody = $__6.createFunctionBody,
createIfStatement = $__6.createIfStatement,
createParenExpression = $__6.createParenExpression,
createVariableDeclarationList = $__6.createVariableDeclarationList;
var options = System.get("traceur@0.0.74/src/Options").options;
var ComprehensionTransformer = function ComprehensionTransformer() {
$traceurRuntime.superConstructor($ComprehensionTransformer).apply(this, arguments);
};
var $ComprehensionTransformer = ComprehensionTransformer;
($traceurRuntime.createClass)(ComprehensionTransformer, {transformComprehension: function(tree, statement, isGenerator) {
var prefix = arguments[3];
var suffix = arguments[4];
var bindingKind = isGenerator || !options.blockBinding ? VAR : LET;
var statements = prefix ? [prefix] : [];
for (var i = tree.comprehensionList.length - 1; i >= 0; i--) {
var item = tree.comprehensionList[i];
switch (item.type) {
case COMPREHENSION_IF:
var expression = this.transformAny(item.expression);
statement = createIfStatement(expression, statement);
break;
case COMPREHENSION_FOR:
var left = this.transformAny(item.left);
var iterator = this.transformAny(item.iterator);
var initializer = createVariableDeclarationList(bindingKind, left, null);
statement = createForOfStatement(initializer, iterator, statement);
break;
default:
throw new Error('Unreachable.');
}
}
statement = alphaRenameThisAndArguments(this, statement);
statements.push(statement);
if (suffix)
statements.push(suffix);
var functionKind = isGenerator ? new Token(STAR, null) : null;
var func = new FunctionExpression(null, null, functionKind, createEmptyParameterList(), null, [], createFunctionBody(statements));
return createParenExpression(createCallExpression(func));
}}, {}, TempVarTransformer);
return {get ComprehensionTransformer() {
return ComprehensionTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/ArrayComprehensionTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/ArrayComprehensionTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/ArrayComprehensionTransformer", path);
}
var $__0 = Object.freeze(Object.defineProperties(["var ", " = 0, ", " = [];"], {raw: {value: Object.freeze(["var ", " = 0, ", " = [];"])}})),
$__1 = Object.freeze(Object.defineProperties(["", "[", "++] = ", ";"], {raw: {value: Object.freeze(["", "[", "++] = ", ";"])}})),
$__2 = Object.freeze(Object.defineProperties(["return ", ";"], {raw: {value: Object.freeze(["return ", ";"])}}));
var ComprehensionTransformer = System.get("traceur@0.0.74/src/codegeneration/ComprehensionTransformer").ComprehensionTransformer;
var createIdentifierExpression = System.get("traceur@0.0.74/src/codegeneration/ParseTreeFactory").createIdentifierExpression;
var parseStatement = System.get("traceur@0.0.74/src/codegeneration/PlaceholderParser").parseStatement;
var ArrayComprehensionTransformer = function ArrayComprehensionTransformer() {
$traceurRuntime.superConstructor($ArrayComprehensionTransformer).apply(this, arguments);
};
var $ArrayComprehensionTransformer = ArrayComprehensionTransformer;
($traceurRuntime.createClass)(ArrayComprehensionTransformer, {transformArrayComprehension: function(tree) {
this.pushTempScope();
var expression = this.transformAny(tree.expression);
var index = createIdentifierExpression(this.getTempIdentifier());
var result = createIdentifierExpression(this.getTempIdentifier());
var tempVarsStatatement = parseStatement($__0, index, result);
var statement = parseStatement($__1, result, index, expression);
var returnStatement = parseStatement($__2, result);
var functionKind = null;
var result = this.transformComprehension(tree, statement, functionKind, tempVarsStatatement, returnStatement);
this.popTempScope();
return result;
}}, {}, ComprehensionTransformer);
return {get ArrayComprehensionTransformer() {
return ArrayComprehensionTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/ArrowFunctionTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/ArrowFunctionTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/ArrowFunctionTransformer", path);
}
var FunctionExpression = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees").FunctionExpression;
var TempVarTransformer = System.get("traceur@0.0.74/src/codegeneration/TempVarTransformer").TempVarTransformer;
var FUNCTION_BODY = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType").FUNCTION_BODY;
var alphaRenameThisAndArguments = System.get("traceur@0.0.74/src/codegeneration/alphaRenameThisAndArguments").default;
var $__4 = System.get("traceur@0.0.74/src/codegeneration/ParseTreeFactory"),
createFunctionBody = $__4.createFunctionBody,
createParenExpression = $__4.createParenExpression,
createReturnStatement = $__4.createReturnStatement;
function convertConciseBody(tree) {
if (tree.type !== FUNCTION_BODY)
return createFunctionBody([createReturnStatement(tree)]);
return tree;
}
var ArrowFunctionTransformer = function ArrowFunctionTransformer() {
$traceurRuntime.superConstructor($ArrowFunctionTransformer).apply(this, arguments);
};
var $ArrowFunctionTransformer = ArrowFunctionTransformer;
($traceurRuntime.createClass)(ArrowFunctionTransformer, {transformArrowFunctionExpression: function(tree) {
var alphaRenamed = alphaRenameThisAndArguments(this, tree);
var parameterList = this.transformAny(alphaRenamed.parameterList);
var body = this.transformAny(alphaRenamed.body);
body = convertConciseBody(body);
var functionExpression = new FunctionExpression(tree.location, null, tree.functionKind, parameterList, null, [], body);
return createParenExpression(functionExpression);
}}, {transform: function(tempVarTransformer, tree) {
tree = alphaRenameThisAndArguments(tempVarTransformer, tree);
var body = convertConciseBody(tree.body);
return new FunctionExpression(tree.location, null, tree.functionKind, tree.parameterList, null, [], body);
}}, TempVarTransformer);
return {get ArrowFunctionTransformer() {
return ArrowFunctionTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/FindIdentifiers", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/FindIdentifiers";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/FindIdentifiers", path);
}
var ScopeVisitor = System.get("traceur@0.0.74/src/semantics/ScopeVisitor").ScopeVisitor;
var FindIdentifiers = function FindIdentifiers(tree, filterFunction) {
$traceurRuntime.superConstructor($FindIdentifiers).call(this);
this.filterFunction_ = filterFunction;
this.found_ = false;
this.visitAny(tree);
};
var $FindIdentifiers = FindIdentifiers;
($traceurRuntime.createClass)(FindIdentifiers, {
visitIdentifierExpression: function(tree) {
if (this.filterFunction_(tree.identifierToken.value, this.scope.tree)) {
this.found = true;
}
},
get found() {
return this.found_;
},
set found(v) {
if (v) {
this.found_ = true;
}
},
visitAny: function(tree) {
!this.found_ && tree && tree.visit(this);
},
visitList: function(list) {
if (list) {
for (var i = 0; !this.found_ && i < list.length; i++) {
this.visitAny(list[i]);
}
}
}
}, {}, ScopeVisitor);
return {get FindIdentifiers() {
return FindIdentifiers;
}};
});
System.register("traceur@0.0.74/src/codegeneration/FnExtractAbruptCompletions", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/FnExtractAbruptCompletions";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/FnExtractAbruptCompletions", path);
}
var $__0 = Object.freeze(Object.defineProperties(["if (typeof ", " === \"object\")\n return ", ".v;"], {raw: {value: Object.freeze(["if (typeof ", " === \"object\")\n return ", ".v;"])}})),
$__1 = Object.freeze(Object.defineProperties(["return ", ";"], {raw: {value: Object.freeze(["return ", ";"])}}));
var ParseTreeTransformer = System.get("traceur@0.0.74/src/codegeneration/ParseTreeTransformer").ParseTreeTransformer;
var alphaRenameThisAndArguments = System.get("traceur@0.0.74/src/codegeneration/alphaRenameThisAndArguments").default;
var parseStatement = System.get("traceur@0.0.74/src/codegeneration/PlaceholderParser").parseStatement;
var $__5 = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees"),
AnonBlock = $__5.AnonBlock,
BreakStatement = $__5.BreakStatement,
ContinueStatement = $__5.ContinueStatement,
FormalParameterList = $__5.FormalParameterList,
ReturnStatement = $__5.ReturnStatement;
var $__6 = System.get("traceur@0.0.74/src/codegeneration/ParseTreeFactory"),
createArgumentList = $__6.createArgumentList,
createAssignmentStatement = $__6.createAssignmentStatement,
createAssignmentExpression = $__6.createAssignmentExpression,
createBlock = $__6.createBlock,
createCallExpression = $__6.createCallExpression,
createCaseClause = $__6.createCaseClause,
createDefaultClause = $__6.createDefaultClause,
createExpressionStatement = $__6.createExpressionStatement,
createFunctionBody = $__6.createFunctionBody,
createFunctionExpression = $__6.createFunctionExpression,
createIdentifierExpression = $__6.createIdentifierExpression,
createNumberLiteral = $__6.createNumberLiteral,
createObjectLiteral = $__6.createObjectLiteral,
createSwitchStatement = $__6.createSwitchStatement,
createThisExpression = $__6.createThisExpression,
createVariableDeclaration = $__6.createVariableDeclaration,
createVariableDeclarationList = $__6.createVariableDeclarationList,
createVariableStatement = $__6.createVariableStatement,
createVoid0 = $__6.createVoid0;
var ARGUMENTS = System.get("traceur@0.0.74/src/syntax/PredefinedName").ARGUMENTS;
var VAR = System.get("traceur@0.0.74/src/syntax/TokenType").VAR;
var FnExtractAbruptCompletions = function FnExtractAbruptCompletions(idGenerator, requestParentLabel) {
this.idGenerator_ = idGenerator;
this.inLoop_ = 0;
this.inBreakble_ = 0;
this.variableDeclarations_ = [];
this.extractedStatements_ = [];
this.requestParentLabel_ = requestParentLabel;
this.labelledStatements_ = {};
};
var $FnExtractAbruptCompletions = FnExtractAbruptCompletions;
($traceurRuntime.createClass)(FnExtractAbruptCompletions, {
createIIFE: function(body, paramList, argsList) {
body = this.transformAny(body);
body = alphaRenameThisAndArguments(this, body);
var tmpFnName = this.idGenerator_.generateUniqueIdentifier();
var functionExpression = createFunctionExpression(new FormalParameterList(null, paramList), createFunctionBody(body.statements || [body]));
this.variableDeclarations_.push(createVariableDeclaration(tmpFnName, functionExpression));
var functionCall = createCallExpression(createIdentifierExpression(tmpFnName), createArgumentList(argsList));
var loopBody = null;
if (this.extractedStatements_.length || this.hasReturns) {
var tmpVarName = createIdentifierExpression(this.idGenerator_.generateUniqueIdentifier());
this.variableDeclarations_.push(createVariableDeclaration(tmpVarName, null));
var maybeReturn;
if (this.hasReturns) {
maybeReturn = parseStatement($__0, tmpVarName, tmpVarName);
}
if (this.extractedStatements_.length) {
var caseClauses = this.extractedStatements_.map((function(statement, index) {
return createCaseClause(createNumberLiteral(index), [statement]);
}));
if (maybeReturn) {
caseClauses.push(createDefaultClause([maybeReturn]));
}
loopBody = createBlock([createExpressionStatement(createAssignmentExpression(tmpVarName, functionCall)), createSwitchStatement(tmpVarName, caseClauses)]);
} else {
loopBody = createBlock([createExpressionStatement(createAssignmentExpression(tmpVarName, functionCall)), maybeReturn]);
}
} else {
loopBody = createBlock([createExpressionStatement(functionCall)]);
}
return {
variableStatements: createVariableStatement(createVariableDeclarationList(VAR, this.variableDeclarations_)),
loopBody: loopBody
};
},
addTempVarForArguments: function() {
var tmpVarName = this.idGenerator_.generateUniqueIdentifier();
this.variableDeclarations_.push(createVariableDeclaration(tmpVarName, createIdentifierExpression(ARGUMENTS)));
return tmpVarName;
},
addTempVarForThis: function() {
var tmpVarName = this.idGenerator_.generateUniqueIdentifier();
this.variableDeclarations_.push(createVariableDeclaration(tmpVarName, createThisExpression()));
return tmpVarName;
},
transformAny: function(tree) {
if (tree) {
if (tree.isBreakableStatement())
this.inBreakble_++;
if (tree.isIterationStatement())
this.inLoop_++;
tree = $traceurRuntime.superGet(this, $FnExtractAbruptCompletions.prototype, "transformAny").call(this, tree);
if (tree.isBreakableStatement())
this.inBreakble_--;
if (tree.isIterationStatement())
this.inLoop_--;
}
return tree;
},
transformReturnStatement: function(tree) {
this.hasReturns = true;
return new ReturnStatement(tree.location, createObjectLiteral({v: tree.expression || createVoid0()}));
},
transformAbruptCompletion_: function(tree) {
this.extractedStatements_.push(tree);
var index = this.extractedStatements_.length - 1;
return parseStatement($__1, index);
},
transformBreakStatement: function(tree) {
if (!tree.name) {
if (this.inBreakble_) {
return $traceurRuntime.superGet(this, $FnExtractAbruptCompletions.prototype, "transformBreakStatement").call(this, tree);
} else {
tree = new BreakStatement(tree.location, this.requestParentLabel_());
}
} else if (this.labelledStatements_[tree.name]) {
return $traceurRuntime.superGet(this, $FnExtractAbruptCompletions.prototype, "transformBreakStatement").call(this, tree);
}
return this.transformAbruptCompletion_(tree);
},
transformContinueStatement: function(tree) {
if (!tree.name) {
if (this.inLoop_) {
return $traceurRuntime.superGet(this, $FnExtractAbruptCompletions.prototype, "transformContinueStatement").call(this, tree);
} else {
tree = new ContinueStatement(tree.location, this.requestParentLabel_());
}
} else if (this.labelledStatements_[tree.name]) {
return $traceurRuntime.superGet(this, $FnExtractAbruptCompletions.prototype, "transformContinueStatement").call(this, tree);
}
return this.transformAbruptCompletion_(tree);
},
transformLabelledStatement: function(tree) {
this.labelledStatements_[tree.name] = true;
return $traceurRuntime.superGet(this, $FnExtractAbruptCompletions.prototype, "transformLabelledStatement").call(this, tree);
},
transformVariableStatement: function(tree) {
var $__10 = this;
var $__9 = this;
if (tree.declarations.declarationType === VAR) {
var assignments = [];
tree.declarations.declarations.forEach((function(variableDeclaration) {
var variableName = variableDeclaration.lvalue.getStringValue();
var initializer = $traceurRuntime.superGet($__10, $FnExtractAbruptCompletions.prototype, "transformAny").call($__10, variableDeclaration.initializer);
$__9.variableDeclarations_.push(createVariableDeclaration(variableName, null));
assignments.push(createAssignmentStatement(createIdentifierExpression(variableName), initializer));
}));
return new AnonBlock(null, assignments);
}
return $traceurRuntime.superGet(this, $FnExtractAbruptCompletions.prototype, "transformVariableStatement").call(this, tree);
},
transformFunctionDeclaration: function(tree) {
return tree;
},
transformFunctionExpression: function(tree) {
return tree;
},
transformSetAccessor: function(tree) {
return tree;
},
transformGetAccessor: function(tree) {
return tree;
},
transformPropertyMethodAssignment: function(tree) {
return tree;
},
transformArrowFunctionExpression: function(tree) {
return tree;
}
}, {createIIFE: function(idGenerator, body, paramList, argsList, requestParentLabel) {
return new $FnExtractAbruptCompletions(idGenerator, requestParentLabel).createIIFE(body, paramList, argsList);
}}, ParseTreeTransformer);
return {get FnExtractAbruptCompletions() {
return FnExtractAbruptCompletions;
}};
});
System.register("traceur@0.0.74/src/codegeneration/BlockBindingTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/BlockBindingTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/BlockBindingTransformer", path);
}
var AlphaRenamer = System.get("traceur@0.0.74/src/codegeneration/AlphaRenamer").AlphaRenamer;
var $__1 = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType"),
ANON_BLOCK = $__1.ANON_BLOCK,
BINDING_IDENTIFIER = $__1.BINDING_IDENTIFIER,
VARIABLE_DECLARATION_LIST = $__1.VARIABLE_DECLARATION_LIST;
var $__2 = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees"),
AnonBlock = $__2.AnonBlock,
BindingElement = $__2.BindingElement,
BindingIdentifier = $__2.BindingIdentifier,
Block = $__2.Block,
Catch = $__2.Catch,
DoWhileStatement = $__2.DoWhileStatement,
ForInStatement = $__2.ForInStatement,
ForStatement = $__2.ForStatement,
FormalParameter = $__2.FormalParameter,
FunctionBody = $__2.FunctionBody,
FunctionExpression = $__2.FunctionExpression,
LabelledStatement = $__2.LabelledStatement,
LiteralPropertyName = $__2.LiteralPropertyName,
Module = $__2.Module,
ObjectPatternField = $__2.ObjectPatternField,
Script = $__2.Script,
VariableDeclaration = $__2.VariableDeclaration,
VariableDeclarationList = $__2.VariableDeclarationList,
VariableStatement = $__2.VariableStatement,
WhileStatement = $__2.WhileStatement;
var ParseTreeTransformer = System.get("traceur@0.0.74/src/codegeneration/ParseTreeTransformer").ParseTreeTransformer;
var VAR = System.get("traceur@0.0.74/src/syntax/TokenType").VAR;
var $__5 = System.get("traceur@0.0.74/src/codegeneration/ParseTreeFactory"),
createBindingIdentifier = $__5.createBindingIdentifier,
createIdentifierExpression = $__5.createIdentifierExpression,
createIdentifierToken = $__5.createIdentifierToken;
var FindIdentifiers = System.get("traceur@0.0.74/src/codegeneration/FindIdentifiers").FindIdentifiers;
var FindVisitor = System.get("traceur@0.0.74/src/codegeneration/FindVisitor").FindVisitor;
var FnExtractAbruptCompletions = System.get("traceur@0.0.74/src/codegeneration/FnExtractAbruptCompletions").FnExtractAbruptCompletions;
var ScopeChainBuilder = System.get("traceur@0.0.74/src/semantics/ScopeChainBuilder").ScopeChainBuilder;
var prependStatements = System.get("traceur@0.0.74/src/codegeneration/PrependStatements").prependStatements;
var BlockBindingTransformer = function BlockBindingTransformer(idGenerator, reporter, tree) {
var scopeBuilder = arguments[3];
var latestScope = arguments[4];
$traceurRuntime.superConstructor($BlockBindingTransformer).call(this);
this.idGenerator_ = idGenerator;
this.reporter_ = reporter;
if (!scopeBuilder) {
scopeBuilder = new ScopeChainBuilder(reporter);
scopeBuilder.visitAny(tree);
}
this.scopeBuilder_ = scopeBuilder;
this.labelledLoops_ = new Map();
this.prependStatement_ = [];
this.prependBlockStatement_ = [];
this.blockRenames_ = [];
this.rootTree_ = tree;
if (latestScope) {
this.scope_ = latestScope;
} else {
this.pushScope(tree);
}
this.usedVars_ = this.scope_.getAllBindingNames();
this.maybeRename_ = false;
this.inObjectPattern_ = false;
};
var $BlockBindingTransformer = BlockBindingTransformer;
($traceurRuntime.createClass)(BlockBindingTransformer, {
getVariableName_: function(variable) {
var lvalue = variable.lvalue;
if (lvalue.type == BINDING_IDENTIFIER) {
return lvalue.getStringValue();
}
throw new Error('Unexpected destructuring declaration found.');
},
flushRenames: function(tree) {
tree = renameAll(this.blockRenames_, tree);
this.blockRenames_.length = 0;
return tree;
},
pushScope: function(tree) {
var scope = this.scopeBuilder_.getScopeForTree(tree);
if (!scope)
throw new Error('BlockBindingTransformer tree with no scope');
if (this.scope_)
this.scope_.blockBindingRenames = this.blockRenames_;
this.scope_ = scope;
this.blockRenames_ = [];
return scope;
},
popScope: function(scope) {
if (this.scope_ != scope) {
throw new Error('BlockBindingTransformer scope mismatch');
}
this.scope_ = scope.parent;
this.blockRenames_ = this.scope_ && this.scope_.blockBindingRenames || [];
},
revisitTreeForScopes: function(tree) {
this.scopeBuilder_.scope = this.scope_;
this.scopeBuilder_.visitAny(tree);
this.scopeBuilder_.scope = null;
},
needsRename_: function(name) {
if (this.usedVars_[name])
return true;
var scope = this.scope_;
var parent = scope.parent;
if (!parent || scope.isVarScope)
return false;
var parentBinding = parent.getBindingByName(name);
if (!parentBinding)
return false;
var currentBinding = scope.getBindingByName(name);
if (currentBinding.tree === parentBinding.tree)
return false;
return true;
},
newNameFromOrig: function(origName, renames) {
var newName;
if (this.needsRename_(origName)) {
newName = origName + this.idGenerator_.generateUniqueIdentifier();
renames.push(new Rename(origName, newName));
} else {
this.usedVars_[origName] = true;
newName = origName;
}
return newName;
},
transformFunctionBody: function(tree) {
if (tree === this.rootTree_ || !this.rootTree_) {
tree = $traceurRuntime.superGet(this, $BlockBindingTransformer.prototype, "transformFunctionBody").call(this, tree);
if (this.prependStatement_.length || this.blockRenames_.length) {
var statements = prependStatements.apply(null, $traceurRuntime.spread([tree.statements], this.prependStatement_));
tree = new FunctionBody(tree.location, statements);
tree = this.flushRenames(tree);
}
} else {
var functionTransform = new $BlockBindingTransformer(this.idGenerator_, this.reporter_, tree, this.scopeBuilder_, this.scope_);
var functionBodyTree = functionTransform.transformAny(tree);
if (functionBodyTree === tree) {
return tree;
}
tree = new FunctionBody(tree.location, functionBodyTree.statements);
}
return tree;
},
transformScript: function(tree) {
if (tree === this.rootTree_ || !this.rootTree_) {
tree = $traceurRuntime.superGet(this, $BlockBindingTransformer.prototype, "transformScript").call(this, tree);
if (this.prependStatement_.length || this.blockRenames_.length) {
var scriptItemList = prependStatements.apply(null, $traceurRuntime.spread([tree.scriptItemList], this.prependStatement_));
tree = new Script(tree.location, scriptItemList, tree.moduleName);
tree = this.flushRenames(tree);
}
} else {
var functionTransform = new $BlockBindingTransformer(this.idGenerator_, this.reporter_, tree, this.scopeBuilder_);
var newTree = functionTransform.transformAny(tree);
if (newTree === tree) {
return tree;
}
tree = new Script(tree.location, newTree.scriptItemList, tree.moduleName);
}
return tree;
},
transformModule: function(tree) {
if (tree === this.rootTree_ || !this.rootTree_) {
tree = $traceurRuntime.superGet(this, $BlockBindingTransformer.prototype, "transformModule").call(this, tree);
if (this.prependStatement_.length || this.blockRenames_.length) {
var scriptItemList = prependStatements.apply(null, $traceurRuntime.spread([tree.scriptItemList], this.prependStatement_));
tree = new Module(tree.location, scriptItemList, tree.moduleName);
tree = this.flushRenames(tree);
}
} else {
var functionTransform = new $BlockBindingTransformer(this.idGenerator_, this.reporter_, tree, this.scopeBuilder_);
var newTree = functionTransform.transformAny(tree);
if (newTree === tree) {
return tree;
}
tree = new Module(tree.location, newTree.scriptItemList, tree.moduleName);
}
return tree;
},
transformVariableStatement: function(tree) {
var declarations = this.transformAny(tree.declarations);
if (declarations.type === ANON_BLOCK) {
return declarations;
}
if (declarations === tree.declarations) {
return tree;
}
return new VariableStatement(tree.location, declarations);
},
transformVariableDeclarationList: function(tree) {
if (tree.declarationType === VAR) {
return $traceurRuntime.superGet(this, $BlockBindingTransformer.prototype, "transformVariableDeclarationList").call(this, tree);
}
this.maybeRename_ = !this.scope_.isVarScope;
var declarations = this.transformList(tree.declarations);
this.maybeRename_ = false;
return new VariableDeclarationList(tree.location, VAR, declarations);
},
transformVariableDeclaration: function(tree) {
var maybeRename = this.maybeRename_;
var lvalue = this.transformAny(tree.lvalue);
this.maybeRename_ = false;
var initializer = this.transformAny(tree.initializer);
this.maybeRename_ = maybeRename;
if (tree.lvalue === lvalue && tree.initializer === initializer) {
return tree;
}
return new VariableDeclaration(tree.location, lvalue, tree.typeAnnotation, initializer);
},
transformBindingIdentifier: function(tree) {
if (this.maybeRename_) {
var origName = tree.getStringValue();
var newName = this.newNameFromOrig(origName, this.blockRenames_);
if (origName === newName) {
return tree;
}
var bindingIdentifier = new BindingIdentifier(tree.location, newName);
this.scope_.renameBinding(origName, bindingIdentifier, VAR, this.reporter_);
return bindingIdentifier;
}
return $traceurRuntime.superGet(this, $BlockBindingTransformer.prototype, "transformBindingIdentifier").call(this, tree);
},
transformBindingElement: function(tree) {
var maybeRename = this.maybeRename_;
var inObjectPattern = this.inObjectPattern_;
var binding = this.transformAny(tree.binding);
this.maybeRename_ = false;
this.inObjectPattern_ = false;
var initializer = this.transformAny(tree.initializer);
this.maybeRename_ = maybeRename;
this.inObjectPattern_ = inObjectPattern;
if (tree.binding === binding && tree.initializer === initializer) {
return tree;
}
var bindingElement = new BindingElement(tree.location, binding, initializer);
if (this.inObjectPattern_ && tree.binding !== binding && tree.binding.type === BINDING_IDENTIFIER) {
return new ObjectPatternField(tree.location, new LiteralPropertyName(tree.location, tree.binding.identifierToken), bindingElement);
}
return bindingElement;
},
transformObjectPattern: function(tree) {
var inObjectPattern = this.inObjectPattern_;
this.inObjectPattern_ = true;
var transformed = $traceurRuntime.superGet(this, $BlockBindingTransformer.prototype, "transformObjectPattern").call(this, tree);
this.inObjectPattern_ = inObjectPattern;
return transformed;
},
transformObjectPatternField: function(tree) {
var name = this.transformAny(tree.name);
this.inObjectPattern_ = false;
var element = this.transformAny(tree.element);
this.inObjectPattern_ = true;
if (tree.name === name && tree.element === element) {
return tree;
}
return new ObjectPatternField(tree.location, name, element);
},
transformBlock: function(tree) {
var scope = this.pushScope(tree);
tree = $traceurRuntime.superGet(this, $BlockBindingTransformer.prototype, "transformBlock").call(this, tree);
if (this.prependBlockStatement_.length) {
tree = new Block(tree.location, prependStatements.apply(null, $traceurRuntime.spread([tree.statements], this.prependBlockStatement_)));
this.prependBlockStatement_ = [];
}
tree = this.flushRenames(tree);
this.popScope(scope);
return tree;
},
transformCatch: function(tree) {
var scope = this.pushScope(tree);
var binding = this.transformAny(tree.binding);
var statements = this.transformList(tree.catchBody.statements);
if (binding !== tree.binding || statements !== tree.catchBody.statements) {
tree = new Catch(tree.location, binding, new Block(tree.catchBody.location, statements));
}
tree = this.flushRenames(tree);
this.popScope(scope);
return tree;
},
transformFunctionForScope_: function(func, tree) {
var scope = this.pushScope(tree);
tree = func();
tree = this.flushRenames(tree);
this.popScope(scope);
return tree;
},
transformGetAccessor: function(tree) {
var $__12 = this;
return this.transformFunctionForScope_((function() {
return $traceurRuntime.superGet($__12, $BlockBindingTransformer.prototype, "transformGetAccessor").call($__12, tree);
}), tree);
},
transformSetAccessor: function(tree) {
var $__12 = this;
return this.transformFunctionForScope_((function() {
return $traceurRuntime.superGet($__12, $BlockBindingTransformer.prototype, "transformSetAccessor").call($__12, tree);
}), tree);
},
transformFunctionExpression: function(tree) {
var $__12 = this;
return this.transformFunctionForScope_((function() {
return $traceurRuntime.superGet($__12, $BlockBindingTransformer.prototype, "transformFunctionExpression").call($__12, tree);
}), tree);
},
transformFunctionDeclaration: function(tree) {
var $__12 = this;
if (!this.scope_.isVarScope) {
var origName = tree.name.getStringValue();
var newName = this.newNameFromOrig(origName, this.blockRenames_);
var functionExpression = new FunctionExpression(tree.location, null, tree.functionKind, tree.parameterList, tree.typeAnnotation, tree.annotations, tree.body);
this.revisitTreeForScopes(functionExpression);
functionExpression = this.transformAny(functionExpression);
var bindingIdentifier = createBindingIdentifier(newName);
var statement = new VariableStatement(tree.location, new VariableDeclarationList(tree.location, VAR, [new VariableDeclaration(tree.location, bindingIdentifier, null, functionExpression)]));
this.scope_.renameBinding(origName, bindingIdentifier, VAR, this.reporter_);
this.prependBlockStatement_.push(statement);
return new AnonBlock(null, []);
}
return this.transformFunctionForScope_((function() {
return $traceurRuntime.superGet($__12, $BlockBindingTransformer.prototype, "transformFunctionDeclaration").call($__12, tree);
}), tree);
},
transformLoop_: function(func, tree, loopFactory) {
var $__11 = this;
var scope,
initializerIsBlockBinding;
if (tree.initializer && tree.initializer.type === VARIABLE_DECLARATION_LIST && tree.initializer.declarationType !== VAR) {
initializerIsBlockBinding = true;
}
if (initializerIsBlockBinding) {
scope = this.pushScope(tree);
}
var finder = new FindBlockBindingInLoop(tree, this.scopeBuilder_);
if (!finder.found) {
if (initializerIsBlockBinding) {
var renames = [];
var initializer = new VariableDeclarationList(null, VAR, tree.initializer.declarations.map((function(declaration) {
var origName = $__11.getVariableName_(declaration);
var newName = $__11.newNameFromOrig(origName, renames);
var bindingIdentifier = createBindingIdentifier(newName);
$__11.scope_.renameBinding(origName, bindingIdentifier, VAR, $__11.reporter_);
return new VariableDeclaration(null, bindingIdentifier, null, declaration.initializer);
})));
initializer = renameAll(renames, initializer);
tree = loopFactory(initializer, renames, renameAll(renames, tree.body));
this.revisitTreeForScopes(tree);
tree = func(tree);
} else {
return func(tree);
}
} else {
var iifeParameterList = [];
var iifeArgumentList = [];
var renames = [];
var initializer = null;
if (tree.initializer && tree.initializer.type === VARIABLE_DECLARATION_LIST && tree.initializer.declarationType !== VAR) {
initializer = new VariableDeclarationList(null, VAR, tree.initializer.declarations.map((function(declaration) {
var origName = $__11.getVariableName_(declaration);
var newName = $__11.newNameFromOrig(origName, renames);
iifeArgumentList.push(createIdentifierExpression(newName));
iifeParameterList.push(new FormalParameter(null, new BindingElement(null, createBindingIdentifier(origName), null), null, []));
var bindingIdentifier = createBindingIdentifier(newName);
$__11.scope_.renameBinding(origName, bindingIdentifier, VAR, $__11.reporter_);
return new VariableDeclaration(null, bindingIdentifier, null, declaration.initializer);
})));
initializer = renameAll(renames, initializer);
} else {
initializer = this.transformAny(tree.initializer);
}
var loopLabel = this.labelledLoops_.get(tree);
var iifeInfo = FnExtractAbruptCompletions.createIIFE(this.idGenerator_, tree.body, iifeParameterList, iifeArgumentList, (function() {
return loopLabel = loopLabel || $__11.idGenerator_.generateUniqueIdentifier();
}));
tree = loopFactory(initializer, renames, iifeInfo.loopBody);
if (loopLabel) {
tree = new LabelledStatement(tree.location, createIdentifierToken(loopLabel), tree);
}
tree = new AnonBlock(tree.location, [iifeInfo.variableStatements, tree]);
this.revisitTreeForScopes(tree);
tree = this.transformAny(tree);
}
if (initializerIsBlockBinding) {
tree = this.flushRenames(tree);
this.popScope(scope);
}
return tree;
},
transformForInStatement: function(tree) {
var $__12 = this;
return this.transformLoop_((function(t) {
return $traceurRuntime.superGet($__12, $BlockBindingTransformer.prototype, "transformForInStatement").call($__12, t);
}), tree, (function(initializer, renames, body) {
return new ForInStatement(tree.location, initializer, renameAll(renames, tree.collection), body);
}));
},
transformForStatement: function(tree) {
var $__12 = this;
return this.transformLoop_((function(t) {
return $traceurRuntime.superGet($__12, $BlockBindingTransformer.prototype, "transformForStatement").call($__12, t);
}), tree, (function(initializer, renames, body) {
return new ForStatement(tree.location, initializer, renameAll(renames, tree.condition), renameAll(renames, tree.increment), body);
}));
},
transformWhileStatement: function(tree) {
var $__12 = this;
return this.transformLoop_((function(t) {
return $traceurRuntime.superGet($__12, $BlockBindingTransformer.prototype, "transformWhileStatement").call($__12, t);
}), tree, (function(initializer, renames, body) {
return new WhileStatement(tree.location, renameAll(renames, tree.condition), body);
}));
},
transformDoWhileStatement: function(tree) {
var $__12 = this;
return this.transformLoop_((function(t) {
return $traceurRuntime.superGet($__12, $BlockBindingTransformer.prototype, "transformDoWhileStatement").call($__12, t);
}), tree, (function(initializer, renames, body) {
return new DoWhileStatement(tree.location, body, renameAll(renames, tree.condition));
}));
},
transformLabelledStatement: function(tree) {
if (tree.statement.isIterationStatement()) {
this.labelledLoops_.set(tree.statement, tree.name.value);
var statement = this.transformAny(tree.statement);
if (!statement.isStatement()) {
return statement;
}
if (statement === tree.statement) {
return tree;
}
return new LabelledStatement(tree.location, tree.name, statement);
}
return $traceurRuntime.superGet(this, $BlockBindingTransformer.prototype, "transformLabelledStatement").call(this, tree);
}
}, {}, ParseTreeTransformer);
var Rename = function Rename(oldName, newName) {
this.oldName = oldName;
this.newName = newName;
};
($traceurRuntime.createClass)(Rename, {}, {});
function renameAll(renames, tree) {
renames.forEach((function(rename) {
tree = AlphaRenamer.rename(tree, rename.oldName, rename.newName);
}));
return tree;
}
var FindBlockBindingInLoop = function FindBlockBindingInLoop(tree, scopeBuilder) {
this.scopeBuilder_ = scopeBuilder;
this.topScope_ = scopeBuilder.getScopeForTree(tree) || scopeBuilder.getScopeForTree(tree.body);
this.outOfScope_ = null;
this.acceptLoop_ = tree.isIterationStatement();
$traceurRuntime.superConstructor($FindBlockBindingInLoop).call(this, tree, false);
};
var $FindBlockBindingInLoop = FindBlockBindingInLoop;
($traceurRuntime.createClass)(FindBlockBindingInLoop, {
visitForInStatement: function(tree) {
var $__12 = this;
this.visitLoop_(tree, (function() {
return $traceurRuntime.superGet($__12, $FindBlockBindingInLoop.prototype, "visitForInStatement").call($__12, tree);
}));
},
visitForStatement: function(tree) {
var $__12 = this;
this.visitLoop_(tree, (function() {
return $traceurRuntime.superGet($__12, $FindBlockBindingInLoop.prototype, "visitForStatement").call($__12, tree);
}));
},
visitWhileStatement: function(tree) {
var $__12 = this;
this.visitLoop_(tree, (function() {
return $traceurRuntime.superGet($__12, $FindBlockBindingInLoop.prototype, "visitWhileStatement").call($__12, tree);
}));
},
visitDoWhileStatement: function(tree) {
var $__12 = this;
this.visitLoop_(tree, (function() {
return $traceurRuntime.superGet($__12, $FindBlockBindingInLoop.prototype, "visitDoWhileStatement").call($__12, tree);
}));
},
visitLoop_: function(tree, func) {
if (this.acceptLoop_) {
this.acceptLoop_ = false;
} else if (!this.outOfScope_) {
this.outOfScope_ = this.scopeBuilder_.getScopeForTree(tree) || this.scopeBuilder_.getScopeForTree(tree.body);
}
func();
},
visitFunctionDeclaration: function(tree) {
this.visitFunction_(tree);
},
visitFunctionExpression: function(tree) {
this.visitFunction_(tree);
},
visitSetAccessor: function(tree) {
this.visitFunction_(tree);
},
visitGetAccessor: function(tree) {
this.visitFunction_(tree);
},
visitPropertyMethodAssignment: function(tree) {
this.visitFunction_(tree);
},
visitArrowFunctionExpression: function(tree) {
this.visitFunction_(tree);
},
visitFunction_: function(tree) {
var $__11 = this;
this.found = new FindIdentifiers(tree, (function(identifierToken, identScope) {
identScope = $__11.scopeBuilder_.getScopeForTree(identScope);
var fnScope = $__11.outOfScope_ || $__11.scopeBuilder_.getScopeForTree(tree);
if (identScope.hasLexicalBindingName(identifierToken)) {
return false;
}
while (identScope !== fnScope && (identScope = identScope.parent)) {
if (identScope.hasLexicalBindingName(identifierToken)) {
return false;
}
}
while (fnScope = fnScope.parent) {
if (fnScope.hasLexicalBindingName(identifierToken)) {
return true;
}
if (fnScope === $__11.topScope_)
break;
}
return false;
})).found;
}
}, {}, FindVisitor);
return {get BlockBindingTransformer() {
return BlockBindingTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/MakeStrictTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/MakeStrictTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/MakeStrictTransformer", path);
}
var $__0 = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees"),
FunctionBody = $__0.FunctionBody,
Script = $__0.Script;
var ParseTreeTransformer = System.get("traceur@0.0.74/src/codegeneration/ParseTreeTransformer").ParseTreeTransformer;
var createUseStrictDirective = System.get("traceur@0.0.74/src/codegeneration/ParseTreeFactory").createUseStrictDirective;
var hasUseStrict = System.get("traceur@0.0.74/src/semantics/util").hasUseStrict;
function prepend(statements) {
return $traceurRuntime.spread([createUseStrictDirective()], statements);
}
var MakeStrictTransformer = function MakeStrictTransformer() {
$traceurRuntime.superConstructor($MakeStrictTransformer).apply(this, arguments);
};
var $MakeStrictTransformer = MakeStrictTransformer;
($traceurRuntime.createClass)(MakeStrictTransformer, {
transformScript: function(tree) {
if (hasUseStrict(tree.scriptItemList))
return tree;
return new Script(tree.location, prepend(tree.scriptItemList));
},
transformFunctionBody: function(tree) {
if (hasUseStrict(tree.statements))
return tree;
return new FunctionBody(tree.location, prepend(tree.statements));
}
}, {transformTree: function(tree) {
return new $MakeStrictTransformer().transformAny(tree);
}}, ParseTreeTransformer);
return {get MakeStrictTransformer() {
return MakeStrictTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/assignmentOperatorToBinaryOperator", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/assignmentOperatorToBinaryOperator";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/assignmentOperatorToBinaryOperator", path);
}
var $__0 = System.get("traceur@0.0.74/src/syntax/TokenType"),
AMPERSAND = $__0.AMPERSAND,
AMPERSAND_EQUAL = $__0.AMPERSAND_EQUAL,
BAR = $__0.BAR,
BAR_EQUAL = $__0.BAR_EQUAL,
CARET = $__0.CARET,
CARET_EQUAL = $__0.CARET_EQUAL,
LEFT_SHIFT = $__0.LEFT_SHIFT,
LEFT_SHIFT_EQUAL = $__0.LEFT_SHIFT_EQUAL,
MINUS = $__0.MINUS,
MINUS_EQUAL = $__0.MINUS_EQUAL,
PERCENT = $__0.PERCENT,
PERCENT_EQUAL = $__0.PERCENT_EQUAL,
PLUS = $__0.PLUS,
PLUS_EQUAL = $__0.PLUS_EQUAL,
RIGHT_SHIFT = $__0.RIGHT_SHIFT,
RIGHT_SHIFT_EQUAL = $__0.RIGHT_SHIFT_EQUAL,
SLASH = $__0.SLASH,
SLASH_EQUAL = $__0.SLASH_EQUAL,
STAR = $__0.STAR,
STAR_EQUAL = $__0.STAR_EQUAL,
STAR_STAR = $__0.STAR_STAR,
STAR_STAR_EQUAL = $__0.STAR_STAR_EQUAL,
UNSIGNED_RIGHT_SHIFT = $__0.UNSIGNED_RIGHT_SHIFT,
UNSIGNED_RIGHT_SHIFT_EQUAL = $__0.UNSIGNED_RIGHT_SHIFT_EQUAL;
function assignmentOperatorToBinaryOperator(type) {
switch (type) {
case STAR_EQUAL:
return STAR;
case STAR_STAR_EQUAL:
return STAR_STAR;
case SLASH_EQUAL:
return SLASH;
case PERCENT_EQUAL:
return PERCENT;
case PLUS_EQUAL:
return PLUS;
case MINUS_EQUAL:
return MINUS;
case LEFT_SHIFT_EQUAL:
return LEFT_SHIFT;
case RIGHT_SHIFT_EQUAL:
return RIGHT_SHIFT;
case UNSIGNED_RIGHT_SHIFT_EQUAL:
return UNSIGNED_RIGHT_SHIFT;
case AMPERSAND_EQUAL:
return AMPERSAND;
case CARET_EQUAL:
return CARET;
case BAR_EQUAL:
return BAR;
default:
throw Error('unreachable');
}
}
var $__default = assignmentOperatorToBinaryOperator;
return {get default() {
return $__default;
}};
});
System.register("traceur@0.0.74/src/codegeneration/ExplodeExpressionTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/ExplodeExpressionTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/ExplodeExpressionTransformer", path);
}
var ParseTreeTransformer = System.get("traceur@0.0.74/src/codegeneration/ParseTreeTransformer").ParseTreeTransformer;
var $__1 = System.get("traceur@0.0.74/src/codegeneration/ParseTreeFactory"),
createAssignmentExpression = $__1.createAssignmentExpression,
createCommaExpression = $__1.createCommaExpression,
id = $__1.createIdentifierExpression,
createMemberExpression = $__1.createMemberExpression,
createNumberLiteral = $__1.createNumberLiteral,
createOperatorToken = $__1.createOperatorToken,
createParenExpression = $__1.createParenExpression;
var $__2 = System.get("traceur@0.0.74/src/syntax/TokenType"),
AND = $__2.AND,
EQUAL = $__2.EQUAL,
MINUS = $__2.MINUS,
MINUS_EQUAL = $__2.MINUS_EQUAL,
MINUS_MINUS = $__2.MINUS_MINUS,
OR = $__2.OR,
PLUS = $__2.PLUS,
PLUS_EQUAL = $__2.PLUS_EQUAL,
PLUS_PLUS = $__2.PLUS_PLUS;
var $__3 = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType"),
COMMA_EXPRESSION = $__3.COMMA_EXPRESSION,
IDENTIFIER_EXPRESSION = $__3.IDENTIFIER_EXPRESSION,
MEMBER_EXPRESSION = $__3.MEMBER_EXPRESSION,
MEMBER_LOOKUP_EXPRESSION = $__3.MEMBER_LOOKUP_EXPRESSION,
PROPERTY_NAME_ASSIGNMENT = $__3.PROPERTY_NAME_ASSIGNMENT,
SPREAD_EXPRESSION = $__3.SPREAD_EXPRESSION,
TEMPLATE_LITERAL_PORTION = $__3.TEMPLATE_LITERAL_PORTION;
var $__4 = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees"),
ArgumentList = $__4.ArgumentList,
ArrayLiteralExpression = $__4.ArrayLiteralExpression,
AwaitExpression = $__4.AwaitExpression,
BinaryExpression = $__4.BinaryExpression,
CallExpression = $__4.CallExpression,
ConditionalExpression = $__4.ConditionalExpression,
MemberExpression = $__4.MemberExpression,
MemberLookupExpression = $__4.MemberLookupExpression,
NewExpression = $__4.NewExpression,
ObjectLiteralExpression = $__4.ObjectLiteralExpression,
PropertyNameAssignment = $__4.PropertyNameAssignment,
SpreadExpression = $__4.SpreadExpression,
TemplateLiteralExpression = $__4.TemplateLiteralExpression,
TemplateSubstitution = $__4.TemplateSubstitution,
UnaryExpression = $__4.UnaryExpression,
YieldExpression = $__4.YieldExpression;
var assert = System.get("traceur@0.0.74/src/util/assert").assert;
var assignmentOperatorToBinaryOperator = System.get("traceur@0.0.74/src/codegeneration/assignmentOperatorToBinaryOperator").default;
var CommaExpressionBuilder = function CommaExpressionBuilder(tempVar) {
this.tempVar = tempVar;
this.expressions = [];
};
($traceurRuntime.createClass)(CommaExpressionBuilder, {
add: function(tree) {
var $__8;
if (tree.type === COMMA_EXPRESSION)
($__8 = this.expressions).push.apply($__8, $traceurRuntime.spread(getExpressions(tree)));
return this;
},
build: function(tree) {
var tempVar = this.tempVar;
this.expressions.push(createAssignmentExpression(tempVar, tree), tempVar);
return createCommaExpression(this.expressions);
}
}, {});
function getResult(tree) {
if (tree.type === COMMA_EXPRESSION)
return tree.expressions[tree.expressions.length - 1];
return tree;
}
function getExpressions(tree) {
if (tree.type === COMMA_EXPRESSION)
return tree.expressions.slice(0, -1);
return [];
}
var ExplodeExpressionTransformer = function ExplodeExpressionTransformer(tempVarTransformer) {
$traceurRuntime.superConstructor($ExplodeExpressionTransformer).call(this);
this.tempVarTransformer_ = tempVarTransformer;
};
var $ExplodeExpressionTransformer = ExplodeExpressionTransformer;
($traceurRuntime.createClass)(ExplodeExpressionTransformer, {
addTempVar: function() {
var tmpId = this.tempVarTransformer_.addTempVar();
return id(tmpId);
},
transformUnaryExpression: function(tree) {
if (tree.operator.type == PLUS_PLUS)
return this.transformUnaryNumeric(tree, PLUS_EQUAL);
if (tree.operator.type == MINUS_MINUS)
return this.transformUnaryNumeric(tree, MINUS_EQUAL);
var operand = this.transformAny(tree.operand);
if (operand === tree.operand)
return tree;
var expressions = $traceurRuntime.spread(getExpressions(operand), [new UnaryExpression(tree.location, tree.operator, getResult(operand))]);
return createCommaExpression(expressions);
},
transformUnaryNumeric: function(tree, operator) {
return this.transformAny(new BinaryExpression(tree.location, tree.operand, createOperatorToken(operator), createNumberLiteral(1)));
},
transformPostfixExpression: function(tree) {
if (tree.operand.type === MEMBER_EXPRESSION)
return this.transformPostfixMemberExpression(tree);
if (tree.operand.type === MEMBER_LOOKUP_EXPRESSION)
return this.transformPostfixMemberLookupExpression(tree);
assert(tree.operand.type === IDENTIFIER_EXPRESSION);
var operand = tree.operand;
var tmp = this.addTempVar();
var operator = tree.operator.type === PLUS_PLUS ? PLUS : MINUS;
var expressions = [createAssignmentExpression(tmp, operand), createAssignmentExpression(operand, new BinaryExpression(tree.location, tmp, createOperatorToken(operator), createNumberLiteral(1))), tmp];
return createCommaExpression(expressions);
},
transformPostfixMemberExpression: function(tree) {
var memberName = tree.operand.memberName;
var operand = this.transformAny(tree.operand.operand);
var tmp = this.addTempVar();
var memberExpression = new MemberExpression(tree.operand.location, getResult(operand), memberName);
var operator = tree.operator.type === PLUS_PLUS ? PLUS : MINUS;
var expressions = $traceurRuntime.spread(getExpressions(operand), [createAssignmentExpression(tmp, memberExpression), createAssignmentExpression(memberExpression, new BinaryExpression(tree.location, tmp, createOperatorToken(operator), createNumberLiteral(1))), tmp]);
return createCommaExpression(expressions);
},
transformPostfixMemberLookupExpression: function(tree) {
var memberExpression = this.transformAny(tree.operand.memberExpression);
var operand = this.transformAny(tree.operand.operand);
var tmp = this.addTempVar();
var memberLookupExpression = new MemberLookupExpression(null, getResult(operand), getResult(memberExpression));
var operator = tree.operator.type === PLUS_PLUS ? PLUS : MINUS;
var expressions = $traceurRuntime.spread(getExpressions(operand), getExpressions(memberExpression), [createAssignmentExpression(tmp, memberLookupExpression), createAssignmentExpression(memberLookupExpression, new BinaryExpression(tree.location, tmp, createOperatorToken(operator), createNumberLiteral(1))), tmp]);
return createCommaExpression(expressions);
},
transformYieldExpression: function(tree) {
var expression = this.transformAny(tree.expression);
return this.createCommaExpressionBuilder().add(expression).build(new YieldExpression(tree.location, getResult(expression), tree.isYieldFor));
},
transformAwaitExpression: function(tree) {
var expression = this.transformAny(tree.expression);
return this.createCommaExpressionBuilder().add(expression).build(new AwaitExpression(tree.location, getResult(expression)));
},
transformParenExpression: function(tree) {
var expression = this.transformAny(tree.expression);
if (expression === tree.expression)
return tree;
var result = getResult(expression);
if (result.type === IDENTIFIER_EXPRESSION)
return expression;
return this.createCommaExpressionBuilder().add(expression).build(result);
},
transformCommaExpression: function(tree) {
var expressions = this.transformList(tree.expressions);
if (expressions === tree.expressions)
return tree;
var builder = new CommaExpressionBuilder(null);
for (var i = 0; i < expressions.length; i++) {
builder.add(expressions[i]);
}
return createCommaExpression($traceurRuntime.spread(builder.expressions, [getResult(expressions[expressions.length - 1])]));
},
transformMemberExpression: function(tree) {
var operand = this.transformAny(tree.operand);
return this.createCommaExpressionBuilder().add(operand).build(new MemberExpression(tree.location, getResult(operand), tree.memberName));
},
transformMemberLookupExpression: function(tree) {
var operand = this.transformAny(tree.operand);
var memberExpression = this.transformAny(tree.memberExpression);
return this.createCommaExpressionBuilder().add(operand).add(memberExpression).build(new MemberLookupExpression(tree.location, getResult(operand), getResult(memberExpression)));
},
transformBinaryExpression: function(tree) {
if (tree.operator.isAssignmentOperator())
return this.transformAssignmentExpression(tree);
var left = this.transformAny(tree.left);
var right = this.transformAny(tree.right);
if (left === tree.left && right === tree.right)
return tree;
if (tree.operator.type === OR)
return this.transformOr(left, right);
if (tree.operator.type === AND)
return this.transformAnd(left, right);
var expressions = $traceurRuntime.spread(getExpressions(left), getExpressions(right), [new BinaryExpression(tree.location, getResult(left), tree.operator, getResult(right))]);
return createCommaExpression(expressions);
},
transformAssignmentExpression: function(tree) {
var left = tree.left;
if (left.type === MEMBER_EXPRESSION)
return this.transformAssignMemberExpression(tree);
if (left.type === MEMBER_LOOKUP_EXPRESSION)
return this.transformAssignMemberLookupExpression(tree);
assert(tree.left.type === IDENTIFIER_EXPRESSION);
if (tree.operator.type === EQUAL) {
var left = this.transformAny(left);
var right = this.transformAny(tree.right);
var expressions = $traceurRuntime.spread(getExpressions(right), [createAssignmentExpression(left, getResult(right)), getResult(right)]);
return createCommaExpression(expressions);
}
var right = this.transformAny(tree.right);
var tmp = this.addTempVar();
var binop = createOperatorToken(assignmentOperatorToBinaryOperator(tree.operator.type));
var expressions = $traceurRuntime.spread(getExpressions(right), [createAssignmentExpression(tmp, new BinaryExpression(tree.location, left, binop, getResult(right))), createAssignmentExpression(left, tmp), tmp]);
return createCommaExpression(expressions);
},
transformAssignMemberExpression: function(tree) {
var left = tree.left;
if (tree.operator.type === EQUAL) {
var operand = this.transformAny(left.operand);
var right = this.transformAny(tree.right);
var expressions = $traceurRuntime.spread(getExpressions(operand), getExpressions(right), [new BinaryExpression(tree.location, new MemberExpression(left.location, getResult(operand), left.memberName), tree.operator, getResult(right)), getResult(right)]);
return createCommaExpression(expressions);
}
var operand = this.transformAny(left.operand);
var right = this.transformAny(tree.right);
var tmp = this.addTempVar();
var memberExpression = new MemberExpression(left.location, getResult(operand), left.memberName);
var tmp2 = this.addTempVar();
var binop = createOperatorToken(assignmentOperatorToBinaryOperator(tree.operator.type));
var expressions = $traceurRuntime.spread(getExpressions(operand), getExpressions(right), [createAssignmentExpression(tmp, memberExpression), createAssignmentExpression(tmp2, new BinaryExpression(tree.location, tmp, binop, getResult(right))), createAssignmentExpression(memberExpression, tmp2), tmp2]);
return createCommaExpression(expressions);
},
transformAssignMemberLookupExpression: function(tree) {
var left = tree.left;
if (tree.operator.type === EQUAL) {
var operand = this.transformAny(left.operand);
var memberExpression = this.transformAny(left.memberExpression);
var right = this.transformAny(tree.right);
var expressions = $traceurRuntime.spread(getExpressions(operand), getExpressions(memberExpression), getExpressions(right), [new BinaryExpression(tree.location, new MemberLookupExpression(left.location, getResult(operand), getResult(memberExpression)), tree.operator, getResult(right)), getResult(right)]);
return createCommaExpression(expressions);
}
var operand = this.transformAny(left.operand);
var memberExpression = this.transformAny(left.memberExpression);
var right = this.transformAny(tree.right);
var tmp = this.addTempVar();
var memberLookupExpression = new MemberLookupExpression(left.location, getResult(operand), getResult(memberExpression));
var tmp2 = this.addTempVar();
var binop = createOperatorToken(assignmentOperatorToBinaryOperator(tree.operator.type));
var expressions = $traceurRuntime.spread(getExpressions(operand), getExpressions(memberExpression), getExpressions(right), [createAssignmentExpression(tmp, memberLookupExpression), createAssignmentExpression(tmp2, new BinaryExpression(tree.location, tmp, binop, getResult(right))), createAssignmentExpression(memberLookupExpression, tmp2), tmp2]);
return createCommaExpression(expressions);
},
transformArrayLiteralExpression: function(tree) {
var elements = this.transformList(tree.elements);
if (elements === tree.elements)
return tree;
var builder = this.createCommaExpressionBuilder();
var results = [];
for (var i = 0; i < elements.length; i++) {
builder.add(elements[i]);
results.push(getResult(elements[i]));
}
return builder.build(new ArrayLiteralExpression(tree.location, results));
},
transformObjectLiteralExpression: function(tree) {
var propertyNameAndValues = this.transformList(tree.propertyNameAndValues);
if (propertyNameAndValues === tree.propertyNameAndValues)
return tree;
var builder = this.createCommaExpressionBuilder();
var results = [];
for (var i = 0; i < propertyNameAndValues.length; i++) {
if (propertyNameAndValues[i].type === PROPERTY_NAME_ASSIGNMENT) {
builder.add(propertyNameAndValues[i].value);
results.push(new PropertyNameAssignment(propertyNameAndValues[i].location, propertyNameAndValues[i].name, getResult(propertyNameAndValues[i].value)));
} else {
results.push(propertyNameAndValues[i]);
}
}
return builder.build(new ObjectLiteralExpression(tree.location, results));
},
transformTemplateLiteralExpression: function(tree) {
var operand = this.transformAny(tree.operand);
var elements = this.transformList(tree.elements);
if (!operand && operand === tree.operand && elements === tree.elements)
return tree;
var builder = this.createCommaExpressionBuilder();
if (operand)
builder.add(operand);
var results = [];
for (var i = 0; i < elements.length; i++) {
if (elements[i].type === TEMPLATE_LITERAL_PORTION) {
results.push(elements[i]);
} else {
var expression = elements[i].expression;
builder.add(expression);
var result = getResult(expression);
results.push(new TemplateSubstitution(expression.location, result));
}
}
return builder.build(new TemplateLiteralExpression(tree.location, operand && getResult(operand), results));
},
transformCallExpression: function(tree) {
if (tree.operand.type === MEMBER_EXPRESSION)
return this.transformCallMemberExpression(tree);
if (tree.operand.type === MEMBER_LOOKUP_EXPRESSION)
return this.transformCallMemberLookupExpression(tree);
return this.transformCallAndNew_(tree, CallExpression);
},
transformNewExpression: function(tree) {
return this.transformCallAndNew_(tree, NewExpression);
},
transformCallAndNew_: function(tree, ctor) {
var operand = this.transformAny(tree.operand);
var args = this.transformAny(tree.args);
var builder = this.createCommaExpressionBuilder().add(operand);
var argResults = [];
args.args.forEach((function(arg) {
builder.add(arg);
argResults.push(getResult(arg));
}));
return builder.build(new ctor(tree.location, getResult(operand), new ArgumentList(args.location, argResults)));
},
transformCallMemberExpression: function(tree) {
var memberName = tree.operand.memberName;
var operand = this.transformAny(tree.operand.operand);
var tmp = this.addTempVar();
var memberExpresssion = new MemberExpression(tree.operand.location, getResult(operand), memberName);
var args = this.transformAny(tree.args);
var expressions = $traceurRuntime.spread(getExpressions(operand), [createAssignmentExpression(tmp, memberExpresssion)]);
var argResults = [getResult(operand)];
args.args.forEach((function(arg) {
var $__8;
($__8 = expressions).push.apply($__8, $traceurRuntime.spread(getExpressions(arg)));
argResults.push(getResult(arg));
}));
var callExpression = new CallExpression(tree.location, createMemberExpression(tmp, 'call'), new ArgumentList(args.location, argResults));
var tmp2 = this.addTempVar();
expressions.push(createAssignmentExpression(tmp2, callExpression), tmp2);
return createCommaExpression(expressions);
},
transformCallMemberLookupExpression: function(tree) {
var operand = this.transformAny(tree.operand.operand);
var memberExpression = this.transformAny(tree.operand.memberExpression);
var tmp = this.addTempVar();
var lookupExpresssion = new MemberLookupExpression(tree.operand.location, getResult(operand), getResult(memberExpression));
var args = this.transformAny(tree.args);
var expressions = $traceurRuntime.spread(getExpressions(operand), getExpressions(memberExpression), [createAssignmentExpression(tmp, lookupExpresssion)]);
var argResults = [getResult(operand)];
args.args.forEach((function(arg, i) {
var $__8;
($__8 = expressions).push.apply($__8, $traceurRuntime.spread(getExpressions(arg)));
var result = getResult(arg);
if (tree.args.args[i].type === SPREAD_EXPRESSION)
result = new SpreadExpression(arg.location, result);
argResults.push(result);
}));
var callExpression = new CallExpression(tree.location, createMemberExpression(tmp, 'call'), new ArgumentList(args.location, argResults));
var tmp2 = this.addTempVar();
expressions.push(createAssignmentExpression(tmp2, callExpression), tmp2);
return createCommaExpression(expressions);
},
transformConditionalExpression: function(tree) {
var condition = this.transformAny(tree.condition);
var left = this.transformAny(tree.left);
var right = this.transformAny(tree.right);
if (condition === tree.condition && left === tree.left && right === tree.right)
return tree;
var res = this.addTempVar();
var leftTree = createCommaExpression($traceurRuntime.spread(getExpressions(left), [createAssignmentExpression(res, getResult(left))]));
var rightTree = createCommaExpression($traceurRuntime.spread(getExpressions(right), [createAssignmentExpression(res, getResult(right))]));
var expressions = $traceurRuntime.spread(getExpressions(condition), [new ConditionalExpression(tree.location, getResult(condition), createParenExpression(leftTree), createParenExpression(rightTree)), res]);
return createCommaExpression(expressions);
},
transformOr: function(left, right) {
var res = this.addTempVar();
var leftTree = createCommaExpression([createAssignmentExpression(res, getResult(left))]);
var rightTree = createCommaExpression($traceurRuntime.spread(getExpressions(right), [createAssignmentExpression(res, getResult(right))]));
var expressions = $traceurRuntime.spread(getExpressions(left), [new ConditionalExpression(left.location, getResult(left), createParenExpression(leftTree), createParenExpression(rightTree)), res]);
return createCommaExpression(expressions);
},
transformAnd: function(left, right) {
var res = this.addTempVar();
var leftTree = createCommaExpression($traceurRuntime.spread(getExpressions(right), [createAssignmentExpression(res, getResult(right))]));
var rightTree = createCommaExpression([createAssignmentExpression(res, getResult(left))]);
var expressions = $traceurRuntime.spread(getExpressions(left), [new ConditionalExpression(left.location, getResult(left), createParenExpression(leftTree), createParenExpression(rightTree)), res]);
return createCommaExpression(expressions);
},
transformSpreadExpression: function(tree) {
var expression = this.transformAny(tree.expression);
if (expression === tree.expression)
return tree;
var result = getResult(expression);
if (result.type !== SPREAD_EXPRESSION)
result = new SpreadExpression(result.location, result);
var expressions = $traceurRuntime.spread(getExpressions(expression), [result]);
return createCommaExpression(expressions);
},
createCommaExpressionBuilder: function() {
return new CommaExpressionBuilder(this.addTempVar());
}
}, {}, ParseTreeTransformer);
return {get ExplodeExpressionTransformer() {
return ExplodeExpressionTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/SuperTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/SuperTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/SuperTransformer", path);
}
var $__0 = Object.freeze(Object.defineProperties(["$traceurRuntime.superConstructor(", ").call(", ")"], {raw: {value: Object.freeze(["$traceurRuntime.superConstructor(", ").call(", ")"])}})),
$__1 = Object.freeze(Object.defineProperties(["", ".call(", ")"], {raw: {value: Object.freeze(["", ".call(", ")"])}})),
$__2 = Object.freeze(Object.defineProperties(["$traceurRuntime.superGet(", ", ", ", ", ")"], {raw: {value: Object.freeze(["$traceurRuntime.superGet(", ", ", ", ", ")"])}})),
$__3 = Object.freeze(Object.defineProperties(["$traceurRuntime.superSet(", ", ", ", ", ",\n ", ")"], {raw: {value: Object.freeze(["$traceurRuntime.superSet(", ", ", ", ", ",\n ", ")"])}}));
var ExplodeExpressionTransformer = System.get("traceur@0.0.74/src/codegeneration/ExplodeExpressionTransformer").ExplodeExpressionTransformer;
var $__5 = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees"),
FunctionDeclaration = $__5.FunctionDeclaration,
FunctionExpression = $__5.FunctionExpression;
var $__6 = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType"),
MEMBER_EXPRESSION = $__6.MEMBER_EXPRESSION,
MEMBER_LOOKUP_EXPRESSION = $__6.MEMBER_LOOKUP_EXPRESSION,
SUPER_EXPRESSION = $__6.SUPER_EXPRESSION;
var ParseTreeTransformer = System.get("traceur@0.0.74/src/codegeneration/ParseTreeTransformer").ParseTreeTransformer;
var $__8 = System.get("traceur@0.0.74/src/syntax/TokenType"),
EQUAL = $__8.EQUAL,
MINUS_MINUS = $__8.MINUS_MINUS,
PLUS_PLUS = $__8.PLUS_PLUS;
var $__9 = System.get("traceur@0.0.74/src/codegeneration/ParseTreeFactory"),
createArgumentList = $__9.createArgumentList,
createIdentifierExpression = $__9.createIdentifierExpression,
createParenExpression = $__9.createParenExpression,
createStringLiteral = $__9.createStringLiteral,
createThisExpression = $__9.createThisExpression;
var parseExpression = System.get("traceur@0.0.74/src/codegeneration/PlaceholderParser").parseExpression;
var ExplodeSuperExpression = function ExplodeSuperExpression() {
$traceurRuntime.superConstructor($ExplodeSuperExpression).apply(this, arguments);
};
var $ExplodeSuperExpression = ExplodeSuperExpression;
($traceurRuntime.createClass)(ExplodeSuperExpression, {
transformArrowFunctionExpression: function(tree) {
return tree;
},
transformClassExpression: function(tree) {
return tree;
},
transformFunctionBody: function(tree) {
return tree;
}
}, {}, ExplodeExpressionTransformer);
var SuperTransformer = function SuperTransformer(tempVarTransformer, protoName, thisName, internalName) {
this.tempVarTransformer_ = tempVarTransformer;
this.protoName_ = protoName;
this.internalName_ = internalName;
this.superCount_ = 0;
this.thisVar_ = createIdentifierExpression(thisName);
this.inNestedFunc_ = 0;
this.nestedSuperCount_ = 0;
};
var $SuperTransformer = SuperTransformer;
($traceurRuntime.createClass)(SuperTransformer, {
get hasSuper() {
return this.superCount_ > 0;
},
get nestedSuper() {
return this.nestedSuperCount_ > 0;
},
transformFunctionDeclaration: function(tree) {
return this.transformFunction_(tree, FunctionDeclaration);
},
transformFunctionExpression: function(tree) {
return this.transformFunction_(tree, FunctionExpression);
},
transformFunction_: function(tree, constructor) {
var oldSuperCount = this.superCount_;
this.inNestedFunc_++;
var transformedTree = constructor === FunctionExpression ? $traceurRuntime.superGet(this, $SuperTransformer.prototype, "transformFunctionExpression").call(this, tree) : $traceurRuntime.superGet(this, $SuperTransformer.prototype, "transformFunctionDeclaration").call(this, tree);
this.inNestedFunc_--;
if (oldSuperCount !== this.superCount_)
this.nestedSuperCount_ += this.superCount_ - oldSuperCount;
return transformedTree;
},
transformGetAccessor: function(tree) {
return tree;
},
transformSetAccessor: function(tree) {
return tree;
},
transformPropertyMethodAssignMent: function(tree) {
return tree;
},
transformCallExpression: function(tree) {
if (tree.operand.type == SUPER_EXPRESSION) {
this.superCount_++;
return this.createSuperCall_(tree);
}
if (hasSuperMemberExpression(tree.operand)) {
this.superCount_++;
var name;
if (tree.operand.type == MEMBER_EXPRESSION)
name = tree.operand.memberName.value;
else
name = tree.operand.memberExpression;
return this.createSuperCallMethod_(name, tree);
}
return $traceurRuntime.superGet(this, $SuperTransformer.prototype, "transformCallExpression").call(this, tree);
},
createSuperCall_: function(tree) {
var thisExpr = this.inNestedFunc_ ? this.thisVar_ : createThisExpression();
var args = createArgumentList($traceurRuntime.spread([thisExpr], tree.args.args));
return parseExpression($__0, this.internalName_, args);
},
createSuperCallMethod_: function(methodName, tree) {
var thisExpr = this.inNestedFunc_ ? this.thisVar_ : createThisExpression();
var operand = this.transformMemberShared_(methodName);
var args = createArgumentList($traceurRuntime.spread([thisExpr], tree.args.args));
return parseExpression($__1, operand, args);
},
transformMemberShared_: function(name) {
var thisExpr = this.inNestedFunc_ ? this.thisVar_ : createThisExpression();
return parseExpression($__2, thisExpr, this.protoName_, name);
},
transformMemberExpression: function(tree) {
if (tree.operand.type === SUPER_EXPRESSION) {
this.superCount_++;
return this.transformMemberShared_(tree.memberName.value);
}
return $traceurRuntime.superGet(this, $SuperTransformer.prototype, "transformMemberExpression").call(this, tree);
},
transformMemberLookupExpression: function(tree) {
if (tree.operand.type === SUPER_EXPRESSION)
return this.transformMemberShared_(tree.memberExpression);
return $traceurRuntime.superGet(this, $SuperTransformer.prototype, "transformMemberLookupExpression").call(this, tree);
},
transformBinaryExpression: function(tree) {
if (tree.operator.isAssignmentOperator() && hasSuperMemberExpression(tree.left)) {
if (tree.operator.type !== EQUAL) {
var exploded = new ExplodeSuperExpression(this.tempVarTransformer_).transformAny(tree);
return this.transformAny(createParenExpression(exploded));
}
this.superCount_++;
var name = tree.left.type === MEMBER_LOOKUP_EXPRESSION ? tree.left.memberExpression : createStringLiteral(tree.left.memberName.value);
var thisExpr = this.inNestedFunc_ ? this.thisVar_ : createThisExpression();
var right = this.transformAny(tree.right);
return parseExpression($__3, thisExpr, this.protoName_, name, right);
}
return $traceurRuntime.superGet(this, $SuperTransformer.prototype, "transformBinaryExpression").call(this, tree);
},
transformUnaryExpression: function(tree) {
var transformed = this.transformIncrementDecrement_(tree);
if (transformed)
return transformed;
return $traceurRuntime.superGet(this, $SuperTransformer.prototype, "transformUnaryExpression").call(this, tree);
},
transformPostfixExpression: function(tree) {
var transformed = this.transformIncrementDecrement_(tree);
if (transformed)
return transformed;
return $traceurRuntime.superGet(this, $SuperTransformer.prototype, "transformPostfixExpression").call(this, tree);
},
transformIncrementDecrement_: function(tree) {
var operator = tree.operator;
var operand = tree.operand;
if ((operator.type === PLUS_PLUS || operator.type === MINUS_MINUS) && hasSuperMemberExpression(operand)) {
var exploded = new ExplodeSuperExpression(this.tempVarTransformer_).transformAny(tree);
if (exploded !== tree)
exploded = createParenExpression(exploded);
return this.transformAny(exploded);
}
return null;
}
}, {}, ParseTreeTransformer);
function hasSuperMemberExpression(tree) {
if (tree.type !== MEMBER_EXPRESSION && tree.type !== MEMBER_LOOKUP_EXPRESSION)
return false;
return tree.operand.type === SUPER_EXPRESSION;
}
return {get SuperTransformer() {
return SuperTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/ClassTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/ClassTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/ClassTransformer", path);
}
var $__0 = Object.freeze(Object.defineProperties(["($traceurRuntime.createClass)(", ", ", ", ", ",\n ", ")"], {raw: {value: Object.freeze(["($traceurRuntime.createClass)(", ", ", ", ", ",\n ", ")"])}})),
$__1 = Object.freeze(Object.defineProperties(["($traceurRuntime.createClass)(", ", ", ", ", ")"], {raw: {value: Object.freeze(["($traceurRuntime.createClass)(", ", ", ", ", ")"])}})),
$__2 = Object.freeze(Object.defineProperties(["var ", " = ", ""], {raw: {value: Object.freeze(["var ", " = ", ""])}})),
$__3 = Object.freeze(Object.defineProperties(["var ", " = ", ""], {raw: {value: Object.freeze(["var ", " = ", ""])}})),
$__4 = Object.freeze(Object.defineProperties(["function($__super) {\n var ", " = ", ";\n return ($traceurRuntime.createClass)(", ", ", ",\n ", ", $__super);\n }(", ")"], {raw: {value: Object.freeze(["function($__super) {\n var ", " = ", ";\n return ($traceurRuntime.createClass)(", ", ", ",\n ", ", $__super);\n }(", ")"])}})),
$__5 = Object.freeze(Object.defineProperties(["function() {\n var ", " = ", ";\n return ($traceurRuntime.createClass)(", ", ", ",\n ", ");\n }()"], {raw: {value: Object.freeze(["function() {\n var ", " = ", ";\n return ($traceurRuntime.createClass)(", ", ", ",\n ", ");\n }()"])}})),
$__6 = Object.freeze(Object.defineProperties(["$traceurRuntime.superConstructor(\n ", ").apply(this, arguments)"], {raw: {value: Object.freeze(["$traceurRuntime.superConstructor(\n ", ").apply(this, arguments)"])}}));
var AlphaRenamer = System.get("traceur@0.0.74/src/codegeneration/AlphaRenamer").AlphaRenamer;
var CONSTRUCTOR = System.get("traceur@0.0.74/src/syntax/PredefinedName").CONSTRUCTOR;
var $__9 = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees"),
AnonBlock = $__9.AnonBlock,
ExportDeclaration = $__9.ExportDeclaration,
FunctionExpression = $__9.FunctionExpression,
GetAccessor = $__9.GetAccessor,
PropertyMethodAssignment = $__9.PropertyMethodAssignment,
SetAccessor = $__9.SetAccessor;
var $__10 = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType"),
GET_ACCESSOR = $__10.GET_ACCESSOR,
PROPERTY_METHOD_ASSIGNMENT = $__10.PROPERTY_METHOD_ASSIGNMENT,
PROPERTY_VARIABLE_DECLARATION = $__10.PROPERTY_VARIABLE_DECLARATION,
SET_ACCESSOR = $__10.SET_ACCESSOR;
var SuperTransformer = System.get("traceur@0.0.74/src/codegeneration/SuperTransformer").SuperTransformer;
var TempVarTransformer = System.get("traceur@0.0.74/src/codegeneration/TempVarTransformer").TempVarTransformer;
var VAR = System.get("traceur@0.0.74/src/syntax/TokenType").VAR;
var MakeStrictTransformer = System.get("traceur@0.0.74/src/codegeneration/MakeStrictTransformer").MakeStrictTransformer;
var $__15 = System.get("traceur@0.0.74/src/codegeneration/ParseTreeFactory"),
createEmptyParameterList = $__15.createEmptyParameterList,
createExpressionStatement = $__15.createExpressionStatement,
createFunctionBody = $__15.createFunctionBody,
id = $__15.createIdentifierExpression,
createMemberExpression = $__15.createMemberExpression,
createObjectLiteralExpression = $__15.createObjectLiteralExpression,
createParenExpression = $__15.createParenExpression,
createThisExpression = $__15.createThisExpression,
createVariableStatement = $__15.createVariableStatement;
var hasUseStrict = System.get("traceur@0.0.74/src/semantics/util").hasUseStrict;
var $__17 = System.get("traceur@0.0.74/src/codegeneration/PlaceholderParser"),
parseExpression = $__17.parseExpression,
parseStatement = $__17.parseStatement,
parseStatements = $__17.parseStatements;
var propName = System.get("traceur@0.0.74/src/staticsemantics/PropName").propName;
function classCall(func, object, staticObject, superClass) {
if (superClass) {
return parseExpression($__0, func, object, staticObject, superClass);
}
return parseExpression($__1, func, object, staticObject);
}
var ClassTransformer = function ClassTransformer(identifierGenerator) {
$traceurRuntime.superConstructor($ClassTransformer).call(this, identifierGenerator);
this.strictCount_ = 0;
this.state_ = null;
};
var $ClassTransformer = ClassTransformer;
($traceurRuntime.createClass)(ClassTransformer, {
transformExportDeclaration: function(tree) {
var transformed = $traceurRuntime.superGet(this, $ClassTransformer.prototype, "transformExportDeclaration").call(this, tree);
if (transformed === tree)
return tree;
var declaration = transformed.declaration;
if (declaration instanceof AnonBlock) {
var statements = $traceurRuntime.spread([new ExportDeclaration(null, declaration.statements[0], [])], declaration.statements.slice(1));
return new AnonBlock(null, statements);
}
return transformed;
},
transformModule: function(tree) {
this.strictCount_ = 1;
return $traceurRuntime.superGet(this, $ClassTransformer.prototype, "transformModule").call(this, tree);
},
transformScript: function(tree) {
this.strictCount_ = +hasUseStrict(tree.scriptItemList);
return $traceurRuntime.superGet(this, $ClassTransformer.prototype, "transformScript").call(this, tree);
},
transformFunctionBody: function(tree) {
var useStrict = +hasUseStrict(tree.statements);
this.strictCount_ += useStrict;
var result = $traceurRuntime.superGet(this, $ClassTransformer.prototype, "transformFunctionBody").call(this, tree);
this.strictCount_ -= useStrict;
return result;
},
makeStrict_: function(tree) {
if (this.strictCount_)
return tree;
return MakeStrictTransformer.transformTree(tree);
},
transformClassElements_: function(tree, internalName) {
var $__19 = this;
var oldState = this.state_;
this.state_ = {hasSuper: false};
var superClass = this.transformAny(tree.superClass);
var hasConstructor = false;
var protoElements = [],
staticElements = [];
var constructorBody,
constructorParams;
tree.elements.forEach((function(tree) {
var elements,
homeObject;
if (tree.isStatic) {
elements = staticElements;
homeObject = internalName;
} else {
elements = protoElements;
homeObject = createMemberExpression(internalName, 'prototype');
}
switch (tree.type) {
case GET_ACCESSOR:
elements.push($__19.transformGetAccessor_(tree, homeObject));
break;
case SET_ACCESSOR:
elements.push($__19.transformSetAccessor_(tree, homeObject));
break;
case PROPERTY_METHOD_ASSIGNMENT:
var transformed = $__19.transformPropertyMethodAssignment_(tree, homeObject, internalName);
if (!tree.isStatic && propName(tree) === CONSTRUCTOR) {
hasConstructor = true;
constructorParams = transformed.parameterList;
constructorBody = transformed.body;
} else {
elements.push(transformed);
}
break;
case PROPERTY_VARIABLE_DECLARATION:
break;
default:
throw new Error(("Unexpected class element: " + tree.type));
}
}));
var object = createObjectLiteralExpression(protoElements);
var staticObject = createObjectLiteralExpression(staticElements);
var func;
if (!hasConstructor) {
func = this.getDefaultConstructor_(tree, internalName);
} else {
func = new FunctionExpression(tree.location, tree.name, false, constructorParams, null, [], constructorBody);
}
var state = this.state_;
this.state_ = oldState;
return {
func: func,
superClass: superClass,
object: object,
staticObject: staticObject,
hasSuper: state.hasSuper
};
},
transformClassDeclaration: function(tree) {
var name = tree.name.identifierToken;
var internalName = id(("$" + name));
var renamed = AlphaRenamer.rename(tree, name.value, internalName.identifierToken.value);
var referencesClassName = renamed !== tree;
var tree = renamed;
var $__21 = this.transformClassElements_(tree, internalName),
func = $__21.func,
hasSuper = $__21.hasSuper,
object = $__21.object,
staticObject = $__21.staticObject,
superClass = $__21.superClass;
var statements = parseStatements($__2, name, func);
var expr = classCall(name, object, staticObject, superClass);
if (hasSuper || referencesClassName) {
statements.push(parseStatement($__3, internalName, name));
}
statements.push(createExpressionStatement(expr));
var anonBlock = new AnonBlock(null, statements);
return this.makeStrict_(anonBlock);
},
transformClassExpression: function(tree) {
this.pushTempScope();
var name;
if (tree.name)
name = tree.name.identifierToken;
else
name = id(this.getTempIdentifier());
var $__21 = this.transformClassElements_(tree, name),
func = $__21.func,
hasSuper = $__21.hasSuper,
object = $__21.object,
staticObject = $__21.staticObject,
superClass = $__21.superClass;
var expression;
if (hasSuper || tree.name) {
if (superClass) {
expression = parseExpression($__4, name, func, name, object, staticObject, superClass);
} else {
expression = parseExpression($__5, name, func, name, object, staticObject);
}
} else {
expression = classCall(func, object, staticObject, superClass);
}
this.popTempScope();
return createParenExpression(this.makeStrict_(expression));
},
transformPropertyMethodAssignment_: function(tree, homeObject, internalName) {
var parameterList = this.transformAny(tree.parameterList);
var body = this.transformSuperInFunctionBody_(tree.body, homeObject, internalName);
if (!tree.isStatic && parameterList === tree.parameterList && body === tree.body) {
return tree;
}
var isStatic = false;
return new PropertyMethodAssignment(tree.location, isStatic, tree.functionKind, tree.name, parameterList, tree.typeAnnotation, tree.annotations, body);
},
transformGetAccessor_: function(tree, homeObject) {
var body = this.transformSuperInFunctionBody_(tree.body, homeObject);
if (!tree.isStatic && body === tree.body)
return tree;
return new GetAccessor(tree.location, false, tree.name, tree.typeAnnotation, tree.annotations, body);
},
transformSetAccessor_: function(tree, homeObject) {
var parameterList = this.transformAny(tree.parameterList);
var body = this.transformSuperInFunctionBody_(tree.body, homeObject);
if (!tree.isStatic && body === tree.body)
return tree;
return new SetAccessor(tree.location, false, tree.name, parameterList, tree.annotations, body);
},
transformSuperInFunctionBody_: function(tree, homeObject, internalName) {
this.pushTempScope();
var thisName = this.getTempIdentifier();
var thisDecl = createVariableStatement(VAR, thisName, createThisExpression());
var superTransformer = new SuperTransformer(this, homeObject, thisName, internalName);
var transformedTree = superTransformer.transformFunctionBody(this.transformFunctionBody(tree));
if (superTransformer.hasSuper)
this.state_.hasSuper = true;
this.popTempScope();
if (superTransformer.nestedSuper)
return createFunctionBody([thisDecl].concat(transformedTree.statements));
return transformedTree;
},
getDefaultConstructor_: function(tree, internalName) {
var constructorParams = createEmptyParameterList();
var constructorBody;
if (tree.superClass) {
var statement = parseStatement($__6, internalName);
constructorBody = createFunctionBody([statement]);
this.state_.hasSuper = true;
} else {
constructorBody = createFunctionBody([]);
}
return new FunctionExpression(tree.location, tree.name, false, constructorParams, null, [], constructorBody);
}
}, {}, TempVarTransformer);
return {get ClassTransformer() {
return ClassTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/CommonJsModuleTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/CommonJsModuleTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/CommonJsModuleTransformer", path);
}
var $__0 = Object.freeze(Object.defineProperties(["module.exports = function() {\n ", "\n }.call(", ");"], {raw: {value: Object.freeze(["module.exports = function() {\n ", "\n }.call(", ");"])}})),
$__1 = Object.freeze(Object.defineProperties(["Object.defineProperties(exports, ", ");"], {raw: {value: Object.freeze(["Object.defineProperties(exports, ", ");"])}})),
$__2 = Object.freeze(Object.defineProperties(["{get: ", "}"], {raw: {value: Object.freeze(["{get: ", "}"])}})),
$__3 = Object.freeze(Object.defineProperties(["{value: ", "}"], {raw: {value: Object.freeze(["{value: ", "}"])}})),
$__4 = Object.freeze(Object.defineProperties(["(", " = require(", "),\n ", " && ", ".__esModule && ", " || {default: ", "})"], {raw: {value: Object.freeze(["(", " = require(", "),\n ", " && ", ".__esModule && ", " || {default: ", "})"])}})),
$__5 = Object.freeze(Object.defineProperties(["__esModule: true"], {raw: {value: Object.freeze(["__esModule: true"])}}));
var ModuleTransformer = System.get("traceur@0.0.74/src/codegeneration/ModuleTransformer").ModuleTransformer;
var $__7 = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType"),
GET_ACCESSOR = $__7.GET_ACCESSOR,
OBJECT_LITERAL_EXPRESSION = $__7.OBJECT_LITERAL_EXPRESSION,
PROPERTY_NAME_ASSIGNMENT = $__7.PROPERTY_NAME_ASSIGNMENT,
RETURN_STATEMENT = $__7.RETURN_STATEMENT;
var assert = System.get("traceur@0.0.74/src/util/assert").assert;
var globalThis = System.get("traceur@0.0.74/src/codegeneration/globalThis").default;
var $__10 = System.get("traceur@0.0.74/src/codegeneration/PlaceholderParser"),
parseExpression = $__10.parseExpression,
parsePropertyDefinition = $__10.parsePropertyDefinition,
parseStatement = $__10.parseStatement,
parseStatements = $__10.parseStatements;
var scopeContainsThis = System.get("traceur@0.0.74/src/codegeneration/scopeContainsThis").default;
var $__12 = System.get("traceur@0.0.74/src/codegeneration/ParseTreeFactory"),
createEmptyParameterList = $__12.createEmptyParameterList,
createFunctionExpression = $__12.createFunctionExpression,
createIdentifierExpression = $__12.createIdentifierExpression,
createObjectLiteralExpression = $__12.createObjectLiteralExpression,
createPropertyNameAssignment = $__12.createPropertyNameAssignment,
createVariableStatement = $__12.createVariableStatement,
createVariableDeclaration = $__12.createVariableDeclaration,
createVariableDeclarationList = $__12.createVariableDeclarationList;
var VAR = System.get("traceur@0.0.74/src/syntax/TokenType").VAR;
var prependStatements = System.get("traceur@0.0.74/src/codegeneration/PrependStatements").prependStatements;
var CommonJsModuleTransformer = function CommonJsModuleTransformer(identifierGenerator) {
$traceurRuntime.superConstructor($CommonJsModuleTransformer).call(this, identifierGenerator);
this.moduleVars_ = [];
};
var $CommonJsModuleTransformer = CommonJsModuleTransformer;
($traceurRuntime.createClass)(CommonJsModuleTransformer, {
moduleProlog: function() {
var statements = $traceurRuntime.superGet(this, $CommonJsModuleTransformer.prototype, "moduleProlog").call(this);
if (this.moduleVars_.length) {
var tmpVarDeclarations = createVariableStatement(createVariableDeclarationList(VAR, this.moduleVars_.map((function(varName) {
return createVariableDeclaration(varName, null);
}))));
statements.push(tmpVarDeclarations);
}
return statements;
},
wrapModule: function(statements) {
var needsIife = statements.some(scopeContainsThis);
if (needsIife) {
return parseStatements($__0, statements, globalThis());
}
var last = statements[statements.length - 1];
statements = statements.slice(0, -1);
assert(last.type === RETURN_STATEMENT);
var exportObject = last.expression;
if (this.hasExports()) {
var descriptors = this.transformObjectLiteralToDescriptors(exportObject);
var exportStatement = parseStatement($__1, descriptors);
statements = prependStatements(statements, exportStatement);
}
return statements;
},
transformObjectLiteralToDescriptors: function(literalTree) {
assert(literalTree.type === OBJECT_LITERAL_EXPRESSION);
var props = literalTree.propertyNameAndValues.map((function(exp) {
var descriptor;
switch (exp.type) {
case GET_ACCESSOR:
var getterFunction = createFunctionExpression(createEmptyParameterList(), exp.body);
descriptor = parseExpression($__2, getterFunction);
break;
case PROPERTY_NAME_ASSIGNMENT:
descriptor = parseExpression($__3, exp.value);
break;
default:
throw new Error(("Unexpected property type " + exp.type));
}
return createPropertyNameAssignment(exp.name, descriptor);
}));
return createObjectLiteralExpression(props);
},
transformModuleSpecifier: function(tree) {
var moduleName = tree.token.processedValue;
var tmpVar = this.getTempVarNameForModuleSpecifier(tree);
this.moduleVars_.push(tmpVar);
var tvId = createIdentifierExpression(tmpVar);
return parseExpression($__4, tvId, moduleName, tvId, tvId, tvId, tvId);
},
getExportProperties: function() {
var properties = $traceurRuntime.superGet(this, $CommonJsModuleTransformer.prototype, "getExportProperties").call(this);
if (this.exportVisitor_.hasExports())
properties.push(parsePropertyDefinition($__5));
return properties;
}
}, {}, ModuleTransformer);
return {get CommonJsModuleTransformer() {
return CommonJsModuleTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/ParameterTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/ParameterTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/ParameterTransformer", path);
}
var FunctionBody = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees").FunctionBody;
var TempVarTransformer = System.get("traceur@0.0.74/src/codegeneration/TempVarTransformer").TempVarTransformer;
var prependStatements = System.get("traceur@0.0.74/src/codegeneration/PrependStatements").prependStatements;
var stack = [];
var ParameterTransformer = function ParameterTransformer() {
$traceurRuntime.superConstructor($ParameterTransformer).apply(this, arguments);
};
var $ParameterTransformer = ParameterTransformer;
($traceurRuntime.createClass)(ParameterTransformer, {
transformArrowFunctionExpression: function(tree) {
stack.push([]);
return $traceurRuntime.superGet(this, $ParameterTransformer.prototype, "transformArrowFunctionExpression").call(this, tree);
},
transformFunctionDeclaration: function(tree) {
stack.push([]);
return $traceurRuntime.superGet(this, $ParameterTransformer.prototype, "transformFunctionDeclaration").call(this, tree);
},
transformFunctionExpression: function(tree) {
stack.push([]);
return $traceurRuntime.superGet(this, $ParameterTransformer.prototype, "transformFunctionExpression").call(this, tree);
},
transformGetAccessor: function(tree) {
stack.push([]);
return $traceurRuntime.superGet(this, $ParameterTransformer.prototype, "transformGetAccessor").call(this, tree);
},
transformSetAccessor: function(tree) {
stack.push([]);
return $traceurRuntime.superGet(this, $ParameterTransformer.prototype, "transformSetAccessor").call(this, tree);
},
transformPropertyMethodAssignment: function(tree) {
stack.push([]);
return $traceurRuntime.superGet(this, $ParameterTransformer.prototype, "transformPropertyMethodAssignment").call(this, tree);
},
transformFunctionBody: function(tree) {
var transformedTree = $traceurRuntime.superGet(this, $ParameterTransformer.prototype, "transformFunctionBody").call(this, tree);
var statements = stack.pop();
if (!statements.length)
return transformedTree;
statements = prependStatements.apply(null, $traceurRuntime.spread([transformedTree.statements], statements));
return new FunctionBody(transformedTree.location, statements);
},
get parameterStatements() {
return stack[stack.length - 1];
}
}, {}, TempVarTransformer);
return {get ParameterTransformer() {
return ParameterTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/DefaultParametersTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/DefaultParametersTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/DefaultParametersTransformer", path);
}
var $__0 = System.get("traceur@0.0.74/src/semantics/util"),
isUndefined = $__0.isUndefined,
isVoidExpression = $__0.isVoidExpression;
var FormalParameterList = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees").FormalParameterList;
var ParameterTransformer = System.get("traceur@0.0.74/src/codegeneration/ParameterTransformer").ParameterTransformer;
var ARGUMENTS = System.get("traceur@0.0.74/src/syntax/PredefinedName").ARGUMENTS;
var $__4 = System.get("traceur@0.0.74/src/syntax/TokenType"),
NOT_EQUAL_EQUAL = $__4.NOT_EQUAL_EQUAL,
VAR = $__4.VAR;
var $__5 = System.get("traceur@0.0.74/src/codegeneration/ParseTreeFactory"),
createBinaryExpression = $__5.createBinaryExpression,
createConditionalExpression = $__5.createConditionalExpression,
createIdentifierExpression = $__5.createIdentifierExpression,
createMemberLookupExpression = $__5.createMemberLookupExpression,
createNumberLiteral = $__5.createNumberLiteral,
createOperatorToken = $__5.createOperatorToken,
createVariableStatement = $__5.createVariableStatement,
createVoid0 = $__5.createVoid0;
function createDefaultAssignment(index, binding, initializer) {
var argumentsExpression = createMemberLookupExpression(createIdentifierExpression(ARGUMENTS), createNumberLiteral(index));
var assignmentExpression;
if (initializer === null || isUndefined(initializer) || isVoidExpression(initializer)) {
assignmentExpression = argumentsExpression;
} else {
assignmentExpression = createConditionalExpression(createBinaryExpression(argumentsExpression, createOperatorToken(NOT_EQUAL_EQUAL), createVoid0()), argumentsExpression, initializer);
}
return createVariableStatement(VAR, binding, assignmentExpression);
}
var DefaultParametersTransformer = function DefaultParametersTransformer() {
$traceurRuntime.superConstructor($DefaultParametersTransformer).apply(this, arguments);
};
var $DefaultParametersTransformer = DefaultParametersTransformer;
($traceurRuntime.createClass)(DefaultParametersTransformer, {transformFormalParameterList: function(tree) {
var parameters = [];
var changed = false;
var defaultToUndefined = false;
for (var i = 0; i < tree.parameters.length; i++) {
var param = this.transformAny(tree.parameters[i]);
if (param !== tree.parameters[i])
changed = true;
if (param.isRestParameter() || !param.parameter.initializer && !defaultToUndefined) {
parameters.push(param);
} else {
defaultToUndefined = true;
changed = true;
this.parameterStatements.push(createDefaultAssignment(i, param.parameter.binding, param.parameter.initializer));
}
}
if (!changed)
return tree;
return new FormalParameterList(tree.location, parameters);
}}, {}, ParameterTransformer);
return {get DefaultParametersTransformer() {
return DefaultParametersTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/ExponentiationTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/ExponentiationTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/ExponentiationTransformer", path);
}
var $__0 = Object.freeze(Object.defineProperties(["Math.pow(", ", ", ")"], {raw: {value: Object.freeze(["Math.pow(", ", ", ")"])}}));
var ExplodeExpressionTransformer = System.get("traceur@0.0.74/src/codegeneration/ExplodeExpressionTransformer").ExplodeExpressionTransformer;
var TempVarTransformer = System.get("traceur@0.0.74/src/codegeneration/TempVarTransformer").TempVarTransformer;
var $__3 = System.get("traceur@0.0.74/src/syntax/TokenType"),
STAR_STAR = $__3.STAR_STAR,
STAR_STAR_EQUAL = $__3.STAR_STAR_EQUAL;
var parseExpression = System.get("traceur@0.0.74/src/codegeneration/PlaceholderParser").parseExpression;
var ExponentiationTransformer = function ExponentiationTransformer() {
$traceurRuntime.superConstructor($ExponentiationTransformer).apply(this, arguments);
};
var $ExponentiationTransformer = ExponentiationTransformer;
($traceurRuntime.createClass)(ExponentiationTransformer, {transformBinaryExpression: function(tree) {
switch (tree.operator.type) {
case STAR_STAR:
var left = this.transformAny(tree.left);
var right = this.transformAny(tree.right);
return parseExpression($__0, left, right);
case STAR_STAR_EQUAL:
var exploded = new ExplodeExpressionTransformer(this).transformAny(tree);
return this.transformAny(exploded);
}
return $traceurRuntime.superGet(this, $ExponentiationTransformer.prototype, "transformBinaryExpression").call(this, tree);
}}, {}, TempVarTransformer);
return {get ExponentiationTransformer() {
return ExponentiationTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/ForOfTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/ForOfTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/ForOfTransformer", path);
}
var $__0 = Object.freeze(Object.defineProperties(["", " = ", ".value;"], {raw: {value: Object.freeze(["", " = ", ".value;"])}})),
$__1 = Object.freeze(Object.defineProperties(["\n for (var ", " =\n ", "[\n $traceurRuntime.toProperty(Symbol.iterator)](),\n ", ";\n !(", " = ", ".next()).done; ) {\n ", ";\n ", ";\n }"], {raw: {value: Object.freeze(["\n for (var ", " =\n ", "[\n $traceurRuntime.toProperty(Symbol.iterator)](),\n ", ";\n !(", " = ", ".next()).done; ) {\n ", ";\n ", ";\n }"])}}));
var VARIABLE_DECLARATION_LIST = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType").VARIABLE_DECLARATION_LIST;
var TempVarTransformer = System.get("traceur@0.0.74/src/codegeneration/TempVarTransformer").TempVarTransformer;
var $__4 = System.get("traceur@0.0.74/src/codegeneration/ParseTreeFactory"),
id = $__4.createIdentifierExpression,
createMemberExpression = $__4.createMemberExpression,
createVariableStatement = $__4.createVariableStatement;
var parseStatement = System.get("traceur@0.0.74/src/codegeneration/PlaceholderParser").parseStatement;
var ForOfTransformer = function ForOfTransformer() {
$traceurRuntime.superConstructor($ForOfTransformer).apply(this, arguments);
};
var $ForOfTransformer = ForOfTransformer;
($traceurRuntime.createClass)(ForOfTransformer, {transformForOfStatement: function(original) {
var tree = $traceurRuntime.superGet(this, $ForOfTransformer.prototype, "transformForOfStatement").call(this, original);
var iter = id(this.getTempIdentifier());
var result = id(this.getTempIdentifier());
var assignment;
if (tree.initializer.type === VARIABLE_DECLARATION_LIST) {
assignment = createVariableStatement(tree.initializer.declarationType, tree.initializer.declarations[0].lvalue, createMemberExpression(result, 'value'));
} else {
assignment = parseStatement($__0, tree.initializer, result);
}
return parseStatement($__1, iter, tree.collection, result, result, iter, assignment, tree.body);
}}, {}, TempVarTransformer);
return {get ForOfTransformer() {
return ForOfTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/GeneratorComprehensionTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/GeneratorComprehensionTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/GeneratorComprehensionTransformer", path);
}
var $__0 = Object.freeze(Object.defineProperties(["yield ", ""], {raw: {value: Object.freeze(["yield ", ""])}}));
var ComprehensionTransformer = System.get("traceur@0.0.74/src/codegeneration/ComprehensionTransformer").ComprehensionTransformer;
var parseStatement = System.get("traceur@0.0.74/src/codegeneration/PlaceholderParser").parseStatement;
var GeneratorComprehensionTransformer = function GeneratorComprehensionTransformer() {
$traceurRuntime.superConstructor($GeneratorComprehensionTransformer).apply(this, arguments);
};
var $GeneratorComprehensionTransformer = GeneratorComprehensionTransformer;
($traceurRuntime.createClass)(GeneratorComprehensionTransformer, {transformGeneratorComprehension: function(tree) {
var expression = this.transformAny(tree.expression);
var statement = parseStatement($__0, expression);
var isGenerator = true;
return this.transformComprehension(tree, statement, isGenerator);
}}, {}, ComprehensionTransformer);
return {get GeneratorComprehensionTransformer() {
return GeneratorComprehensionTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/generator/State", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/generator/State";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/generator/State", path);
}
var $__0 = Object.freeze(Object.defineProperties(["$ctx.finallyFallThrough = ", ""], {raw: {value: Object.freeze(["$ctx.finallyFallThrough = ", ""])}}));
var $__1 = System.get("traceur@0.0.74/src/codegeneration/ParseTreeFactory"),
createAssignStateStatement = $__1.createAssignStateStatement,
createBreakStatement = $__1.createBreakStatement,
createCaseClause = $__1.createCaseClause,
createNumberLiteral = $__1.createNumberLiteral;
var parseStatement = System.get("traceur@0.0.74/src/codegeneration/PlaceholderParser").parseStatement;
var State = function State(id) {
this.id = id;
};
($traceurRuntime.createClass)(State, {
transformMachineState: function(enclosingFinally, machineEndState, reporter) {
return createCaseClause(createNumberLiteral(this.id), this.transform(enclosingFinally, machineEndState, reporter));
},
transformBreak: function(labelSet, breakState) {
return this;
},
transformBreakOrContinue: function(labelSet) {
var breakState = arguments[1];
var continueState = arguments[2];
return this;
}
}, {});
State.START_STATE = 0;
State.INVALID_STATE = -1;
State.END_STATE = -2;
State.RETHROW_STATE = -3;
State.generateJump = function(enclosingFinally, fallThroughState) {
return $traceurRuntime.spread(State.generateAssignState(enclosingFinally, fallThroughState), [createBreakStatement()]);
};
State.generateAssignState = function(enclosingFinally, fallThroughState) {
var assignState;
if (State.isFinallyExit(enclosingFinally, fallThroughState)) {
assignState = generateAssignStateOutOfFinally(enclosingFinally, fallThroughState);
} else {
assignState = [createAssignStateStatement(fallThroughState)];
}
return assignState;
};
State.isFinallyExit = function(enclosingFinally, destination) {
return enclosingFinally != null && enclosingFinally.tryStates.indexOf(destination) < 0;
};
function generateAssignStateOutOfFinally(enclosingFinally, destination) {
var finallyState = enclosingFinally.finallyState;
return [createAssignStateStatement(finallyState), parseStatement($__0, destination)];
}
State.replaceStateList = function(oldStates, oldState, newState) {
var states = [];
for (var i = 0; i < oldStates.length; i++) {
states.push(State.replaceStateId(oldStates[i], oldState, newState));
}
return states;
};
State.replaceStateId = function(current, oldState, newState) {
return current == oldState ? newState : current;
};
State.replaceAllStates = function(exceptionBlocks, oldState, newState) {
var result = [];
for (var i = 0; i < exceptionBlocks.length; i++) {
result.push(exceptionBlocks[i].replaceState(oldState, newState));
}
return result;
};
return {get State() {
return State;
}};
});
System.register("traceur@0.0.74/src/codegeneration/generator/TryState", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/generator/TryState";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/generator/TryState", path);
}
var State = System.get("traceur@0.0.74/src/codegeneration/generator/State").State;
var Kind = {
CATCH: 'catch',
FINALLY: 'finally'
};
var TryState = function TryState(kind, tryStates, nestedTrys) {
this.kind = kind;
this.tryStates = tryStates;
this.nestedTrys = nestedTrys;
};
($traceurRuntime.createClass)(TryState, {
replaceAllStates: function(oldState, newState) {
return State.replaceStateList(this.tryStates, oldState, newState);
},
replaceNestedTrys: function(oldState, newState) {
var states = [];
for (var i = 0; i < this.nestedTrys.length; i++) {
states.push(this.nestedTrys[i].replaceState(oldState, newState));
}
return states;
}
}, {});
TryState.Kind = Kind;
return {get TryState() {
return TryState;
}};
});
System.register("traceur@0.0.74/src/syntax/trees/StateMachine", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/syntax/trees/StateMachine";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/syntax/trees/StateMachine", path);
}
var ParseTree = System.get("traceur@0.0.74/src/syntax/trees/ParseTree").ParseTree;
var STATE_MACHINE = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType").STATE_MACHINE;
var State = System.get("traceur@0.0.74/src/codegeneration/generator/State").State;
var TryState = System.get("traceur@0.0.74/src/codegeneration/generator/TryState").TryState;
function addCatchOrFinallyStates(kind, enclosingMap, tryStates) {
for (var i = 0; i < tryStates.length; i++) {
var tryState = tryStates[i];
if (tryState.kind == kind) {
for (var j = 0; j < tryState.tryStates.length; j++) {
var id = tryState.tryStates[j];
enclosingMap[id] = tryState;
}
}
addCatchOrFinallyStates(kind, enclosingMap, tryState.nestedTrys);
}
}
function addAllCatchStates(tryStates, catches) {
for (var i = 0; i < tryStates.length; i++) {
var tryState = tryStates[i];
if (tryState.kind == TryState.Kind.CATCH) {
catches.push(tryState);
}
addAllCatchStates(tryState.nestedTrys, catches);
}
}
var StateMachine = function StateMachine(startState, fallThroughState, states, exceptionBlocks) {
this.location = null;
this.startState = startState;
this.fallThroughState = fallThroughState;
this.states = states;
this.exceptionBlocks = exceptionBlocks;
};
var $StateMachine = StateMachine;
($traceurRuntime.createClass)(StateMachine, {
get type() {
return STATE_MACHINE;
},
transform: function(transformer) {
return transformer.transformStateMachine(this);
},
visit: function(visitor) {
visitor.visitStateMachine(this);
},
getAllStateIDs: function() {
var result = [];
for (var i = 0; i < this.states.length; i++) {
result.push(this.states[i].id);
}
return result;
},
getEnclosingFinallyMap: function() {
var enclosingMap = Object.create(null);
addCatchOrFinallyStates(TryState.Kind.FINALLY, enclosingMap, this.exceptionBlocks);
return enclosingMap;
},
allCatchStates: function() {
var catches = [];
addAllCatchStates(this.exceptionBlocks, catches);
return catches;
},
replaceStateId: function(oldState, newState) {
return new $StateMachine(State.replaceStateId(this.startState, oldState, newState), State.replaceStateId(this.fallThroughState, oldState, newState), State.replaceAllStates(this.states, oldState, newState), State.replaceAllStates(this.exceptionBlocks, oldState, newState));
},
replaceStartState: function(newState) {
return this.replaceStateId(this.startState, newState);
},
replaceFallThroughState: function(newState) {
return this.replaceStateId(this.fallThroughState, newState);
},
append: function(nextMachine) {
var states = $traceurRuntime.spread(this.states);
for (var i = 0; i < nextMachine.states.length; i++) {
var otherState = nextMachine.states[i];
states.push(otherState.replaceState(nextMachine.startState, this.fallThroughState));
}
var exceptionBlocks = $traceurRuntime.spread(this.exceptionBlocks);
for (var i = 0; i < nextMachine.exceptionBlocks.length; i++) {
var tryState = nextMachine.exceptionBlocks[i];
exceptionBlocks.push(tryState.replaceState(nextMachine.startState, this.fallThroughState));
}
return new $StateMachine(this.startState, nextMachine.fallThroughState, states, exceptionBlocks);
}
}, {}, ParseTree);
return {get StateMachine() {
return StateMachine;
}};
});
System.register("traceur@0.0.74/src/codegeneration/generator/AwaitState", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/generator/AwaitState";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/generator/AwaitState", path);
}
var $__0 = Object.freeze(Object.defineProperties(["$ctx.finallyFallThrough = ", ""], {raw: {value: Object.freeze(["$ctx.finallyFallThrough = ", ""])}})),
$__1 = Object.freeze(Object.defineProperties(["Promise.resolve(", ").then(\n $ctx.createCallback(", "), $ctx.errback);\n return;"], {raw: {value: Object.freeze(["Promise.resolve(", ").then(\n $ctx.createCallback(", "), $ctx.errback);\n return;"])}}));
var State = System.get("traceur@0.0.74/src/codegeneration/generator/State").State;
var parseStatements = System.get("traceur@0.0.74/src/codegeneration/PlaceholderParser").parseStatements;
var AwaitState = function AwaitState(id, callbackState, expression) {
$traceurRuntime.superConstructor($AwaitState).call(this, id), this.callbackState = callbackState;
this.expression = expression;
};
var $AwaitState = AwaitState;
($traceurRuntime.createClass)(AwaitState, {
replaceState: function(oldState, newState) {
return new $AwaitState(State.replaceStateId(this.id, oldState, newState), State.replaceStateId(this.callbackState, oldState, newState), this.expression);
},
transform: function(enclosingFinally, machineEndState, reporter) {
var $__5;
var stateId,
statements;
if (State.isFinallyExit(enclosingFinally, this.callbackState)) {
stateId = enclosingFinally.finallyState;
statements = parseStatements($__0, this.callbackState);
} else {
stateId = this.callbackState;
statements = [];
}
($__5 = statements).push.apply($__5, $traceurRuntime.spread(parseStatements($__1, this.expression, stateId)));
return statements;
}
}, {}, State);
return {get AwaitState() {
return AwaitState;
}};
});
System.register("traceur@0.0.74/src/codegeneration/HoistVariablesTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/HoistVariablesTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/HoistVariablesTransformer", path);
}
var $__0 = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees"),
AnonBlock = $__0.AnonBlock,
Catch = $__0.Catch,
FunctionBody = $__0.FunctionBody,
ForInStatement = $__0.ForInStatement,
ForOfStatement = $__0.ForOfStatement,
ForStatement = $__0.ForStatement,
VariableDeclarationList = $__0.VariableDeclarationList,
VariableStatement = $__0.VariableStatement;
var $__1 = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType"),
OBJECT_PATTERN = $__1.OBJECT_PATTERN,
VARIABLE_DECLARATION_LIST = $__1.VARIABLE_DECLARATION_LIST;
var ParseTreeTransformer = System.get("traceur@0.0.74/src/codegeneration/ParseTreeTransformer").ParseTreeTransformer;
var VAR = System.get("traceur@0.0.74/src/syntax/TokenType").VAR;
var $__4 = System.get("traceur@0.0.74/src/codegeneration/ParseTreeFactory"),
createAssignmentExpression = $__4.createAssignmentExpression,
createCommaExpression = $__4.createCommaExpression,
createExpressionStatement = $__4.createExpressionStatement,
id = $__4.createIdentifierExpression,
createParenExpression = $__4.createParenExpression,
createVariableDeclaration = $__4.createVariableDeclaration;
var prependStatements = System.get("traceur@0.0.74/src/codegeneration/PrependStatements").prependStatements;
var HoistVariablesTransformer = function HoistVariablesTransformer() {
var shouldHoistFunctions = arguments[0] !== (void 0) ? arguments[0] : false;
$traceurRuntime.superConstructor($HoistVariablesTransformer).call(this);
this.hoistedFunctions_ = [];
this.hoistedVariables_ = Object.create(null);
this.keepBindingIdentifiers_ = false;
this.inBlockOrFor_ = false;
this.shouldHoistFunctions_ = shouldHoistFunctions;
};
var $HoistVariablesTransformer = HoistVariablesTransformer;
($traceurRuntime.createClass)(HoistVariablesTransformer, {
transformFunctionBody: function(tree) {
var statements = this.transformList(tree.statements);
if (statements === tree.statements)
return tree;
statements = this.prependVariables(statements);
statements = this.prependFunctions(statements);
return new FunctionBody(tree.location, statements);
},
addVariable: function(name) {
this.hoistedVariables_[name] = true;
},
addFunctionDeclaration: function(tree) {
this.hoistedFunctions_.push(tree);
},
hasVariables: function() {
for (var key in this.hoistedVariables_) {
return true;
}
return false;
},
hasFunctions: function() {
return this.hoistedFunctions_.length > 0;
},
getVariableNames: function() {
return Object.keys(this.hoistedVariables_);
},
getVariableStatement: function() {
if (!this.hasVariables())
return new AnonBlock(null, []);
var declarations = this.getVariableNames().map((function(name) {
return createVariableDeclaration(name, null);
}));
return new VariableStatement(null, new VariableDeclarationList(null, VAR, declarations));
},
getFunctions: function() {
return this.hoistedFunctions_;
},
prependVariables: function(statements) {
if (!this.hasVariables())
return statements;
return prependStatements(statements, this.getVariableStatement());
},
prependFunctions: function(statements) {
if (!this.hasFunctions())
return statements;
return prependStatements(statements, this.getFunctionDeclarations());
},
transformVariableStatement: function(tree) {
var declarations = this.transformAny(tree.declarations);
if (declarations == tree.declarations)
return tree;
if (declarations === null)
return new AnonBlock(null, []);
if (declarations.type === VARIABLE_DECLARATION_LIST)
return new VariableStatement(tree.location, declarations);
return createExpressionStatement(declarations);
},
transformVariableDeclaration: function(tree) {
var lvalue = this.transformAny(tree.lvalue);
var initializer = this.transformAny(tree.initializer);
if (initializer) {
var expression = createAssignmentExpression(lvalue, initializer);
if (lvalue.type === OBJECT_PATTERN)
expression = createParenExpression(expression);
return expression;
}
return null;
},
transformObjectPattern: function(tree) {
var keepBindingIdentifiers = this.keepBindingIdentifiers_;
this.keepBindingIdentifiers_ = true;
var transformed = $traceurRuntime.superGet(this, $HoistVariablesTransformer.prototype, "transformObjectPattern").call(this, tree);
this.keepBindingIdentifiers_ = keepBindingIdentifiers;
return transformed;
},
transformArrayPattern: function(tree) {
var keepBindingIdentifiers = this.keepBindingIdentifiers_;
this.keepBindingIdentifiers_ = true;
var transformed = $traceurRuntime.superGet(this, $HoistVariablesTransformer.prototype, "transformArrayPattern").call(this, tree);
this.keepBindingIdentifiers_ = keepBindingIdentifiers;
return transformed;
},
transformBindingIdentifier: function(tree) {
var idToken = tree.identifierToken;
this.addVariable(idToken.value);
if (this.keepBindingIdentifiers_)
return tree;
return id(idToken);
},
transformVariableDeclarationList: function(tree) {
if (tree.declarationType === VAR || !this.inBlockOrFor_) {
var expressions = this.transformList(tree.declarations);
expressions = expressions.filter((function(tree) {
return tree;
}));
if (expressions.length === 0)
return null;
if (expressions.length == 1)
return expressions[0];
return createCommaExpression(expressions);
}
return tree;
},
transformCatch: function(tree) {
var catchBody = this.transformAny(tree.catchBody);
if (catchBody === tree.catchBody)
return tree;
return new Catch(tree.location, tree.binding, catchBody);
},
transformForInStatement: function(tree) {
return this.transformLoop_(tree, ForInStatement);
},
transformForOfStatement: function(tree) {
return this.transformLoop_(tree, ForOfStatement);
},
transformLoop_: function(tree, ctor) {
var initializer = this.transformLoopIninitaliser_(tree.initializer);
var collection = this.transformAny(tree.collection);
var body = this.transformAny(tree.body);
if (initializer === tree.initializer && collection === tree.collection && body === tree.body) {
return tree;
}
return new ctor(tree.location, initializer, collection, body);
},
transformLoopIninitaliser_: function(tree) {
if (tree.type !== VARIABLE_DECLARATION_LIST || tree.declarationType !== VAR)
return tree;
return this.transformAny(tree.declarations[0].lvalue);
},
transformForStatement: function(tree) {
var inBlockOrFor = this.inBlockOrFor_;
this.inBlockOrFor_ = true;
var initializer = this.transformAny(tree.initializer);
this.inBlockOrFor_ = inBlockOrFor;
var condition = this.transformAny(tree.condition);
var increment = this.transformAny(tree.increment);
var body = this.transformAny(tree.body);
if (initializer === tree.initializer && condition === tree.condition && increment === tree.increment && body === tree.body) {
return tree;
}
return new ForStatement(tree.location, initializer, condition, increment, body);
},
transformBlock: function(tree) {
var inBlockOrFor = this.inBlockOrFor_;
this.inBlockOrFor_ = true;
tree = $traceurRuntime.superGet(this, $HoistVariablesTransformer.prototype, "transformBlock").call(this, tree);
this.inBlockOrFor_ = inBlockOrFor;
return tree;
},
addMachineVariable: function(name) {
this.machineVariables_[name] = true;
},
transformClassDeclaration: function(tree) {
return tree;
},
transformClassExpression: function(tree) {
return tree;
},
transformFunctionDeclaration: function(tree) {
if (this.shouldHoistFunctions_) {
this.addFunctionDeclaration(tree);
return new AnonBlock(null, []);
}
return tree;
},
transformFunctionExpression: function(tree) {
return tree;
},
transformGetAccessor: function(tree) {
return tree;
},
transformSetAccessor: function(tree) {
return tree;
},
transformPropertyMethodAssignment: function(tree) {
return tree;
},
transformArrowFunctionExpression: function(tree) {
return tree;
},
transformComprehensionFor: function(tree) {
return tree;
}
}, {}, ParseTreeTransformer);
var $__default = HoistVariablesTransformer;
return {get default() {
return $__default;
}};
});
System.register("traceur@0.0.74/src/codegeneration/generator/FallThroughState", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/generator/FallThroughState";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/generator/FallThroughState", path);
}
var State = System.get("traceur@0.0.74/src/codegeneration/generator/State").State;
var FallThroughState = function FallThroughState(id, fallThroughState, statements) {
$traceurRuntime.superConstructor($FallThroughState).call(this, id);
this.fallThroughState = fallThroughState;
this.statements = statements;
};
var $FallThroughState = FallThroughState;
($traceurRuntime.createClass)(FallThroughState, {
replaceState: function(oldState, newState) {
return new $FallThroughState(State.replaceStateId(this.id, oldState, newState), State.replaceStateId(this.fallThroughState, oldState, newState), this.statements);
},
transform: function(enclosingFinally, machineEndState, reporter) {
return $traceurRuntime.spread(this.statements, State.generateJump(enclosingFinally, this.fallThroughState));
}
}, {}, State);
return {get FallThroughState() {
return FallThroughState;
}};
});
System.register("traceur@0.0.74/src/codegeneration/generator/BreakState", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/generator/BreakState";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/generator/BreakState", path);
}
var FallThroughState = System.get("traceur@0.0.74/src/codegeneration/generator/FallThroughState").FallThroughState;
var State = System.get("traceur@0.0.74/src/codegeneration/generator/State").State;
var BreakState = function BreakState(id, label) {
$traceurRuntime.superConstructor($BreakState).call(this, id);
this.label = label;
};
var $BreakState = BreakState;
($traceurRuntime.createClass)(BreakState, {
replaceState: function(oldState, newState) {
return new $BreakState(State.replaceStateId(this.id, oldState, newState), this.label);
},
transform: function(enclosingFinally, machineEndState, reporter) {
throw new Error('These should be removed before the transform step');
},
transformBreak: function(labelSet) {
var breakState = arguments[1];
if (this.label == null)
return new FallThroughState(this.id, breakState, []);
if (this.label in labelSet) {
return new FallThroughState(this.id, labelSet[this.label].fallThroughState, []);
}
return this;
},
transformBreakOrContinue: function(labelSet) {
var breakState = arguments[1];
var continueState = arguments[2];
return this.transformBreak(labelSet, breakState);
}
}, {}, State);
return {get BreakState() {
return BreakState;
}};
});
System.register("traceur@0.0.74/src/codegeneration/generator/ContinueState", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/generator/ContinueState";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/generator/ContinueState", path);
}
var FallThroughState = System.get("traceur@0.0.74/src/codegeneration/generator/FallThroughState").FallThroughState;
var State = System.get("traceur@0.0.74/src/codegeneration/generator/State").State;
var ContinueState = function ContinueState(id, label) {
$traceurRuntime.superConstructor($ContinueState).call(this, id);
this.label = label;
};
var $ContinueState = ContinueState;
($traceurRuntime.createClass)(ContinueState, {
replaceState: function(oldState, newState) {
return new $ContinueState(State.replaceStateId(this.id, oldState, newState), this.label);
},
transform: function(enclosingFinally, machineEndState, reporter) {
throw new Error('These should be removed before the transform step');
},
transformBreakOrContinue: function(labelSet) {
var breakState = arguments[1];
var continueState = arguments[2];
if (this.label == null)
return new FallThroughState(this.id, continueState, []);
if (this.label in labelSet) {
return new FallThroughState(this.id, labelSet[this.label].continueState, []);
}
return this;
}
}, {}, State);
return {get ContinueState() {
return ContinueState;
}};
});
System.register("traceur@0.0.74/src/codegeneration/generator/BreakContinueTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/generator/BreakContinueTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/generator/BreakContinueTransformer", path);
}
var BreakState = System.get("traceur@0.0.74/src/codegeneration/generator/BreakState").BreakState;
var ContinueState = System.get("traceur@0.0.74/src/codegeneration/generator/ContinueState").ContinueState;
var ParseTreeTransformer = System.get("traceur@0.0.74/src/codegeneration/ParseTreeTransformer").ParseTreeTransformer;
var StateMachine = System.get("traceur@0.0.74/src/syntax/trees/StateMachine").StateMachine;
function safeGetLabel(tree) {
return tree.name ? tree.name.value : null;
}
var BreakContinueTransformer = function BreakContinueTransformer(stateAllocator) {
$traceurRuntime.superConstructor($BreakContinueTransformer).call(this);
this.transformBreaks_ = true;
this.stateAllocator_ = stateAllocator;
};
var $BreakContinueTransformer = BreakContinueTransformer;
($traceurRuntime.createClass)(BreakContinueTransformer, {
allocateState_: function() {
return this.stateAllocator_.allocateState();
},
stateToStateMachine_: function(newState) {
var fallThroughState = this.allocateState_();
return new StateMachine(newState.id, fallThroughState, [newState], []);
},
transformBreakStatement: function(tree) {
return this.transformBreaks_ || tree.name ? this.stateToStateMachine_(new BreakState(this.allocateState_(), safeGetLabel(tree))) : tree;
},
transformContinueStatement: function(tree) {
return this.stateToStateMachine_(new ContinueState(this.allocateState_(), safeGetLabel(tree)));
},
transformDoWhileStatement: function(tree) {
return tree;
},
transformForOfStatement: function(tree) {
return tree;
},
transformForStatement: function(tree) {
return tree;
},
transformFunctionDeclaration: function(tree) {
return tree;
},
transformFunctionExpression: function(tree) {
return tree;
},
transformStateMachine: function(tree) {
return tree;
},
transformSwitchStatement: function(tree) {
var oldState = this.transformBreaks_;
this.transformBreaks_ = false;
var result = $traceurRuntime.superGet(this, $BreakContinueTransformer.prototype, "transformSwitchStatement").call(this, tree);
this.transformBreaks_ = oldState;
return result;
},
transformWhileStatement: function(tree) {
return tree;
}
}, {}, ParseTreeTransformer);
return {get BreakContinueTransformer() {
return BreakContinueTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/generator/CatchState", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/generator/CatchState";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/generator/CatchState", path);
}
var State = System.get("traceur@0.0.74/src/codegeneration/generator/State").State;
var TryState = System.get("traceur@0.0.74/src/codegeneration/generator/TryState").TryState;
var CatchState = function CatchState(identifier, catchState, fallThroughState, allStates, nestedTrys) {
$traceurRuntime.superConstructor($CatchState).call(this, TryState.Kind.CATCH, allStates, nestedTrys);
this.identifier = identifier;
this.catchState = catchState;
this.fallThroughState = fallThroughState;
};
var $CatchState = CatchState;
($traceurRuntime.createClass)(CatchState, {replaceState: function(oldState, newState) {
return new $CatchState(this.identifier, State.replaceStateId(this.catchState, oldState, newState), State.replaceStateId(this.fallThroughState, oldState, newState), this.replaceAllStates(oldState, newState), this.replaceNestedTrys(oldState, newState));
}}, {}, TryState);
return {get CatchState() {
return CatchState;
}};
});
System.register("traceur@0.0.74/src/codegeneration/generator/ConditionalState", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/generator/ConditionalState";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/generator/ConditionalState", path);
}
var $__0 = Object.freeze(Object.defineProperties(["$ctx.state = (", ") ? ", " : ", ";\n break"], {raw: {value: Object.freeze(["$ctx.state = (", ") ? ", " : ", ";\n break"])}}));
var State = System.get("traceur@0.0.74/src/codegeneration/generator/State").State;
var $__2 = System.get("traceur@0.0.74/src/codegeneration/ParseTreeFactory"),
createBlock = $__2.createBlock,
createIfStatement = $__2.createIfStatement;
var parseStatements = System.get("traceur@0.0.74/src/codegeneration/PlaceholderParser").parseStatements;
var ConditionalState = function ConditionalState(id, ifState, elseState, condition) {
$traceurRuntime.superConstructor($ConditionalState).call(this, id);
this.ifState = ifState;
this.elseState = elseState;
this.condition = condition;
};
var $ConditionalState = ConditionalState;
($traceurRuntime.createClass)(ConditionalState, {
replaceState: function(oldState, newState) {
return new $ConditionalState(State.replaceStateId(this.id, oldState, newState), State.replaceStateId(this.ifState, oldState, newState), State.replaceStateId(this.elseState, oldState, newState), this.condition);
},
transform: function(enclosingFinally, machineEndState, reporter) {
if (State.isFinallyExit(enclosingFinally, this.ifState) || State.isFinallyExit(enclosingFinally, this.elseState)) {
return [createIfStatement(this.condition, createBlock(State.generateJump(enclosingFinally, this.ifState)), createBlock(State.generateJump(enclosingFinally, this.elseState)))];
}
return parseStatements($__0, this.condition, this.ifState, this.elseState);
}
}, {}, State);
return {get ConditionalState() {
return ConditionalState;
}};
});
System.register("traceur@0.0.74/src/codegeneration/generator/FinallyFallThroughState", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/generator/FinallyFallThroughState";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/generator/FinallyFallThroughState", path);
}
var State = System.get("traceur@0.0.74/src/codegeneration/generator/State").State;
var FinallyFallThroughState = function FinallyFallThroughState() {
$traceurRuntime.superConstructor($FinallyFallThroughState).apply(this, arguments);
};
var $FinallyFallThroughState = FinallyFallThroughState;
($traceurRuntime.createClass)(FinallyFallThroughState, {
replaceState: function(oldState, newState) {
return new $FinallyFallThroughState(State.replaceStateId(this.id, oldState, newState));
},
transformMachineState: function(enclosingFinally, machineEndState, reporter) {
return null;
},
transform: function(enclosingFinally, machineEndState, reporter) {
throw new Error('these are generated in addFinallyFallThroughDispatches');
}
}, {}, State);
return {get FinallyFallThroughState() {
return FinallyFallThroughState;
}};
});
System.register("traceur@0.0.74/src/codegeneration/generator/FinallyState", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/generator/FinallyState";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/generator/FinallyState", path);
}
var State = System.get("traceur@0.0.74/src/codegeneration/generator/State").State;
var TryState = System.get("traceur@0.0.74/src/codegeneration/generator/TryState").TryState;
var FinallyState = function FinallyState(finallyState, fallThroughState, allStates, nestedTrys) {
$traceurRuntime.superConstructor($FinallyState).call(this, TryState.Kind.FINALLY, allStates, nestedTrys);
this.finallyState = finallyState;
this.fallThroughState = fallThroughState;
};
var $FinallyState = FinallyState;
($traceurRuntime.createClass)(FinallyState, {replaceState: function(oldState, newState) {
return new $FinallyState(State.replaceStateId(this.finallyState, oldState, newState), State.replaceStateId(this.fallThroughState, oldState, newState), this.replaceAllStates(oldState, newState), this.replaceNestedTrys(oldState, newState));
}}, {}, TryState);
return {get FinallyState() {
return FinallyState;
}};
});
System.register("traceur@0.0.74/src/codegeneration/generator/StateAllocator", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/generator/StateAllocator";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/generator/StateAllocator", path);
}
var State = System.get("traceur@0.0.74/src/codegeneration/generator/State").State;
var StateAllocator = function StateAllocator() {
this.nextState_ = State.START_STATE + 1;
};
($traceurRuntime.createClass)(StateAllocator, {allocateState: function() {
return this.nextState_++;
}}, {});
return {get StateAllocator() {
return StateAllocator;
}};
});
System.register("traceur@0.0.74/src/codegeneration/generator/SwitchState", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/generator/SwitchState";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/generator/SwitchState", path);
}
var $__0 = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees"),
CaseClause = $__0.CaseClause,
DefaultClause = $__0.DefaultClause,
SwitchStatement = $__0.SwitchStatement;
var State = System.get("traceur@0.0.74/src/codegeneration/generator/State").State;
var createBreakStatement = System.get("traceur@0.0.74/src/codegeneration/ParseTreeFactory").createBreakStatement;
var SwitchClause = function SwitchClause(first, second) {
this.first = first;
this.second = second;
};
($traceurRuntime.createClass)(SwitchClause, {}, {});
var SwitchState = function SwitchState(id, expression, clauses) {
$traceurRuntime.superConstructor($SwitchState).call(this, id);
this.expression = expression;
this.clauses = clauses;
};
var $SwitchState = SwitchState;
($traceurRuntime.createClass)(SwitchState, {
replaceState: function(oldState, newState) {
var clauses = this.clauses.map((function(clause) {
return new SwitchClause(clause.first, State.replaceStateId(clause.second, oldState, newState));
}));
return new $SwitchState(State.replaceStateId(this.id, oldState, newState), this.expression, clauses);
},
transform: function(enclosingFinally, machineEndState, reporter) {
var clauses = [];
for (var i = 0; i < this.clauses.length; i++) {
var clause = this.clauses[i];
if (clause.first == null) {
clauses.push(new DefaultClause(null, State.generateJump(enclosingFinally, clause.second)));
} else {
clauses.push(new CaseClause(null, clause.first, State.generateJump(enclosingFinally, clause.second)));
}
}
return [new SwitchStatement(null, this.expression, clauses), createBreakStatement()];
}
}, {}, State);
return {
get SwitchClause() {
return SwitchClause;
},
get SwitchState() {
return SwitchState;
}
};
});
System.register("traceur@0.0.74/src/codegeneration/generator/CPSTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/generator/CPSTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/generator/CPSTransformer", path);
}
var $__0 = Object.freeze(Object.defineProperties(["$ctx.pushTry(\n ", ",\n ", ");"], {raw: {value: Object.freeze(["$ctx.pushTry(\n ", ",\n ", ");"])}})),
$__1 = Object.freeze(Object.defineProperties(["$ctx.popTry();"], {raw: {value: Object.freeze(["$ctx.popTry();"])}})),
$__2 = Object.freeze(Object.defineProperties(["\n $ctx.popTry();\n ", " = $ctx.storedException;"], {raw: {value: Object.freeze(["\n $ctx.popTry();\n ", " = $ctx.storedException;"])}})),
$__3 = Object.freeze(Object.defineProperties(["$ctx.popTry();"], {raw: {value: Object.freeze(["$ctx.popTry();"])}})),
$__4 = Object.freeze(Object.defineProperties(["function($ctx) {\n while (true) ", "\n }"], {raw: {value: Object.freeze(["function($ctx) {\n while (true) ", "\n }"])}})),
$__5 = Object.freeze(Object.defineProperties(["var $arguments = arguments;"], {raw: {value: Object.freeze(["var $arguments = arguments;"])}})),
$__6 = Object.freeze(Object.defineProperties(["return ", "(\n ", ",\n ", ", this);"], {raw: {value: Object.freeze(["return ", "(\n ", ",\n ", ", this);"])}})),
$__7 = Object.freeze(Object.defineProperties(["return ", "(\n ", ", this);"], {raw: {value: Object.freeze(["return ", "(\n ", ", this);"])}})),
$__8 = Object.freeze(Object.defineProperties(["return $ctx.end()"], {raw: {value: Object.freeze(["return $ctx.end()"])}})),
$__9 = Object.freeze(Object.defineProperties(["\n $ctx.state = $ctx.finallyFallThrough;\n $ctx.finallyFallThrough = ", ";\n break;"], {raw: {value: Object.freeze(["\n $ctx.state = $ctx.finallyFallThrough;\n $ctx.finallyFallThrough = ", ";\n break;"])}})),
$__10 = Object.freeze(Object.defineProperties(["\n $ctx.state = $ctx.finallyFallThrough;\n break;"], {raw: {value: Object.freeze(["\n $ctx.state = $ctx.finallyFallThrough;\n break;"])}}));
var AlphaRenamer = System.get("traceur@0.0.74/src/codegeneration/AlphaRenamer").AlphaRenamer;
var BreakContinueTransformer = System.get("traceur@0.0.74/src/codegeneration/generator/BreakContinueTransformer").BreakContinueTransformer;
var $__13 = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType"),
BLOCK = $__13.BLOCK,
CASE_CLAUSE = $__13.CASE_CLAUSE,
CONDITIONAL_EXPRESSION = $__13.CONDITIONAL_EXPRESSION,
EXPRESSION_STATEMENT = $__13.EXPRESSION_STATEMENT,
PAREN_EXPRESSION = $__13.PAREN_EXPRESSION,
STATE_MACHINE = $__13.STATE_MACHINE;
var $__14 = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees"),
AnonBlock = $__14.AnonBlock,
Block = $__14.Block,
CaseClause = $__14.CaseClause,
IfStatement = $__14.IfStatement,
SwitchStatement = $__14.SwitchStatement;
var CatchState = System.get("traceur@0.0.74/src/codegeneration/generator/CatchState").CatchState;
var ConditionalState = System.get("traceur@0.0.74/src/codegeneration/generator/ConditionalState").ConditionalState;
var ExplodeExpressionTransformer = System.get("traceur@0.0.74/src/codegeneration/ExplodeExpressionTransformer").ExplodeExpressionTransformer;
var FallThroughState = System.get("traceur@0.0.74/src/codegeneration/generator/FallThroughState").FallThroughState;
var FinallyFallThroughState = System.get("traceur@0.0.74/src/codegeneration/generator/FinallyFallThroughState").FinallyFallThroughState;
var FinallyState = System.get("traceur@0.0.74/src/codegeneration/generator/FinallyState").FinallyState;
var FindInFunctionScope = System.get("traceur@0.0.74/src/codegeneration/FindInFunctionScope").FindInFunctionScope;
var ParseTreeTransformer = System.get("traceur@0.0.74/src/codegeneration/ParseTreeTransformer").ParseTreeTransformer;
var TempVarTransformer = System.get("traceur@0.0.74/src/codegeneration/TempVarTransformer").TempVarTransformer;
var assert = System.get("traceur@0.0.74/src/util/assert").assert;
var $__25 = System.get("traceur@0.0.74/src/codegeneration/PlaceholderParser"),
parseExpression = $__25.parseExpression,
parseStatement = $__25.parseStatement,
parseStatements = $__25.parseStatements;
var State = System.get("traceur@0.0.74/src/codegeneration/generator/State").State;
var StateAllocator = System.get("traceur@0.0.74/src/codegeneration/generator/StateAllocator").StateAllocator;
var StateMachine = System.get("traceur@0.0.74/src/syntax/trees/StateMachine").StateMachine;
var $__29 = System.get("traceur@0.0.74/src/codegeneration/generator/SwitchState"),
SwitchClause = $__29.SwitchClause,
SwitchState = $__29.SwitchState;
var TryState = System.get("traceur@0.0.74/src/codegeneration/generator/TryState").TryState;
var $__31 = System.get("traceur@0.0.74/src/codegeneration/ParseTreeFactory"),
createAssignStateStatement = $__31.createAssignStateStatement,
createBreakStatement = $__31.createBreakStatement,
createCaseClause = $__31.createCaseClause,
createDefaultClause = $__31.createDefaultClause,
createExpressionStatement = $__31.createExpressionStatement,
createFunctionBody = $__31.createFunctionBody,
id = $__31.createIdentifierExpression,
createMemberExpression = $__31.createMemberExpression,
createNumberLiteral = $__31.createNumberLiteral,
createSwitchStatement = $__31.createSwitchStatement;
var HoistVariablesTransformer = System.get("traceur@0.0.74/src/codegeneration/HoistVariablesTransformer").default;
var LabelState = function LabelState(name, continueState, fallThroughState) {
this.name = name;
this.continueState = continueState;
this.fallThroughState = fallThroughState;
};
($traceurRuntime.createClass)(LabelState, {}, {});
var NeedsStateMachine = function NeedsStateMachine() {
$traceurRuntime.superConstructor($NeedsStateMachine).apply(this, arguments);
};
var $NeedsStateMachine = NeedsStateMachine;
($traceurRuntime.createClass)(NeedsStateMachine, {
visitBreakStatement: function(tree) {
this.found = true;
},
visitContinueStatement: function(tree) {
this.found = true;
},
visitStateMachine: function(tree) {
this.found = true;
},
visitYieldExpression: function(tee) {
this.found = true;
}
}, {}, FindInFunctionScope);
function needsStateMachine(tree) {
var visitor = new NeedsStateMachine(tree);
return visitor.found;
}
var HoistVariables = function HoistVariables() {
$traceurRuntime.superConstructor($HoistVariables).call(this, true);
};
var $HoistVariables = HoistVariables;
($traceurRuntime.createClass)(HoistVariables, {
prependVariables: function(statements) {
return statements;
},
prependFunctions: function(statements) {
return statements;
}
}, {}, HoistVariablesTransformer);
var CPSTransformer = function CPSTransformer(identifierGenerator, reporter) {
$traceurRuntime.superConstructor($CPSTransformer).call(this, identifierGenerator);
this.reporter = reporter;
this.stateAllocator_ = new StateAllocator();
this.labelSet_ = Object.create(null);
this.currentLabel_ = null;
this.hoistVariablesTransformer_ = new HoistVariables();
};
var $CPSTransformer = CPSTransformer;
($traceurRuntime.createClass)(CPSTransformer, {
expressionNeedsStateMachine: function(tree) {
return false;
},
allocateState: function() {
return this.stateAllocator_.allocateState();
},
transformBlock: function(tree) {
var labels = this.getLabels_();
var label = this.clearCurrentLabel_();
var transformedTree = $traceurRuntime.superGet(this, $CPSTransformer.prototype, "transformBlock").call(this, tree);
var machine = this.transformStatementList_(transformedTree.statements);
if (machine === null)
return transformedTree;
if (label) {
var states = [];
for (var i = 0; i < machine.states.length; i++) {
var state = machine.states[i];
states.push(state.transformBreakOrContinue(labels));
}
machine = new StateMachine(machine.startState, machine.fallThroughState, states, machine.exceptionBlocks);
}
return machine;
},
transformFunctionBody: function(tree) {
this.pushTempScope();
var oldLabels = this.clearLabels_();
var transformedTree = $traceurRuntime.superGet(this, $CPSTransformer.prototype, "transformFunctionBody").call(this, tree);
var machine = this.transformStatementList_(transformedTree.statements);
this.restoreLabels_(oldLabels);
this.popTempScope();
return machine == null ? transformedTree : machine;
},
transformStatementList_: function(trees) {
var groups = [];
var newMachine;
for (var i = 0; i < trees.length; i++) {
if (trees[i].type === STATE_MACHINE) {
groups.push(trees[i]);
} else if (needsStateMachine(trees[i])) {
newMachine = this.ensureTransformed_(trees[i]);
groups.push(newMachine);
} else {
var last = groups[groups.length - 1];
if (!(last instanceof Array))
groups.push(last = []);
last.push(trees[i]);
}
}
if (groups.length === 1 && groups[0] instanceof Array)
return null;
var machine = null;
for (var i = 0; i < groups.length; i++) {
if (groups[i] instanceof Array) {
newMachine = this.statementsToStateMachine_(groups[i]);
} else {
newMachine = groups[i];
}
if (i === 0)
machine = newMachine;
else
machine = machine.append(newMachine);
}
return machine;
},
needsStateMachine_: function(statements) {
if (statements instanceof Array) {
for (var i = 0; i < statements.length; i++) {
if (needsStateMachine(statements[i]))
return true;
}
return false;
}
assert(statements instanceof SwitchStatement);
return needsStateMachine(statements);
},
transformCaseClause: function(tree) {
var result = $traceurRuntime.superGet(this, $CPSTransformer.prototype, "transformCaseClause").call(this, tree);
var machine = this.transformStatementList_(result.statements);
return machine == null ? result : new CaseClause(null, result.expression, [machine]);
},
transformDoWhileStatement: function(tree) {
var $__37;
var $__35,
$__36;
var labels = this.getLabels_();
var label = this.clearCurrentLabel_();
var machine,
condition,
body;
if (this.expressionNeedsStateMachine(tree.condition)) {
(($__35 = this.expressionToStateMachine(tree.condition), machine = $__35.machine, condition = $__35.expression, $__35));
body = this.transformAny(tree.body);
} else {
var result = $traceurRuntime.superGet(this, $CPSTransformer.prototype, "transformDoWhileStatement").call(this, tree);
(($__36 = result, condition = $__36.condition, body = $__36.body, $__36));
if (body.type != STATE_MACHINE)
return result;
}
var loopBodyMachine = this.ensureTransformed_(body);
var startState = loopBodyMachine.startState;
var conditionState = loopBodyMachine.fallThroughState;
var fallThroughState = this.allocateState();
var states = [];
this.addLoopBodyStates_(loopBodyMachine, conditionState, fallThroughState, labels, states);
if (machine) {
machine = machine.replaceStartState(conditionState);
conditionState = machine.fallThroughState;
($__37 = states).push.apply($__37, $traceurRuntime.spread(machine.states));
}
states.push(new ConditionalState(conditionState, startState, fallThroughState, condition));
var machine = new StateMachine(startState, fallThroughState, states, loopBodyMachine.exceptionBlocks);
if (label)
machine = machine.replaceStateId(conditionState, label.continueState);
return machine;
},
addLoopBodyStates_: function(loopBodyMachine, continueState, breakState, labels, states) {
for (var i = 0; i < loopBodyMachine.states.length; i++) {
var state = loopBodyMachine.states[i];
states.push(state.transformBreakOrContinue(labels, breakState, continueState));
}
},
transformForStatement: function(tree) {
var $__37,
$__38,
$__39;
var labels = this.getLabels_();
var label = this.clearCurrentLabel_();
var tmp;
var initializer = null,
initializerMachine;
if (tree.initializer) {
if (this.expressionNeedsStateMachine(tree.initializer)) {
tmp = this.expressionToStateMachine(tree.initializer);
initializer = tmp.expression;
initializerMachine = tmp.machine;
} else {
initializer = this.transformAny(tree.initializer);
}
}
var condition = null,
conditionMachine;
if (tree.condition) {
if (this.expressionNeedsStateMachine(tree.condition)) {
tmp = this.expressionToStateMachine(tree.condition);
condition = tmp.expression;
conditionMachine = tmp.machine;
} else {
condition = this.transformAny(tree.condition);
}
}
var increment = null,
incrementMachine;
if (tree.increment) {
if (this.expressionNeedsStateMachine(tree.increment)) {
tmp = this.expressionToStateMachine(tree.increment);
increment = tmp.expression;
incrementMachine = tmp.machine;
} else {
increment = this.transformAny(tree.increment);
}
}
var body = this.transformAny(tree.body);
if (initializer === tree.initializer && condition === tree.condition && increment === tree.increment && body === tree.body) {
return tree;
}
if (!initializerMachine && !conditionMachine && !incrementMachine && body.type !== STATE_MACHINE) {
return new ForStatement(tree.location, initializer, condition, increment, body);
}
var loopBodyMachine = this.ensureTransformed_(body);
var bodyFallThroughId = loopBodyMachine.fallThroughState;
var fallThroughId = this.allocateState();
var startId;
var initializerStartId = initializer ? this.allocateState() : State.INVALID_STATE;
var conditionStartId = increment ? this.allocateState() : bodyFallThroughId;
var loopStartId = loopBodyMachine.startState;
var incrementStartId = bodyFallThroughId;
var states = [];
if (initializer) {
startId = initializerStartId;
var initialiserFallThroughId;
if (condition)
initialiserFallThroughId = conditionStartId;
else
initialiserFallThroughId = loopStartId;
var tmpId = initializerStartId;
if (initializerMachine) {
initializerMachine = initializerMachine.replaceStartState(initializerStartId);
tmpId = initializerMachine.fallThroughState;
($__37 = states).push.apply($__37, $traceurRuntime.spread(initializerMachine.states));
}
states.push(new FallThroughState(tmpId, initialiserFallThroughId, [createExpressionStatement(initializer)]));
}
if (condition) {
if (!initializer)
startId = conditionStartId;
var tmpId = conditionStartId;
if (conditionMachine) {
conditionMachine = conditionMachine.replaceStartState(conditionStartId);
tmpId = conditionMachine.fallThroughState;
($__38 = states).push.apply($__38, $traceurRuntime.spread(conditionMachine.states));
}
states.push(new ConditionalState(tmpId, loopStartId, fallThroughId, condition));
}
if (increment) {
var incrementFallThroughId;
if (condition)
incrementFallThroughId = conditionStartId;
else
incrementFallThroughId = loopStartId;
var tmpId = incrementStartId;
if (incrementMachine) {
incrementMachine = incrementMachine.replaceStartState(incrementStartId);
tmpId = incrementMachine.fallThroughState;
($__39 = states).push.apply($__39, $traceurRuntime.spread(incrementMachine.states));
}
states.push(new FallThroughState(tmpId, incrementFallThroughId, [createExpressionStatement(increment)]));
}
if (!initializer && !condition)
startId = loopStartId;
var continueId;
if (increment)
continueId = incrementStartId;
else if (condition)
continueId = conditionStartId;
else
continueId = loopStartId;
if (!increment && !condition) {
loopBodyMachine = loopBodyMachine.replaceFallThroughState(loopBodyMachine.startState);
}
this.addLoopBodyStates_(loopBodyMachine, continueId, fallThroughId, labels, states);
var machine = new StateMachine(startId, fallThroughId, states, loopBodyMachine.exceptionBlocks);
if (label)
machine = machine.replaceStateId(continueId, label.continueState);
return machine;
},
transformForInStatement: function(tree) {
return tree;
},
transformForOfStatement: function(tree) {
throw new Error('for of statements should be transformed before this pass');
},
transformIfStatement: function(tree) {
var $__37,
$__38,
$__39;
var $__35,
$__36;
var machine,
condition,
ifClause,
elseClause;
if (this.expressionNeedsStateMachine(tree.condition)) {
(($__35 = this.expressionToStateMachine(tree.condition), machine = $__35.machine, condition = $__35.expression, $__35));
ifClause = this.transformAny(tree.ifClause);
elseClause = this.transformAny(tree.elseClause);
} else {
var result = $traceurRuntime.superGet(this, $CPSTransformer.prototype, "transformIfStatement").call(this, tree);
(($__36 = result, condition = $__36.condition, ifClause = $__36.ifClause, elseClause = $__36.elseClause, $__36));
if (ifClause.type !== STATE_MACHINE && (elseClause === null || elseClause.type !== STATE_MACHINE)) {
return result;
}
}
ifClause = this.ensureTransformed_(ifClause);
elseClause = this.ensureTransformed_(elseClause);
var startState = this.allocateState();
var fallThroughState = ifClause.fallThroughState;
var ifState = ifClause.startState;
var elseState = elseClause == null ? fallThroughState : elseClause.startState;
var states = [];
var exceptionBlocks = [];
states.push(new ConditionalState(startState, ifState, elseState, condition));
($__37 = states).push.apply($__37, $traceurRuntime.spread(ifClause.states));
($__38 = exceptionBlocks).push.apply($__38, $traceurRuntime.spread(ifClause.exceptionBlocks));
if (elseClause != null) {
this.replaceAndAddStates_(elseClause.states, elseClause.fallThroughState, fallThroughState, states);
($__39 = exceptionBlocks).push.apply($__39, $traceurRuntime.spread(State.replaceAllStates(elseClause.exceptionBlocks, elseClause.fallThroughState, fallThroughState)));
}
var ifMachine = new StateMachine(startState, fallThroughState, states, exceptionBlocks);
if (machine)
ifMachine = machine.append(ifMachine);
return ifMachine;
},
removeEmptyStates: function(oldStates) {
var emptyStates = [],
newStates = [];
for (var i = 0; i < oldStates.length; i++) {
if (oldStates[i] instanceof FallThroughState && oldStates[i].statements.length === 0) {
emptyStates.push(oldStates[i]);
} else {
newStates.push(oldStates[i]);
}
}
for (i = 0; i < newStates.length; i++) {
newStates[i] = emptyStates.reduce((function(state, $__35) {
var $__36 = $__35,
id = $__36.id,
fallThroughState = $__36.fallThroughState;
return state.replaceState(id, fallThroughState);
}), newStates[i]);
}
return newStates;
},
replaceAndAddStates_: function(oldStates, oldState, newState, newStates) {
for (var i = 0; i < oldStates.length; i++) {
newStates.push(oldStates[i].replaceState(oldState, newState));
}
},
transformLabelledStatement: function(tree) {
var startState = this.allocateState();
var continueState = this.allocateState();
var fallThroughState = this.allocateState();
var label = new LabelState(tree.name.value, continueState, fallThroughState);
var oldLabels = this.addLabel_(label);
this.currentLabel_ = label;
var result = this.transformAny(tree.statement);
if (result === tree.statement) {
result = tree;
} else if (result.type === STATE_MACHINE) {
result = result.replaceStartState(startState);
result = result.replaceFallThroughState(fallThroughState);
}
this.restoreLabels_(oldLabels);
return result;
},
getLabels_: function() {
return this.labelSet_;
},
restoreLabels_: function(oldLabels) {
this.labelSet_ = oldLabels;
},
addLabel_: function(label) {
var oldLabels = this.labelSet_;
var labelSet = Object.create(null);
for (var k in this.labelSet_) {
labelSet[k] = this.labelSet_[k];
}
labelSet[label.name] = label;
this.labelSet_ = labelSet;
return oldLabels;
},
clearLabels_: function() {
var result = this.labelSet_;
this.labelSet_ = Object.create(null);
return result;
},
clearCurrentLabel_: function() {
var result = this.currentLabel_;
this.currentLabel_ = null;
return result;
},
transformSwitchStatement: function(tree) {
var $__35,
$__36;
var labels = this.getLabels_();
var expression,
machine,
caseClauses;
if (this.expressionNeedsStateMachine(tree.expression)) {
(($__35 = this.expressionToStateMachine(tree.expression), expression = $__35.expression, machine = $__35.machine, $__35));
caseClauses = this.transformList(tree.caseClauses);
} else {
var result = $traceurRuntime.superGet(this, $CPSTransformer.prototype, "transformSwitchStatement").call(this, tree);
if (!needsStateMachine(result))
return result;
(($__36 = result, expression = $__36.expression, caseClauses = $__36.caseClauses, $__36));
}
var startState = this.allocateState();
var fallThroughState = this.allocateState();
var nextState = fallThroughState;
var states = [];
var clauses = [];
var tryStates = [];
var hasDefault = false;
for (var index = caseClauses.length - 1; index >= 0; index--) {
var clause = caseClauses[index];
if (clause.type == CASE_CLAUSE) {
var caseClause = clause;
nextState = this.addSwitchClauseStates_(nextState, fallThroughState, labels, caseClause.statements, states, tryStates);
clauses.push(new SwitchClause(caseClause.expression, nextState));
} else {
hasDefault = true;
var defaultClause = clause;
nextState = this.addSwitchClauseStates_(nextState, fallThroughState, labels, defaultClause.statements, states, tryStates);
clauses.push(new SwitchClause(null, nextState));
}
}
if (!hasDefault) {
clauses.push(new SwitchClause(null, fallThroughState));
}
states.push(new SwitchState(startState, expression, clauses.reverse()));
var switchMachine = new StateMachine(startState, fallThroughState, states.reverse(), tryStates);
if (machine)
switchMachine = machine.append(switchMachine);
return switchMachine;
},
addSwitchClauseStates_: function(nextState, fallThroughState, labels, statements, states, tryStates) {
var $__37;
var machine = this.ensureTransformedList_(statements);
for (var i = 0; i < machine.states.length; i++) {
var state = machine.states[i];
var transformedState = state.transformBreak(labels, fallThroughState);
states.push(transformedState.replaceState(machine.fallThroughState, nextState));
}
($__37 = tryStates).push.apply($__37, $traceurRuntime.spread(machine.exceptionBlocks));
return machine.startState;
},
transformTryStatement: function(tree) {
var result = $traceurRuntime.superGet(this, $CPSTransformer.prototype, "transformTryStatement").call(this, tree);
var $__35 = result,
body = $__35.body,
catchBlock = $__35.catchBlock,
finallyBlock = $__35.finallyBlock;
if (body.type != STATE_MACHINE && (catchBlock == null || catchBlock.catchBody.type != STATE_MACHINE) && (finallyBlock == null || finallyBlock.block.type != STATE_MACHINE)) {
return result;
}
var outerCatchState = this.allocateState();
var outerFinallyState = this.allocateState();
var pushTryState = this.statementToStateMachine_(parseStatement($__0, (catchBlock && outerCatchState), (finallyBlock && outerFinallyState)));
var tryMachine = this.ensureTransformed_(body);
tryMachine = pushTryState.append(tryMachine);
if (catchBlock !== null) {
var popTry = this.statementToStateMachine_(parseStatement($__1));
tryMachine = tryMachine.append(popTry);
var exceptionName = catchBlock.binding.identifierToken.value;
var catchMachine = this.ensureTransformed_(catchBlock.catchBody);
var catchStart = this.allocateState();
this.addMachineVariable(exceptionName);
var states = $traceurRuntime.spread(tryMachine.states, [new FallThroughState(catchStart, catchMachine.startState, parseStatements($__2, id(exceptionName)))]);
this.replaceAndAddStates_(catchMachine.states, catchMachine.fallThroughState, tryMachine.fallThroughState, states);
tryMachine = new StateMachine(tryMachine.startState, tryMachine.fallThroughState, states, [new CatchState(exceptionName, catchStart, tryMachine.fallThroughState, tryMachine.getAllStateIDs(), tryMachine.exceptionBlocks)]);
tryMachine = tryMachine.replaceStateId(catchStart, outerCatchState);
}
if (finallyBlock != null) {
var finallyMachine = this.ensureTransformed_(finallyBlock.block);
var popTry = this.statementToStateMachine_(parseStatement($__3));
finallyMachine = popTry.append(finallyMachine);
var states = $traceurRuntime.spread(tryMachine.states, finallyMachine.states, [new FinallyFallThroughState(finallyMachine.fallThroughState)]);
tryMachine = new StateMachine(tryMachine.startState, tryMachine.fallThroughState, states, [new FinallyState(finallyMachine.startState, finallyMachine.fallThroughState, tryMachine.getAllStateIDs(), tryMachine.exceptionBlocks)]);
tryMachine = tryMachine.replaceStateId(finallyMachine.startState, outerFinallyState);
}
return tryMachine;
},
transformWhileStatement: function(tree) {
var $__37;
var $__35,
$__36;
var labels = this.getLabels_();
var label = this.clearCurrentLabel_();
var condition,
machine,
body;
if (this.expressionNeedsStateMachine(tree.condition)) {
(($__35 = this.expressionToStateMachine(tree.condition), machine = $__35.machine, condition = $__35.expression, $__35));
body = this.transformAny(tree.body);
} else {
var result = $traceurRuntime.superGet(this, $CPSTransformer.prototype, "transformWhileStatement").call(this, tree);
(($__36 = result, condition = $__36.condition, body = $__36.body, $__36));
if (body.type !== STATE_MACHINE)
return result;
}
var loopBodyMachine = this.ensureTransformed_(body);
var startState = loopBodyMachine.fallThroughState;
var fallThroughState = this.allocateState();
var states = [];
var conditionStart = startState;
if (machine) {
machine = machine.replaceStartState(startState);
conditionStart = machine.fallThroughState;
($__37 = states).push.apply($__37, $traceurRuntime.spread(machine.states));
}
states.push(new ConditionalState(conditionStart, loopBodyMachine.startState, fallThroughState, condition));
this.addLoopBodyStates_(loopBodyMachine, startState, fallThroughState, labels, states);
var machine = new StateMachine(startState, fallThroughState, states, loopBodyMachine.exceptionBlocks);
if (label)
machine = machine.replaceStateId(startState, label.continueState);
return machine;
},
transformWithStatement: function(tree) {
var result = $traceurRuntime.superGet(this, $CPSTransformer.prototype, "transformWithStatement").call(this, tree);
if (result.body.type != STATE_MACHINE) {
return result;
}
throw new Error('Unreachable - with statement not allowed in strict mode/harmony');
},
generateMachineInnerFunction: function(machine) {
var enclosingFinallyState = machine.getEnclosingFinallyMap();
var SwitchStatement = createSwitchStatement(createMemberExpression('$ctx', 'state'), this.transformMachineStates(machine, State.END_STATE, State.RETHROW_STATE, enclosingFinallyState));
return parseExpression($__4, SwitchStatement);
},
addTempVar: function() {
var name = this.getTempIdentifier();
this.addMachineVariable(name);
return name;
},
addMachineVariable: function(name) {
this.hoistVariablesTransformer_.addVariable(name);
},
transformCpsFunctionBody: function(tree, runtimeMethod) {
var $__37;
var functionRef = arguments[2];
var alphaRenamedTree = AlphaRenamer.rename(tree, 'arguments', '$arguments');
var hasArguments = alphaRenamedTree !== tree;
var hoistedTree = this.hoistVariablesTransformer_.transformAny(alphaRenamedTree);
var maybeMachine = this.transformAny(hoistedTree);
if (this.reporter.hadError())
return tree;
var machine;
if (maybeMachine.type !== STATE_MACHINE) {
machine = this.statementsToStateMachine_(maybeMachine.statements);
} else {
machine = new StateMachine(maybeMachine.startState, maybeMachine.fallThroughState, this.removeEmptyStates(maybeMachine.states), maybeMachine.exceptionBlocks);
}
machine = machine.replaceFallThroughState(State.END_STATE).replaceStartState(State.START_STATE);
var statements = [];
if (this.hoistVariablesTransformer_.hasFunctions())
($__37 = statements).push.apply($__37, $traceurRuntime.spread(this.hoistVariablesTransformer_.getFunctions()));
if (this.hoistVariablesTransformer_.hasVariables())
statements.push(this.hoistVariablesTransformer_.getVariableStatement());
if (hasArguments)
statements.push(parseStatement($__5));
if (functionRef) {
statements.push(parseStatement($__6, runtimeMethod, this.generateMachineInnerFunction(machine), functionRef));
} else {
statements.push(parseStatement($__7, runtimeMethod, this.generateMachineInnerFunction(machine)));
}
return createFunctionBody(statements);
},
transformFunctionDeclaration: function(tree) {
return tree;
},
transformFunctionExpression: function(tree) {
return tree;
},
transformGetAccessor: function(tree) {
return tree;
},
transformSetAccessor: function(tree) {
return tree;
},
transformArrowFunctionExpression: function(tree) {
return tree;
},
transformStateMachine: function(tree) {
return tree;
},
statementToStateMachine_: function(statement) {
var statements;
if (statement.type === BLOCK)
statements = statement.statements;
else
statements = [statement];
return this.statementsToStateMachine_(statements);
},
statementsToStateMachine_: function(statements) {
var startState = this.allocateState();
var fallThroughState = this.allocateState();
return this.stateToStateMachine_(new FallThroughState(startState, fallThroughState, statements), fallThroughState);
},
stateToStateMachine_: function(newState, fallThroughState) {
return new StateMachine(newState.id, fallThroughState, [newState], []);
},
transformMachineStates: function(machine, machineEndState, rethrowState, enclosingFinallyState) {
var cases = [];
for (var i = 0; i < machine.states.length; i++) {
var state = machine.states[i];
var stateCase = state.transformMachineState(enclosingFinallyState[state.id], machineEndState, this.reporter);
if (stateCase != null) {
cases.push(stateCase);
}
}
this.addFinallyFallThroughDispatches(null, machine.exceptionBlocks, cases);
cases.push(createDefaultClause(parseStatements($__8)));
return cases;
},
addFinallyFallThroughDispatches: function(enclosingFinallyState, tryStates, cases) {
for (var i = 0; i < tryStates.length; i++) {
var tryState = tryStates[i];
if (tryState.kind == TryState.Kind.FINALLY) {
var finallyState = tryState;
if (enclosingFinallyState != null) {
var caseClauses = [];
var index = 0;
for (var j = 0; j < enclosingFinallyState.tryStates.length; j++) {
var destination = enclosingFinallyState.tryStates[j];
index++;
var statements;
if (index < enclosingFinallyState.tryStates.length) {
statements = [];
} else {
statements = parseStatements($__9, State.INVALID_STATE);
}
caseClauses.push(createCaseClause(createNumberLiteral(destination), statements));
}
caseClauses.push(createDefaultClause([createAssignStateStatement(enclosingFinallyState.finallyState), createBreakStatement()]));
cases.push(createCaseClause(createNumberLiteral(finallyState.fallThroughState), [createSwitchStatement(createMemberExpression('$ctx', 'finallyFallThrough'), caseClauses), createBreakStatement()]));
} else {
cases.push(createCaseClause(createNumberLiteral(finallyState.fallThroughState), parseStatements($__10)));
}
this.addFinallyFallThroughDispatches(finallyState, finallyState.nestedTrys, cases);
} else {
this.addFinallyFallThroughDispatches(enclosingFinallyState, tryState.nestedTrys, cases);
}
}
},
transformVariableDeclarationList: function(tree) {
this.reporter.reportError(tree.location && tree.location.start, 'Traceur: const/let declarations in a block containing a yield are ' + 'not yet implemented');
return tree;
},
maybeTransformStatement_: function(maybeTransformedStatement) {
var breakContinueTransformed = new BreakContinueTransformer(this.stateAllocator_).transformAny(maybeTransformedStatement);
if (breakContinueTransformed != maybeTransformedStatement) {
breakContinueTransformed = this.transformAny(breakContinueTransformed);
}
return breakContinueTransformed;
},
ensureTransformed_: function(statement) {
if (statement == null) {
return null;
}
var maybeTransformed = this.maybeTransformStatement_(statement);
return maybeTransformed.type == STATE_MACHINE ? maybeTransformed : this.statementToStateMachine_(maybeTransformed);
},
ensureTransformedList_: function(statements) {
var maybeTransformedStatements = [];
var foundMachine = false;
for (var i = 0; i < statements.length; i++) {
var statement = statements[i];
var maybeTransformedStatement = this.maybeTransformStatement_(statement);
maybeTransformedStatements.push(maybeTransformedStatement);
if (maybeTransformedStatement.type == STATE_MACHINE) {
foundMachine = true;
}
}
if (!foundMachine) {
return this.statementsToStateMachine_(statements);
}
return this.transformStatementList_(maybeTransformedStatements);
},
expressionToStateMachine: function(tree) {
var commaExpression = new ExplodeExpressionTransformer(this).transformAny(tree);
var statements = new NormalizeCommaExpressionToStatementTransformer().transformAny(commaExpression).statements;
var lastStatement = statements.pop();
assert(lastStatement.type === EXPRESSION_STATEMENT);
var expression = lastStatement.expression;
statements = $traceurRuntime.superGet(this, $CPSTransformer.prototype, "transformList").call(this, statements);
var machine = this.transformStatementList_(statements);
return {
expression: expression,
machine: machine
};
}
}, {}, TempVarTransformer);
var NormalizeCommaExpressionToStatementTransformer = function NormalizeCommaExpressionToStatementTransformer() {
$traceurRuntime.superConstructor($NormalizeCommaExpressionToStatementTransformer).apply(this, arguments);
};
var $NormalizeCommaExpressionToStatementTransformer = NormalizeCommaExpressionToStatementTransformer;
($traceurRuntime.createClass)(NormalizeCommaExpressionToStatementTransformer, {
transformCommaExpression: function(tree) {
var $__33 = this;
var statements = tree.expressions.map((function(expr) {
if (expr.type === CONDITIONAL_EXPRESSION)
return $__33.transformAny(expr);
return createExpressionStatement(expr);
}));
return new AnonBlock(tree.location, statements);
},
transformConditionalExpression: function(tree) {
var ifBlock = this.transformAny(tree.left);
var elseBlock = this.transformAny(tree.right);
return new IfStatement(tree.location, tree.condition, anonBlockToBlock(ifBlock), anonBlockToBlock(elseBlock));
}
}, {}, ParseTreeTransformer);
function anonBlockToBlock(tree) {
if (tree.type === PAREN_EXPRESSION)
return anonBlockToBlock(tree.expression);
return new Block(tree.location, tree.statements);
}
return {get CPSTransformer() {
return CPSTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/generator/EndState", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/generator/EndState";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/generator/EndState", path);
}
var State = System.get("traceur@0.0.74/src/codegeneration/generator/State").State;
var EndState = function EndState() {
$traceurRuntime.superConstructor($EndState).apply(this, arguments);
};
var $EndState = EndState;
($traceurRuntime.createClass)(EndState, {
replaceState: function(oldState, newState) {
return new $EndState(State.replaceStateId(this.id, oldState, newState));
},
transform: function(enclosingFinally, machineEndState, reporter) {
return State.generateJump(enclosingFinally, machineEndState);
}
}, {}, State);
return {get EndState() {
return EndState;
}};
});
System.register("traceur@0.0.74/src/codegeneration/generator/AsyncTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/generator/AsyncTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/generator/AsyncTransformer", path);
}
var $__0 = Object.freeze(Object.defineProperties(["$ctx.value"], {raw: {value: Object.freeze(["$ctx.value"])}})),
$__1 = Object.freeze(Object.defineProperties(["$ctx.returnValue = ", ""], {raw: {value: Object.freeze(["$ctx.returnValue = ", ""])}})),
$__2 = Object.freeze(Object.defineProperties(["$ctx.resolve(", ")"], {raw: {value: Object.freeze(["$ctx.resolve(", ")"])}})),
$__3 = Object.freeze(Object.defineProperties(["$traceurRuntime.asyncWrap"], {raw: {value: Object.freeze(["$traceurRuntime.asyncWrap"])}}));
var AwaitState = System.get("traceur@0.0.74/src/codegeneration/generator/AwaitState").AwaitState;
var $__5 = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees"),
BinaryExpression = $__5.BinaryExpression,
ExpressionStatement = $__5.ExpressionStatement;
var CPSTransformer = System.get("traceur@0.0.74/src/codegeneration/generator/CPSTransformer").CPSTransformer;
var EndState = System.get("traceur@0.0.74/src/codegeneration/generator/EndState").EndState;
var FallThroughState = System.get("traceur@0.0.74/src/codegeneration/generator/FallThroughState").FallThroughState;
var $__9 = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType"),
AWAIT_EXPRESSION = $__9.AWAIT_EXPRESSION,
BINARY_EXPRESSION = $__9.BINARY_EXPRESSION,
STATE_MACHINE = $__9.STATE_MACHINE;
var $__10 = System.get("traceur@0.0.74/src/codegeneration/PlaceholderParser"),
parseExpression = $__10.parseExpression,
parseStatement = $__10.parseStatement,
parseStatements = $__10.parseStatements;
var StateMachine = System.get("traceur@0.0.74/src/syntax/trees/StateMachine").StateMachine;
var FindInFunctionScope = System.get("traceur@0.0.74/src/codegeneration/FindInFunctionScope").FindInFunctionScope;
var createUndefinedExpression = System.get("traceur@0.0.74/src/codegeneration/ParseTreeFactory").createUndefinedExpression;
function isAwaitAssign(tree) {
return tree.type === BINARY_EXPRESSION && tree.operator.isAssignmentOperator() && tree.right.type === AWAIT_EXPRESSION && tree.left.isLeftHandSideExpression();
}
var AwaitFinder = function AwaitFinder() {
$traceurRuntime.superConstructor($AwaitFinder).apply(this, arguments);
};
var $AwaitFinder = AwaitFinder;
($traceurRuntime.createClass)(AwaitFinder, {visitAwaitExpression: function(tree) {
this.found = true;
}}, {}, FindInFunctionScope);
function scopeContainsAwait(tree) {
return new AwaitFinder(tree).found;
}
var AsyncTransformer = function AsyncTransformer() {
$traceurRuntime.superConstructor($AsyncTransformer).apply(this, arguments);
};
var $AsyncTransformer = AsyncTransformer;
($traceurRuntime.createClass)(AsyncTransformer, {
expressionNeedsStateMachine: function(tree) {
if (tree === null)
return false;
return scopeContainsAwait(tree);
},
transformExpressionStatement: function(tree) {
var expression = tree.expression;
if (expression.type === AWAIT_EXPRESSION)
return this.transformAwaitExpression_(expression);
if (isAwaitAssign(expression))
return this.transformAwaitAssign_(expression);
if (this.expressionNeedsStateMachine(expression)) {
return this.expressionToStateMachine(expression).machine;
}
return $traceurRuntime.superGet(this, $AsyncTransformer.prototype, "transformExpressionStatement").call(this, tree);
},
transformAwaitExpression: function(tree) {
throw new Error('Internal error');
},
transformAwaitExpression_: function(tree) {
return this.transformAwait_(tree, tree.expression, null, null);
},
transformAwaitAssign_: function(tree) {
return this.transformAwait_(tree, tree.right.expression, tree.left, tree.operator);
},
transformAwait_: function(tree, inExpression, left, operator) {
var $__15;
var expression,
machine;
if (this.expressionNeedsStateMachine(inExpression)) {
(($__15 = this.expressionToStateMachine(inExpression), expression = $__15.expression, machine = $__15.machine, $__15));
} else {
expression = this.transformAny(inExpression);
}
var createTaskState = this.allocateState();
var fallThroughState = this.allocateState();
var callbackState = left ? this.allocateState() : fallThroughState;
var states = [];
states.push(new AwaitState(createTaskState, callbackState, expression));
if (left) {
var statement = new ExpressionStatement(tree.location, new BinaryExpression(tree.location, left, operator, parseExpression($__0)));
states.push(new FallThroughState(callbackState, fallThroughState, [statement]));
}
var awaitMachine = new StateMachine(createTaskState, fallThroughState, states, []);
if (machine) {
awaitMachine = machine.append(awaitMachine);
}
return awaitMachine;
},
transformFinally: function(tree) {
var result = $traceurRuntime.superGet(this, $AsyncTransformer.prototype, "transformFinally").call(this, tree);
if (result.block.type != STATE_MACHINE) {
return result;
}
this.reporter.reportError(tree.location.start, 'await not permitted within a finally block.');
return result;
},
transformReturnStatement: function(tree) {
var $__15;
var expression,
machine;
if (this.expressionNeedsStateMachine(tree.expression)) {
(($__15 = this.expressionToStateMachine(tree.expression), expression = $__15.expression, machine = $__15.machine, $__15));
} else {
expression = tree.expression || createUndefinedExpression();
}
var startState = this.allocateState();
var endState = this.allocateState();
var completeState = new FallThroughState(startState, endState, parseStatements($__1, expression));
var end = new EndState(endState);
var returnMachine = new StateMachine(startState, this.allocateState(), [completeState, end], []);
if (machine)
returnMachine = machine.append(returnMachine);
return returnMachine;
},
createCompleteTask_: function(result) {
return parseStatement($__2, result);
},
transformAsyncBody: function(tree) {
var runtimeFunction = parseExpression($__3);
return this.transformCpsFunctionBody(tree, runtimeFunction);
}
}, {transformAsyncBody: function(identifierGenerator, reporter, body) {
return new $AsyncTransformer(identifierGenerator, reporter).transformAsyncBody(body);
}}, CPSTransformer);
;
return {get AsyncTransformer() {
return AsyncTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/generator/ForInTransformPass", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/generator/ForInTransformPass";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/generator/ForInTransformPass", path);
}
var $__0 = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType"),
BLOCK = $__0.BLOCK,
VARIABLE_DECLARATION_LIST = $__0.VARIABLE_DECLARATION_LIST,
IDENTIFIER_EXPRESSION = $__0.IDENTIFIER_EXPRESSION;
var $__1 = System.get("traceur@0.0.74/src/syntax/PredefinedName"),
LENGTH = $__1.LENGTH,
PUSH = $__1.PUSH;
var TempVarTransformer = System.get("traceur@0.0.74/src/codegeneration/TempVarTransformer").TempVarTransformer;
var $__3 = System.get("traceur@0.0.74/src/syntax/TokenType"),
BANG = $__3.BANG,
IN = $__3.IN,
OPEN_ANGLE = $__3.OPEN_ANGLE,
PLUS_PLUS = $__3.PLUS_PLUS,
VAR = $__3.VAR;
var $__4 = System.get("traceur@0.0.74/src/codegeneration/ParseTreeFactory"),
createArgumentList = $__4.createArgumentList,
createAssignmentStatement = $__4.createAssignmentStatement,
createBinaryExpression = $__4.createBinaryExpression,
createBlock = $__4.createBlock,
createCallStatement = $__4.createCallStatement,
createContinueStatement = $__4.createContinueStatement,
createEmptyArrayLiteralExpression = $__4.createEmptyArrayLiteralExpression,
createForInStatement = $__4.createForInStatement,
createForStatement = $__4.createForStatement,
createIdentifierExpression = $__4.createIdentifierExpression,
createIfStatement = $__4.createIfStatement,
createMemberExpression = $__4.createMemberExpression,
createMemberLookupExpression = $__4.createMemberLookupExpression,
createNumberLiteral = $__4.createNumberLiteral,
createOperatorToken = $__4.createOperatorToken,
createParenExpression = $__4.createParenExpression,
createPostfixExpression = $__4.createPostfixExpression,
createUnaryExpression = $__4.createUnaryExpression,
createVariableDeclarationList = $__4.createVariableDeclarationList,
createVariableStatement = $__4.createVariableStatement;
var ForInTransformPass = function ForInTransformPass() {
$traceurRuntime.superConstructor($ForInTransformPass).apply(this, arguments);
};
var $ForInTransformPass = ForInTransformPass;
($traceurRuntime.createClass)(ForInTransformPass, {transformForInStatement: function(tree) {
var $__6,
$__7;
var bodyStatements = [];
var body = this.transformAny(tree.body);
if (body.type == BLOCK) {
($__6 = bodyStatements).push.apply($__6, $traceurRuntime.spread(body.statements));
} else {
bodyStatements.push(body);
}
var elements = [];
var keys = this.getTempIdentifier();
elements.push(createVariableStatement(VAR, keys, createEmptyArrayLiteralExpression()));
var collection = this.getTempIdentifier();
elements.push(createVariableStatement(VAR, collection, tree.collection));
var p = this.getTempIdentifier();
elements.push(createForInStatement(createVariableDeclarationList(VAR, p, null), createIdentifierExpression(collection), createCallStatement(createMemberExpression(keys, PUSH), createArgumentList([createIdentifierExpression(p)]))));
var i = this.getTempIdentifier();
var lookup = createMemberLookupExpression(createIdentifierExpression(keys), createIdentifierExpression(i));
var originalKey,
assignOriginalKey;
if (tree.initializer.type == VARIABLE_DECLARATION_LIST) {
var decList = tree.initializer;
originalKey = createIdentifierExpression(decList.declarations[0].lvalue);
assignOriginalKey = createVariableStatement(decList.declarationType, originalKey.identifierToken, lookup);
} else if (tree.initializer.type == IDENTIFIER_EXPRESSION) {
originalKey = tree.initializer;
assignOriginalKey = createAssignmentStatement(tree.initializer, lookup);
} else {
throw new Error('Invalid left hand side of for in loop');
}
var innerBlock = [];
innerBlock.push(assignOriginalKey);
innerBlock.push(createIfStatement(createUnaryExpression(createOperatorToken(BANG), createParenExpression(createBinaryExpression(originalKey, createOperatorToken(IN), createIdentifierExpression(collection)))), createContinueStatement(), null));
($__7 = innerBlock).push.apply($__7, $traceurRuntime.spread(bodyStatements));
elements.push(createForStatement(createVariableDeclarationList(VAR, i, createNumberLiteral(0)), createBinaryExpression(createIdentifierExpression(i), createOperatorToken(OPEN_ANGLE), createMemberExpression(keys, LENGTH)), createPostfixExpression(createIdentifierExpression(i), createOperatorToken(PLUS_PLUS)), createBlock(innerBlock)));
return createBlock(elements);
}}, {}, TempVarTransformer);
return {get ForInTransformPass() {
return ForInTransformPass;
}};
});
System.register("traceur@0.0.74/src/codegeneration/generator/YieldState", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/generator/YieldState";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/generator/YieldState", path);
}
var $__0 = Object.freeze(Object.defineProperties(["return ", ""], {raw: {value: Object.freeze(["return ", ""])}}));
var State = System.get("traceur@0.0.74/src/codegeneration/generator/State").State;
var parseStatement = System.get("traceur@0.0.74/src/codegeneration/PlaceholderParser").parseStatement;
var YieldState = function YieldState(id, fallThroughState, expression) {
$traceurRuntime.superConstructor($YieldState).call(this, id);
this.fallThroughState = fallThroughState;
this.expression = expression;
};
var $YieldState = YieldState;
($traceurRuntime.createClass)(YieldState, {
replaceState: function(oldState, newState) {
return new this.constructor(State.replaceStateId(this.id, oldState, newState), State.replaceStateId(this.fallThroughState, oldState, newState), this.expression);
},
transform: function(enclosingFinally, machineEndState, reporter) {
return $traceurRuntime.spread(State.generateAssignState(enclosingFinally, this.fallThroughState), [parseStatement($__0, this.expression)]);
}
}, {}, State);
return {get YieldState() {
return YieldState;
}};
});
System.register("traceur@0.0.74/src/codegeneration/generator/ReturnState", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/generator/ReturnState";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/generator/ReturnState", path);
}
var $__0 = Object.freeze(Object.defineProperties(["$ctx.returnValue = ", ""], {raw: {value: Object.freeze(["$ctx.returnValue = ", ""])}}));
var $__1 = System.get("traceur@0.0.74/src/semantics/util"),
isUndefined = $__1.isUndefined,
isVoidExpression = $__1.isVoidExpression;
var YieldState = System.get("traceur@0.0.74/src/codegeneration/generator/YieldState").YieldState;
var State = System.get("traceur@0.0.74/src/codegeneration/generator/State").State;
var parseStatement = System.get("traceur@0.0.74/src/codegeneration/PlaceholderParser").parseStatement;
var ReturnState = function ReturnState() {
$traceurRuntime.superConstructor($ReturnState).apply(this, arguments);
};
var $ReturnState = ReturnState;
($traceurRuntime.createClass)(ReturnState, {transform: function(enclosingFinally, machineEndState, reporter) {
var $__6;
var e = this.expression;
var statements = [];
if (e && !isUndefined(e) && !isVoidExpression(e))
statements.push(parseStatement($__0, this.expression));
($__6 = statements).push.apply($__6, $traceurRuntime.spread(State.generateJump(enclosingFinally, machineEndState)));
return statements;
}}, {}, YieldState);
return {get ReturnState() {
return ReturnState;
}};
});
System.register("traceur@0.0.74/src/codegeneration/generator/GeneratorTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/generator/GeneratorTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/generator/GeneratorTransformer", path);
}
var $__0 = Object.freeze(Object.defineProperties(["\n ", " = ", "[Symbol.iterator]();\n // received = void 0;\n $ctx.sent = void 0;\n // send = true; // roughly equivalent\n $ctx.action = 'next';\n\n for (;;) {\n ", " = ", "[$ctx.action]($ctx.sentIgnoreThrow);\n if (", ".done) {\n $ctx.sent = ", ".value;\n break;\n }\n yield ", ".value;\n }"], {raw: {value: Object.freeze(["\n ", " = ", "[Symbol.iterator]();\n // received = void 0;\n $ctx.sent = void 0;\n // send = true; // roughly equivalent\n $ctx.action = 'next';\n\n for (;;) {\n ", " = ", "[$ctx.action]($ctx.sentIgnoreThrow);\n if (", ".done) {\n $ctx.sent = ", ".value;\n break;\n }\n yield ", ".value;\n }"])}})),
$__1 = Object.freeze(Object.defineProperties(["$ctx.sentIgnoreThrow"], {raw: {value: Object.freeze(["$ctx.sentIgnoreThrow"])}})),
$__2 = Object.freeze(Object.defineProperties(["$ctx.sent"], {raw: {value: Object.freeze(["$ctx.sent"])}})),
$__3 = Object.freeze(Object.defineProperties(["$ctx.maybeThrow()"], {raw: {value: Object.freeze(["$ctx.maybeThrow()"])}})),
$__4 = Object.freeze(Object.defineProperties(["$traceurRuntime.createGeneratorInstance"], {raw: {value: Object.freeze(["$traceurRuntime.createGeneratorInstance"])}}));
var CPSTransformer = System.get("traceur@0.0.74/src/codegeneration/generator/CPSTransformer").CPSTransformer;
var $__6 = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType"),
BINARY_EXPRESSION = $__6.BINARY_EXPRESSION,
YIELD_EXPRESSION = $__6.YIELD_EXPRESSION;
var $__7 = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees"),
BinaryExpression = $__7.BinaryExpression,
ExpressionStatement = $__7.ExpressionStatement;
var FindInFunctionScope = System.get("traceur@0.0.74/src/codegeneration/FindInFunctionScope").FindInFunctionScope;
var ReturnState = System.get("traceur@0.0.74/src/codegeneration/generator/ReturnState").ReturnState;
var YieldState = System.get("traceur@0.0.74/src/codegeneration/generator/YieldState").YieldState;
var $__11 = System.get("traceur@0.0.74/src/codegeneration/ParseTreeFactory"),
id = $__11.createIdentifierExpression,
createMemberExpression = $__11.createMemberExpression,
createUndefinedExpression = $__11.createUndefinedExpression;
var $__12 = System.get("traceur@0.0.74/src/codegeneration/PlaceholderParser"),
parseExpression = $__12.parseExpression,
parseStatement = $__12.parseStatement,
parseStatements = $__12.parseStatements;
function isYieldAssign(tree) {
return tree.type === BINARY_EXPRESSION && tree.operator.isAssignmentOperator() && tree.right.type === YIELD_EXPRESSION && tree.left.isLeftHandSideExpression();
}
var YieldFinder = function YieldFinder() {
$traceurRuntime.superConstructor($YieldFinder).apply(this, arguments);
};
var $YieldFinder = YieldFinder;
($traceurRuntime.createClass)(YieldFinder, {visitYieldExpression: function(tree) {
this.found = true;
}}, {}, FindInFunctionScope);
function scopeContainsYield(tree) {
return new YieldFinder(tree).found;
}
var GeneratorTransformer = function GeneratorTransformer(identifierGenerator, reporter) {
$traceurRuntime.superConstructor($GeneratorTransformer).call(this, identifierGenerator, reporter);
this.shouldAppendThrowCloseState_ = true;
};
var $GeneratorTransformer = GeneratorTransformer;
($traceurRuntime.createClass)(GeneratorTransformer, {
expressionNeedsStateMachine: function(tree) {
if (tree === null)
return false;
return scopeContainsYield(tree);
},
transformYieldExpression_: function(tree) {
var $__14;
var expression,
machine;
if (this.expressionNeedsStateMachine(tree.expression)) {
(($__14 = this.expressionToStateMachine(tree.expression), expression = $__14.expression, machine = $__14.machine, $__14));
} else {
expression = this.transformAny(tree.expression);
if (!expression)
expression = createUndefinedExpression();
}
if (tree.isYieldFor)
return this.transformYieldForExpression_(expression, machine);
var startState = this.allocateState();
var fallThroughState = this.allocateState();
var yieldMachine = this.stateToStateMachine_(new YieldState(startState, fallThroughState, expression), fallThroughState);
if (machine)
yieldMachine = machine.append(yieldMachine);
if (this.shouldAppendThrowCloseState_)
yieldMachine = yieldMachine.append(this.createThrowCloseState_());
return yieldMachine;
},
transformYieldForExpression_: function(expression) {
var machine = arguments[1];
var gName = this.getTempIdentifier();
this.addMachineVariable(gName);
var g = id(gName);
var nextName = this.getTempIdentifier();
this.addMachineVariable(nextName);
var next = id(nextName);
var statements = parseStatements($__0, g, expression, next, g, next, next, next);
var shouldAppendThrowCloseState = this.shouldAppendThrowCloseState_;
this.shouldAppendThrowCloseState_ = false;
statements = this.transformList(statements);
var yieldMachine = this.transformStatementList_(statements);
this.shouldAppendThrowCloseState_ = shouldAppendThrowCloseState;
if (machine)
yieldMachine = machine.append(yieldMachine);
return yieldMachine;
},
transformYieldExpression: function(tree) {
this.reporter.reportError(tree.location.start, 'Only \'a = yield b\' and \'var a = yield b\' currently supported.');
return tree;
},
transformYieldAssign_: function(tree) {
var shouldAppendThrowCloseState = this.shouldAppendThrowCloseState_;
this.shouldAppendThrowCloseState_ = false;
var machine = this.transformYieldExpression_(tree.right);
var left = this.transformAny(tree.left);
var sentExpression = tree.right.isYieldFor ? parseExpression($__1) : parseExpression($__2);
var statement = new ExpressionStatement(tree.location, new BinaryExpression(tree.location, left, tree.operator, sentExpression));
var assignMachine = this.statementToStateMachine_(statement);
this.shouldAppendThrowCloseState_ = shouldAppendThrowCloseState;
return machine.append(assignMachine);
},
createThrowCloseState_: function() {
return this.statementToStateMachine_(parseStatement($__3));
},
transformExpressionStatement: function(tree) {
var expression = tree.expression;
if (expression.type === YIELD_EXPRESSION)
return this.transformYieldExpression_(expression);
if (isYieldAssign(expression))
return this.transformYieldAssign_(expression);
if (this.expressionNeedsStateMachine(expression)) {
return this.expressionToStateMachine(expression).machine;
}
return $traceurRuntime.superGet(this, $GeneratorTransformer.prototype, "transformExpressionStatement").call(this, tree);
},
transformAwaitStatement: function(tree) {
this.reporter.reportError(tree.location.start, 'Generator function may not have an await statement.');
return tree;
},
transformReturnStatement: function(tree) {
var $__14;
var expression,
machine;
if (this.expressionNeedsStateMachine(tree.expression))
(($__14 = this.expressionToStateMachine(tree.expression), expression = $__14.expression, machine = $__14.machine, $__14));
else
expression = tree.expression;
var startState = this.allocateState();
var fallThroughState = this.allocateState();
var returnMachine = this.stateToStateMachine_(new ReturnState(startState, fallThroughState, this.transformAny(expression)), fallThroughState);
if (machine)
return machine.append(returnMachine);
return returnMachine;
},
transformGeneratorBody: function(tree, name) {
var runtimeFunction = parseExpression($__4);
return this.transformCpsFunctionBody(tree, runtimeFunction, name);
}
}, {transformGeneratorBody: function(identifierGenerator, reporter, body, name) {
return new $GeneratorTransformer(identifierGenerator, reporter).transformGeneratorBody(body, name);
}}, CPSTransformer);
;
return {get GeneratorTransformer() {
return GeneratorTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/GeneratorTransformPass", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/GeneratorTransformPass";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/GeneratorTransformPass", path);
}
var $__0 = Object.freeze(Object.defineProperties(["$traceurRuntime.initGeneratorFunction(", ")"], {raw: {value: Object.freeze(["$traceurRuntime.initGeneratorFunction(", ")"])}})),
$__1 = Object.freeze(Object.defineProperties(["var ", " = ", ""], {raw: {value: Object.freeze(["var ", " = ", ""])}})),
$__2 = Object.freeze(Object.defineProperties(["$traceurRuntime.initGeneratorFunction(", ")"], {raw: {value: Object.freeze(["$traceurRuntime.initGeneratorFunction(", ")"])}}));
var ArrowFunctionTransformer = System.get("traceur@0.0.74/src/codegeneration/ArrowFunctionTransformer").ArrowFunctionTransformer;
var AsyncTransformer = System.get("traceur@0.0.74/src/codegeneration/generator/AsyncTransformer").AsyncTransformer;
var ForInTransformPass = System.get("traceur@0.0.74/src/codegeneration/generator/ForInTransformPass").ForInTransformPass;
var GeneratorTransformer = System.get("traceur@0.0.74/src/codegeneration/generator/GeneratorTransformer").GeneratorTransformer;
var $__7 = System.get("traceur@0.0.74/src/codegeneration/PlaceholderParser"),
parseExpression = $__7.parseExpression,
parseStatement = $__7.parseStatement;
var TempVarTransformer = System.get("traceur@0.0.74/src/codegeneration/TempVarTransformer").TempVarTransformer;
var FindInFunctionScope = System.get("traceur@0.0.74/src/codegeneration/FindInFunctionScope").FindInFunctionScope;
var $__10 = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees"),
AnonBlock = $__10.AnonBlock,
FunctionDeclaration = $__10.FunctionDeclaration,
FunctionExpression = $__10.FunctionExpression;
var $__11 = System.get("traceur@0.0.74/src/codegeneration/ParseTreeFactory"),
createBindingIdentifier = $__11.createBindingIdentifier,
id = $__11.createIdentifierExpression,
createIdentifierToken = $__11.createIdentifierToken;
var transformOptions = System.get("traceur@0.0.74/src/Options").transformOptions;
var ForInFinder = function ForInFinder() {
$traceurRuntime.superConstructor($ForInFinder).apply(this, arguments);
};
var $ForInFinder = ForInFinder;
($traceurRuntime.createClass)(ForInFinder, {visitForInStatement: function(tree) {
this.found = true;
}}, {}, FindInFunctionScope);
function needsTransform(tree) {
return transformOptions.generators && tree.isGenerator() || transformOptions.asyncFunctions && tree.isAsyncFunction();
}
var GeneratorTransformPass = function GeneratorTransformPass(identifierGenerator, reporter) {
$traceurRuntime.superConstructor($GeneratorTransformPass).call(this, identifierGenerator);
this.reporter_ = reporter;
this.inBlock_ = false;
};
var $GeneratorTransformPass = GeneratorTransformPass;
($traceurRuntime.createClass)(GeneratorTransformPass, {
transformFunctionDeclaration: function(tree) {
if (!needsTransform(tree))
return $traceurRuntime.superGet(this, $GeneratorTransformPass.prototype, "transformFunctionDeclaration").call(this, tree);
if (tree.isGenerator())
return this.transformGeneratorDeclaration_(tree);
return this.transformFunction_(tree, FunctionDeclaration, null);
},
transformGeneratorDeclaration_: function(tree) {
var nameIdExpression = id(tree.name.identifierToken);
var setupPrototypeExpression = parseExpression($__0, nameIdExpression);
var tmpVar = id(this.inBlock_ ? this.getTempIdentifier() : this.addTempVar(setupPrototypeExpression));
var funcDecl = this.transformFunction_(tree, FunctionDeclaration, tmpVar);
if (!this.inBlock_)
return funcDecl;
return new AnonBlock(null, [funcDecl, parseStatement($__1, tmpVar, setupPrototypeExpression)]);
},
transformFunctionExpression: function(tree) {
if (!needsTransform(tree))
return $traceurRuntime.superGet(this, $GeneratorTransformPass.prototype, "transformFunctionExpression").call(this, tree);
if (tree.isGenerator())
return this.transformGeneratorExpression_(tree);
return this.transformFunction_(tree, FunctionExpression, null);
},
transformGeneratorExpression_: function(tree) {
var name;
if (!tree.name) {
name = createIdentifierToken(this.getTempIdentifier());
tree = new FunctionExpression(tree.location, createBindingIdentifier(name), tree.functionKind, tree.parameterList, tree.typeAnnotation, tree.annotations, tree.body);
} else {
name = tree.name.identifierToken;
}
var functionExpression = this.transformFunction_(tree, FunctionExpression, id(name));
return parseExpression($__2, functionExpression);
},
transformFunction_: function(tree, constructor, nameExpression) {
var body = $traceurRuntime.superGet(this, $GeneratorTransformPass.prototype, "transformAny").call(this, tree.body);
var finder = new ForInFinder(body);
if (finder.found) {
body = new ForInTransformPass(this.identifierGenerator).transformAny(body);
}
if (transformOptions.generators && tree.isGenerator()) {
body = GeneratorTransformer.transformGeneratorBody(this.identifierGenerator, this.reporter_, body, nameExpression);
} else if (transformOptions.asyncFunctions && tree.isAsyncFunction()) {
body = AsyncTransformer.transformAsyncBody(this.identifierGenerator, this.reporter_, body);
}
var functionKind = null;
return new constructor(tree.location, tree.name, functionKind, tree.parameterList, tree.typeAnnotation || null, tree.annotations || null, body);
},
transformArrowFunctionExpression: function(tree) {
if (!tree.isAsyncFunction())
return $traceurRuntime.superGet(this, $GeneratorTransformPass.prototype, "transformArrowFunctionExpression").call(this, tree);
return this.transformAny(ArrowFunctionTransformer.transform(this, tree));
},
transformBlock: function(tree) {
var inBlock = this.inBlock_;
this.inBlock_ = true;
var rv = $traceurRuntime.superGet(this, $GeneratorTransformPass.prototype, "transformBlock").call(this, tree);
this.inBlock_ = inBlock;
return rv;
}
}, {}, TempVarTransformer);
return {get GeneratorTransformPass() {
return GeneratorTransformPass;
}};
});
System.register("traceur@0.0.74/src/codegeneration/InlineModuleTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/InlineModuleTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/InlineModuleTransformer", path);
}
var VAR = System.get("traceur@0.0.74/src/syntax/TokenType").VAR;
var ModuleTransformer = System.get("traceur@0.0.74/src/codegeneration/ModuleTransformer").ModuleTransformer;
var $__2 = System.get("traceur@0.0.74/src/codegeneration/ParseTreeFactory"),
createBindingIdentifier = $__2.createBindingIdentifier,
createEmptyStatement = $__2.createEmptyStatement,
createFunctionBody = $__2.createFunctionBody,
createImmediatelyInvokedFunctionExpression = $__2.createImmediatelyInvokedFunctionExpression,
createScopedExpression = $__2.createScopedExpression,
createVariableStatement = $__2.createVariableStatement;
var globalThis = System.get("traceur@0.0.74/src/codegeneration/globalThis").default;
var scopeContainsThis = System.get("traceur@0.0.74/src/codegeneration/scopeContainsThis").default;
var anonInlineModules = 0;
var InlineModuleTransformer = function InlineModuleTransformer() {
$traceurRuntime.superConstructor($InlineModuleTransformer).apply(this, arguments);
};
var $InlineModuleTransformer = InlineModuleTransformer;
($traceurRuntime.createClass)(InlineModuleTransformer, {
wrapModule: function(statements) {
var seed = this.moduleName || 'anon_' + ++anonInlineModules;
var idName = this.getTempVarNameForModuleName(seed);
var body = createFunctionBody(statements);
var moduleExpression;
if (statements.some(scopeContainsThis)) {
moduleExpression = createScopedExpression(body, globalThis());
} else {
moduleExpression = createImmediatelyInvokedFunctionExpression(body);
}
return [createVariableStatement(VAR, idName, moduleExpression)];
},
transformNamedExport: function(tree) {
return createEmptyStatement();
},
transformModuleSpecifier: function(tree) {
return createBindingIdentifier(this.getTempVarNameForModuleSpecifier(tree));
}
}, {}, ModuleTransformer);
return {get InlineModuleTransformer() {
return InlineModuleTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/InstantiateModuleTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/InstantiateModuleTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/InstantiateModuleTransformer", path);
}
var $__0 = Object.freeze(Object.defineProperties(["", " = ", ""], {raw: {value: Object.freeze(["", " = ", ""])}})),
$__1 = Object.freeze(Object.defineProperties(["$__export(", ", ", ")"], {raw: {value: Object.freeze(["$__export(", ", ", ")"])}})),
$__2 = Object.freeze(Object.defineProperties(["($__export(", ", ", " + 1), ", ")"], {raw: {value: Object.freeze(["($__export(", ", ", " + 1), ", ")"])}})),
$__3 = Object.freeze(Object.defineProperties(["($__export(", ", ", " - 1), ", ")"], {raw: {value: Object.freeze(["($__export(", ", ", " - 1), ", ")"])}})),
$__4 = Object.freeze(Object.defineProperties(["$__export(", ", ", ")}"], {raw: {value: Object.freeze(["$__export(", ", ", ")}"])}})),
$__5 = Object.freeze(Object.defineProperties(["System.register(", ", ", ", function($__export) {\n ", "\n });"], {raw: {value: Object.freeze(["System.register(", ", ", ", function($__export) {\n ", "\n });"])}})),
$__6 = Object.freeze(Object.defineProperties(["System.register(", ", function($__export) {\n ", "\n });"], {raw: {value: Object.freeze(["System.register(", ", function($__export) {\n ", "\n });"])}})),
$__7 = Object.freeze(Object.defineProperties(["", " = m.", ";"], {raw: {value: Object.freeze(["", " = m.", ";"])}})),
$__8 = Object.freeze(Object.defineProperties(["$__export(", ", m.", ");"], {raw: {value: Object.freeze(["$__export(", ", m.", ");"])}})),
$__9 = Object.freeze(Object.defineProperties(["", " = m;"], {raw: {value: Object.freeze(["", " = m;"])}})),
$__10 = Object.freeze(Object.defineProperties(["\n Object.keys(m).forEach(function(p) {\n $__export(p, m[p]);\n });\n "], {raw: {value: Object.freeze(["\n Object.keys(m).forEach(function(p) {\n $__export(p, m[p]);\n });\n "])}})),
$__11 = Object.freeze(Object.defineProperties(["function(m) {\n ", "\n }"], {raw: {value: Object.freeze(["function(m) {\n ", "\n }"])}})),
$__12 = Object.freeze(Object.defineProperties(["function(m) {}"], {raw: {value: Object.freeze(["function(m) {}"])}})),
$__13 = Object.freeze(Object.defineProperties(["\n $__export(", ", ", ")\n "], {raw: {value: Object.freeze(["\n $__export(", ", ", ")\n "])}})),
$__14 = Object.freeze(Object.defineProperties(["return {\n setters: ", ",\n execute: ", "\n }"], {raw: {value: Object.freeze(["return {\n setters: ", ",\n execute: ", "\n }"])}})),
$__15 = Object.freeze(Object.defineProperties(["$__export(", ", ", ")"], {raw: {value: Object.freeze(["$__export(", ", ", ")"])}})),
$__16 = Object.freeze(Object.defineProperties(["$__export(", ", ", ")"], {raw: {value: Object.freeze(["$__export(", ", ", ")"])}})),
$__17 = Object.freeze(Object.defineProperties(["var ", " = $__export(", ", ", ");"], {raw: {value: Object.freeze(["var ", " = $__export(", ", ", ");"])}})),
$__18 = Object.freeze(Object.defineProperties(["var ", ";"], {raw: {value: Object.freeze(["var ", ";"])}})),
$__19 = Object.freeze(Object.defineProperties(["$__export('default', ", ");"], {raw: {value: Object.freeze(["$__export('default', ", ");"])}})),
$__20 = Object.freeze(Object.defineProperties(["$__export(", ", ", ");"], {raw: {value: Object.freeze(["$__export(", ", ", ");"])}})),
$__21 = Object.freeze(Object.defineProperties(["var ", ";"], {raw: {value: Object.freeze(["var ", ";"])}}));
var $__22 = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees"),
AnonBlock = $__22.AnonBlock,
ArrayLiteralExpression = $__22.ArrayLiteralExpression,
ClassExpression = $__22.ClassExpression,
CommaExpression = $__22.CommaExpression,
ExpressionStatement = $__22.ExpressionStatement;
var $__23 = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType"),
CLASS_DECLARATION = $__23.CLASS_DECLARATION,
FUNCTION_DECLARATION = $__23.FUNCTION_DECLARATION,
IDENTIFIER_EXPRESSION = $__23.IDENTIFIER_EXPRESSION,
IMPORT_SPECIFIER_SET = $__23.IMPORT_SPECIFIER_SET;
var ScopeTransformer = System.get("traceur@0.0.74/src/codegeneration/ScopeTransformer").ScopeTransformer;
var $__25 = System.get("traceur@0.0.74/src/codegeneration/ParseTreeFactory"),
id = $__25.createIdentifierExpression,
createIdentifierToken = $__25.createIdentifierToken,
createVariableStatement = $__25.createVariableStatement,
createVariableDeclaration = $__25.createVariableDeclaration,
createVariableDeclarationList = $__25.createVariableDeclarationList;
var ModuleTransformer = System.get("traceur@0.0.74/src/codegeneration/ModuleTransformer").ModuleTransformer;
var $__27 = System.get("traceur@0.0.74/src/syntax/TokenType"),
MINUS_MINUS = $__27.MINUS_MINUS,
PLUS_PLUS = $__27.PLUS_PLUS,
VAR = $__27.VAR;
var $__28 = System.get("traceur@0.0.74/src/codegeneration/PlaceholderParser"),
parseExpression = $__28.parseExpression,
parseStatement = $__28.parseStatement,
parseStatements = $__28.parseStatements;
var HoistVariablesTransformer = System.get("traceur@0.0.74/src/codegeneration/HoistVariablesTransformer").default;
var $__30 = System.get("traceur@0.0.74/src/codegeneration/ParseTreeFactory"),
createFunctionExpression = $__30.createFunctionExpression,
createEmptyParameterList = $__30.createEmptyParameterList,
createFunctionBody = $__30.createFunctionBody;
var DeclarationExtractionTransformer = function DeclarationExtractionTransformer() {
$traceurRuntime.superConstructor($DeclarationExtractionTransformer).call(this);
this.declarations_ = [];
};
var $DeclarationExtractionTransformer = DeclarationExtractionTransformer;
($traceurRuntime.createClass)(DeclarationExtractionTransformer, {
getDeclarationStatements: function() {
return $traceurRuntime.spread([this.getVariableStatement()], this.declarations_);
},
addDeclaration: function(tree) {
this.declarations_.push(tree);
},
transformFunctionDeclaration: function(tree) {
this.addDeclaration(tree);
return new AnonBlock(null, []);
},
transformClassDeclaration: function(tree) {
this.addVariable(tree.name.identifierToken.value);
tree = new ClassExpression(tree.location, tree.name, tree.superClass, tree.elements, tree.annotations);
return parseStatement($__0, tree.name.identifierToken, tree);
}
}, {}, HoistVariablesTransformer);
var InsertBindingAssignmentTransformer = function InsertBindingAssignmentTransformer(exportName, bindingName) {
$traceurRuntime.superConstructor($InsertBindingAssignmentTransformer).call(this, bindingName);
this.bindingName_ = bindingName;
this.exportName_ = exportName;
};
var $InsertBindingAssignmentTransformer = InsertBindingAssignmentTransformer;
($traceurRuntime.createClass)(InsertBindingAssignmentTransformer, {
matchesBindingName_: function(binding) {
return binding.type === IDENTIFIER_EXPRESSION && binding.identifierToken.value == this.bindingName_;
},
transformUnaryExpression: function(tree) {
if (!this.matchesBindingName_(tree.operand))
return $traceurRuntime.superGet(this, $InsertBindingAssignmentTransformer.prototype, "transformUnaryExpression").call(this, tree);
var operatorType = tree.operator.type;
if (operatorType !== PLUS_PLUS && operatorType !== MINUS_MINUS)
return $traceurRuntime.superGet(this, $InsertBindingAssignmentTransformer.prototype, "transformUnaryExpression").call(this, tree);
var operand = this.transformAny(tree.operand);
if (operand !== tree.operand)
tree = new UnaryExpression(tree.location, tree.operator, operand);
return parseExpression($__1, this.exportName_, tree);
},
transformPostfixExpression: function(tree) {
tree = $traceurRuntime.superGet(this, $InsertBindingAssignmentTransformer.prototype, "transformPostfixExpression").call(this, tree);
if (!this.matchesBindingName_(tree.operand))
return tree;
switch (tree.operator.type) {
case PLUS_PLUS:
return parseExpression($__2, this.exportName_, tree.operand, tree);
case MINUS_MINUS:
return parseExpression($__3, this.exportName_, tree.operand, tree);
}
return tree;
},
transformBinaryExpression: function(tree) {
tree = $traceurRuntime.superGet(this, $InsertBindingAssignmentTransformer.prototype, "transformBinaryExpression").call(this, tree);
if (!tree.operator.isAssignmentOperator())
return tree;
if (!this.matchesBindingName_(tree.left))
return tree;
return parseExpression($__4, this.exportName_, tree);
}
}, {}, ScopeTransformer);
var InstantiateModuleTransformer = function InstantiateModuleTransformer(identifierGenerator) {
$traceurRuntime.superConstructor($InstantiateModuleTransformer).call(this, identifierGenerator);
this.inExport_ = false;
this.curDepIndex_ = null;
this.dependencies = [];
this.externalExportBindings = [];
this.importBindings = [];
this.localExportBindings = [];
this.functionDeclarations = [];
this.moduleBindings = [];
this.exportStarBindings = [];
};
var $InstantiateModuleTransformer = InstantiateModuleTransformer;
($traceurRuntime.createClass)(InstantiateModuleTransformer, {
wrapModule: function(statements) {
if (this.moduleName) {
return parseStatements($__5, this.moduleName, this.dependencies, statements);
} else {
return parseStatements($__6, this.dependencies, statements);
}
},
appendExportStatement: function(statements) {
var $__31 = this;
var declarationExtractionTransformer = new DeclarationExtractionTransformer();
this.localExportBindings.forEach((function(binding) {
statements = new InsertBindingAssignmentTransformer(binding.exportName, binding.localName).transformList(statements);
}));
var executionStatements = statements.map((function(statement) {
return declarationExtractionTransformer.transformAny(statement);
}));
var executionFunction = createFunctionExpression(createEmptyParameterList(), createFunctionBody(executionStatements));
var declarationStatements = declarationExtractionTransformer.getDeclarationStatements();
var setterFunctions = this.dependencies.map((function(dep, index) {
var importBindings = $__31.importBindings[index];
var externalExportBindings = $__31.externalExportBindings[index];
var exportStarBinding = $__31.exportStarBindings[index];
var moduleBinding = $__31.moduleBindings[index];
var setterStatements = [];
if (importBindings) {
importBindings.forEach((function(binding) {
setterStatements.push(parseStatement($__7, createIdentifierToken(binding.variableName), binding.exportName));
}));
}
if (externalExportBindings) {
externalExportBindings.forEach((function(binding) {
setterStatements.push(parseStatement($__8, binding.exportName, binding.importName));
}));
}
if (moduleBinding) {
setterStatements.push(parseStatement($__9, id(moduleBinding)));
}
if (exportStarBinding) {
setterStatements = setterStatements.concat(parseStatements($__10));
}
if (setterStatements.length) {
return parseExpression($__11, setterStatements);
} else {
return parseExpression($__12);
}
}));
declarationStatements = declarationStatements.concat(this.functionDeclarations.map((function(binding) {
return parseStatement($__13, binding.exportName, createIdentifierToken(binding.functionName));
})));
declarationStatements.push(parseStatement($__14, new ArrayLiteralExpression(null, setterFunctions), executionFunction));
return declarationStatements;
},
addLocalExportBinding: function(exportName) {
var localName = arguments[1] !== (void 0) ? arguments[1] : exportName;
this.localExportBindings.push({
exportName: exportName,
localName: localName
});
},
addImportBinding: function(depIndex, variableName, exportName) {
this.importBindings[depIndex] = this.importBindings[depIndex] || [];
this.importBindings[depIndex].push({
variableName: variableName,
exportName: exportName
});
},
addExternalExportBinding: function(depIndex, exportName, importName) {
this.externalExportBindings[depIndex] = this.externalExportBindings[depIndex] || [];
this.externalExportBindings[depIndex].push({
exportName: exportName,
importName: importName
});
},
addExportStarBinding: function(depIndex) {
this.exportStarBindings[depIndex] = true;
},
addModuleBinding: function(depIndex, variableName) {
this.moduleBindings[depIndex] = variableName;
},
addExportFunction: function(exportName) {
var functionName = arguments[1] !== (void 0) ? arguments[1] : exportName;
this.functionDeclarations.push({
exportName: exportName,
functionName: functionName
});
},
getOrCreateDependencyIndex: function(moduleSpecifier) {
var name = moduleSpecifier.token.processedValue;
var depIndex = this.dependencies.indexOf(name);
if (depIndex == -1) {
depIndex = this.dependencies.length;
this.dependencies.push(name);
}
return depIndex;
},
transformExportDeclaration: function(tree) {
this.inExport_ = true;
if (tree.declaration.moduleSpecifier) {
this.curDepIndex_ = this.getOrCreateDependencyIndex(tree.declaration.moduleSpecifier);
} else {
this.curDepIndex_ = null;
}
var transformed = this.transformAny(tree.declaration);
this.inExport_ = false;
return transformed;
},
transformVariableStatement: function(tree) {
var $__31 = this;
if (!this.inExport_)
return $traceurRuntime.superGet(this, $InstantiateModuleTransformer.prototype, "transformVariableStatement").call(this, tree);
this.inExport_ = false;
return createVariableStatement(createVariableDeclarationList(VAR, tree.declarations.declarations.map((function(declaration) {
var varName = declaration.lvalue.identifierToken.value;
var initializer;
$__31.addLocalExportBinding(varName);
if (declaration.initializer)
initializer = parseExpression($__15, varName, $__31.transformAny(declaration.initializer));
else
initializer = parseExpression($__16, varName, id(varName));
return createVariableDeclaration(varName, initializer);
}))));
},
transformExportStar: function(tree) {
this.inExport_ = false;
this.addExportStarBinding(this.curDepIndex_);
return new AnonBlock(null, []);
},
transformClassDeclaration: function(tree) {
if (!this.inExport_)
return $traceurRuntime.superGet(this, $InstantiateModuleTransformer.prototype, "transformClassDeclaration").call(this, tree);
this.inExport_ = false;
var name = this.transformAny(tree.name);
var superClass = this.transformAny(tree.superClass);
var elements = this.transformList(tree.elements);
var annotations = this.transformList(tree.annotations);
var varName = name.identifierToken.value;
var classExpression = new ClassExpression(tree.location, name, superClass, elements, annotations);
this.addLocalExportBinding(varName);
return parseStatement($__17, varName, varName, classExpression);
},
transformFunctionDeclaration: function(tree) {
if (this.inExport_) {
var name = tree.name.getStringValue();
this.addLocalExportBinding(name);
this.addExportFunction(name);
this.inExport_ = false;
}
return $traceurRuntime.superGet(this, $InstantiateModuleTransformer.prototype, "transformFunctionDeclaration").call(this, tree);
},
transformNamedExport: function(tree) {
this.transformAny(tree.moduleSpecifier);
var specifierSet = this.transformAny(tree.specifierSet);
if (this.curDepIndex_ === null) {
return specifierSet;
} else {
return new AnonBlock(null, []);
}
},
transformImportDeclaration: function(tree) {
this.curDepIndex_ = this.getOrCreateDependencyIndex(tree.moduleSpecifier);
var initializer = this.transformAny(tree.moduleSpecifier);
if (!tree.importClause)
return new AnonBlock(null, []);
var importClause = this.transformAny(tree.importClause);
if (tree.importClause.type === IMPORT_SPECIFIER_SET) {
return importClause;
} else {
var bindingName = tree.importClause.binding.getStringValue();
this.addImportBinding(this.curDepIndex_, bindingName, 'default');
return parseStatement($__18, bindingName);
}
return new AnonBlock(null, []);
},
transformImportSpecifierSet: function(tree) {
return createVariableStatement(createVariableDeclarationList(VAR, this.transformList(tree.specifiers)));
},
transformExportDefault: function(tree) {
this.inExport_ = false;
var expression = this.transformAny(tree.expression);
this.addLocalExportBinding('default');
if (expression.type === CLASS_DECLARATION) {
expression = new ClassExpression(expression.location, expression.name, expression.superClass, expression.elements, expression.annotations);
}
if (expression.type === FUNCTION_DECLARATION) {
this.addExportFunction('default', expression.name.identifierToken.value);
return expression;
} else {
return parseStatement($__19, expression);
}
},
transformExportSpecifier: function(tree) {
var exportName;
var bindingName;
if (tree.rhs) {
exportName = tree.rhs.value;
bindingName = tree.lhs.value;
} else {
exportName = tree.lhs.value;
bindingName = exportName;
}
if (this.curDepIndex_ !== null) {
this.addExternalExportBinding(this.curDepIndex_, exportName, bindingName);
} else {
this.addLocalExportBinding(exportName, bindingName);
return parseExpression($__20, exportName, id(bindingName));
}
},
transformExportSpecifierSet: function(tree) {
var specifiers = this.transformList(tree.specifiers);
return new ExpressionStatement(tree.location, new CommaExpression(tree.location, specifiers.filter((function(specifier) {
return specifier;
}))));
},
transformImportSpecifier: function(tree) {
var localBinding = tree.binding.binding;
var localBindingToken = localBinding.identifierToken;
var importName = (tree.name || localBindingToken).value;
this.addImportBinding(this.curDepIndex_, localBindingToken.value, importName);
return createVariableDeclaration(localBinding);
},
transformModuleDeclaration: function(tree) {
this.transformAny(tree.expression);
var bindingIdentifier = tree.binding.binding;
var name = bindingIdentifier.getStringValue();
this.addModuleBinding(this.curDepIndex_, name);
return parseStatement($__21, bindingIdentifier);
},
transformModuleSpecifier: function(tree) {
this.curDepIndex_ = this.getOrCreateDependencyIndex(tree);
return tree;
}
}, {}, ModuleTransformer);
return {get InstantiateModuleTransformer() {
return InstantiateModuleTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/MemberVariableTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/MemberVariableTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/MemberVariableTransformer", path);
}
var $__0 = Object.freeze(Object.defineProperties(["get ", "():", "\n { return this.", "; }"], {raw: {value: Object.freeze(["get ", "():", "\n { return this.", "; }"])}})),
$__1 = Object.freeze(Object.defineProperties(["set ", "(value:", ")\n { this.", " = value; }"], {raw: {value: Object.freeze(["set ", "(value:", ")\n { this.", " = value; }"])}}));
var $__2 = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees"),
AnonBlock = $__2.AnonBlock,
ClassDeclaration = $__2.ClassDeclaration,
ClassExpression = $__2.ClassExpression;
var PROPERTY_VARIABLE_DECLARATION = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType").PROPERTY_VARIABLE_DECLARATION;
var parsePropertyDefinition = System.get("traceur@0.0.74/src/codegeneration/PlaceholderParser").parsePropertyDefinition;
var ParseTreeTransformer = System.get("traceur@0.0.74/src/codegeneration/ParseTreeTransformer").ParseTreeTransformer;
var MemberVariableTransformer = function MemberVariableTransformer(identifierGenerator) {
$traceurRuntime.superConstructor($MemberVariableTransformer).call(this);
this.identifierGenerator_ = identifierGenerator;
};
var $MemberVariableTransformer = MemberVariableTransformer;
($traceurRuntime.createClass)(MemberVariableTransformer, {
transformPropertyVariableDeclaration: function(tree) {
var identifier = this.identifierGenerator_.generateUniqueIdentifier();
var getter = this.createGetAccessor_(identifier, tree);
var setter = this.createSetAccessor_(identifier, tree);
return new AnonBlock(tree.location, [getter, setter]);
},
createGetAccessor_: function(identifier, tree) {
var name = tree.name.literalToken;
var type = tree.typeAnnotation;
var def = parsePropertyDefinition($__0, name, type, identifier);
def.isStatic = tree.isStatic;
return def;
},
createSetAccessor_: function(identifier, tree) {
var name = tree.name.literalToken;
var type = tree.typeAnnotation;
var def = parsePropertyDefinition($__1, name, type, identifier);
def.isStatic = tree.isStatic;
return def;
}
}, {}, ParseTreeTransformer);
return {get MemberVariableTransformer() {
return MemberVariableTransformer;
}};
});
System.register("traceur@0.0.74/src/outputgeneration/ParseTreeWriter", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/outputgeneration/ParseTreeWriter";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/outputgeneration/ParseTreeWriter", path);
}
var $__0 = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType"),
BLOCK = $__0.BLOCK,
CLASS_DECLARATION = $__0.CLASS_DECLARATION,
FUNCTION_DECLARATION = $__0.FUNCTION_DECLARATION,
IF_STATEMENT = $__0.IF_STATEMENT,
LITERAL_EXPRESSION = $__0.LITERAL_EXPRESSION,
POSTFIX_EXPRESSION = $__0.POSTFIX_EXPRESSION,
UNARY_EXPRESSION = $__0.UNARY_EXPRESSION;
var ParseTreeVisitor = System.get("traceur@0.0.74/src/syntax/ParseTreeVisitor").ParseTreeVisitor;
var $__2 = System.get("traceur@0.0.74/src/syntax/PredefinedName"),
AS = $__2.AS,
ASYNC = $__2.ASYNC,
AWAIT = $__2.AWAIT,
FROM = $__2.FROM,
GET = $__2.GET,
OF = $__2.OF,
SET = $__2.SET;
var $__3 = System.get("traceur@0.0.74/src/syntax/Scanner"),
isIdentifierPart = $__3.isIdentifierPart,
isWhitespace = $__3.isWhitespace;
var $__4 = System.get("traceur@0.0.74/src/syntax/TokenType"),
ARROW = $__4.ARROW,
AT = $__4.AT,
BACK_QUOTE = $__4.BACK_QUOTE,
BREAK = $__4.BREAK,
CASE = $__4.CASE,
CATCH = $__4.CATCH,
CLASS = $__4.CLASS,
CLOSE_ANGLE = $__4.CLOSE_ANGLE,
CLOSE_CURLY = $__4.CLOSE_CURLY,
CLOSE_PAREN = $__4.CLOSE_PAREN,
CLOSE_SQUARE = $__4.CLOSE_SQUARE,
COLON = $__4.COLON,
COMMA = $__4.COMMA,
CONTINUE = $__4.CONTINUE,
DEBUGGER = $__4.DEBUGGER,
DEFAULT = $__4.DEFAULT,
DO = $__4.DO,
DOT_DOT_DOT = $__4.DOT_DOT_DOT,
ELSE = $__4.ELSE,
EQUAL = $__4.EQUAL,
EXPORT = $__4.EXPORT,
EXTENDS = $__4.EXTENDS,
FINALLY = $__4.FINALLY,
FOR = $__4.FOR,
FUNCTION = $__4.FUNCTION,
IF = $__4.IF,
IMPORT = $__4.IMPORT,
IN = $__4.IN,
MINUS = $__4.MINUS,
MINUS_MINUS = $__4.MINUS_MINUS,
NEW = $__4.NEW,
NUMBER = $__4.NUMBER,
OPEN_ANGLE = $__4.OPEN_ANGLE,
OPEN_CURLY = $__4.OPEN_CURLY,
OPEN_PAREN = $__4.OPEN_PAREN,
OPEN_SQUARE = $__4.OPEN_SQUARE,
PERIOD = $__4.PERIOD,
PLUS = $__4.PLUS,
PLUS_PLUS = $__4.PLUS_PLUS,
QUESTION = $__4.QUESTION,
RETURN = $__4.RETURN,
SEMI_COLON = $__4.SEMI_COLON,
STAR = $__4.STAR,
STATIC = $__4.STATIC,
SUPER = $__4.SUPER,
SWITCH = $__4.SWITCH,
THIS = $__4.THIS,
THROW = $__4.THROW,
TRY = $__4.TRY,
WHILE = $__4.WHILE,
WITH = $__4.WITH,
YIELD = $__4.YIELD;
var NEW_LINE = '\n';
var LINE_LENGTH = 80;
var ParseTreeWriter = function ParseTreeWriter() {
var $__7,
$__8,
$__9;
var $__6 = arguments[0] !== (void 0) ? arguments[0] : {},
highlighted = ($__7 = $__6.highlighted) === void 0 ? false : $__7,
showLineNumbers = ($__8 = $__6.showLineNumbers) === void 0 ? false : $__8,
prettyPrint = ($__9 = $__6.prettyPrint) === void 0 ? true : $__9;
$traceurRuntime.superConstructor($ParseTreeWriter).call(this);
this.highlighted_ = highlighted;
this.showLineNumbers_ = showLineNumbers;
this.prettyPrint_ = prettyPrint;
this.result_ = '';
this.currentLine_ = '';
this.currentLineComment_ = null;
this.indentDepth_ = 0;
this.currentParameterTypeAnnotation_ = null;
};
var $ParseTreeWriter = ParseTreeWriter;
($traceurRuntime.createClass)(ParseTreeWriter, {
toString: function() {
if (this.currentLine_.length > 0) {
this.result_ += this.currentLine_;
this.currentLine_ = '';
}
return this.result_;
},
visitAny: function(tree) {
if (!tree) {
return;
}
if (tree === this.highlighted_) {
this.write_('\x1B[41m');
}
if (tree.location !== null && tree.location.start !== null && this.showLineNumbers_) {
var line = tree.location.start.line + 1;
var column = tree.location.start.column;
this.currentLineComment_ = ("Line: " + line + "." + column);
}
$traceurRuntime.superGet(this, $ParseTreeWriter.prototype, "visitAny").call(this, tree);
if (tree === this.highlighted_) {
this.write_('\x1B[0m');
}
},
visitAnnotation: function(tree) {
this.write_(AT);
this.visitAny(tree.name);
if (tree.args !== null) {
this.write_(OPEN_PAREN);
this.writeList_(tree.args, COMMA, false);
this.write_(CLOSE_PAREN);
}
},
visitArgumentList: function(tree) {
this.write_(OPEN_PAREN);
this.writeList_(tree.args, COMMA, false);
this.write_(CLOSE_PAREN);
},
visitArrayComprehension: function(tree) {
this.write_(OPEN_SQUARE);
this.visitList(tree.comprehensionList);
this.visitAny(tree.expression);
this.write_(CLOSE_SQUARE);
},
visitArrayLiteralExpression: function(tree) {
this.write_(OPEN_SQUARE);
this.writeList_(tree.elements, COMMA, false);
this.write_(CLOSE_SQUARE);
},
visitArrayPattern: function(tree) {
this.write_(OPEN_SQUARE);
this.writeList_(tree.elements, COMMA, false);
this.write_(CLOSE_SQUARE);
},
visitArrowFunctionExpression: function(tree) {
if (tree.functionKind) {
this.write_(tree.functionKind);
this.writeSpace_();
}
this.write_(OPEN_PAREN);
this.visitAny(tree.parameterList);
this.write_(CLOSE_PAREN);
this.writeSpace_();
this.write_(ARROW);
this.writeSpace_();
this.visitAny(tree.body);
},
visitAssignmentElement: function(tree) {
this.visitAny(tree.assignment);
if (tree.initializer) {
this.writeSpace_();
this.write_(EQUAL);
this.writeSpace_();
this.visitAny(tree.initializer);
}
},
visitAwaitExpression: function(tree) {
this.write_(AWAIT);
this.writeSpace_();
this.visitAny(tree.expression);
},
visitBinaryExpression: function(tree) {
var left = tree.left;
this.visitAny(left);
var operator = tree.operator;
if (left.type === POSTFIX_EXPRESSION && requiresSpaceBetween(left.operator.type, operator.type)) {
this.writeRequiredSpace_();
} else {
this.writeSpace_();
}
this.write_(operator);
var right = tree.right;
if (right.type === UNARY_EXPRESSION && requiresSpaceBetween(operator.type, right.operator.type)) {
this.writeRequiredSpace_();
} else {
this.writeSpace_();
}
this.visitAny(right);
},
visitBindingElement: function(tree) {
var typeAnnotation = this.currentParameterTypeAnnotation_;
this.currentParameterTypeAnnotation_ = null;
this.visitAny(tree.binding);
this.writeTypeAnnotation_(typeAnnotation);
if (tree.initializer) {
this.writeSpace_();
this.write_(EQUAL);
this.writeSpace_();
this.visitAny(tree.initializer);
}
},
visitBindingIdentifier: function(tree) {
this.write_(tree.identifierToken);
},
visitBlock: function(tree) {
this.write_(OPEN_CURLY);
this.writelnList_(tree.statements);
this.write_(CLOSE_CURLY);
},
visitBreakStatement: function(tree) {
this.write_(BREAK);
if (tree.name !== null) {
this.writeSpace_();
this.write_(tree.name);
}
this.write_(SEMI_COLON);
},
visitCallExpression: function(tree) {
this.visitAny(tree.operand);
this.visitAny(tree.args);
},
visitCaseClause: function(tree) {
this.write_(CASE);
this.writeSpace_();
this.visitAny(tree.expression);
this.write_(COLON);
this.indentDepth_++;
this.writelnList_(tree.statements);
this.indentDepth_--;
},
visitCatch: function(tree) {
this.write_(CATCH);
this.writeSpace_();
this.write_(OPEN_PAREN);
this.visitAny(tree.binding);
this.write_(CLOSE_PAREN);
this.writeSpace_();
this.visitAny(tree.catchBody);
},
visitClassShared_: function(tree) {
this.writeAnnotations_(tree.annotations);
this.write_(CLASS);
this.writeSpace_();
this.visitAny(tree.name);
if (tree.superClass !== null) {
this.writeSpace_();
this.write_(EXTENDS);
this.writeSpace_();
this.visitAny(tree.superClass);
}
this.writeSpace_();
this.write_(OPEN_CURLY);
this.writelnList_(tree.elements);
this.write_(CLOSE_CURLY);
},
visitClassDeclaration: function(tree) {
this.visitClassShared_(tree);
},
visitClassExpression: function(tree) {
this.visitClassShared_(tree);
},
visitCommaExpression: function(tree) {
this.writeList_(tree.expressions, COMMA, false);
},
visitComprehensionFor: function(tree) {
this.write_(FOR);
this.writeSpace_();
this.write_(OPEN_PAREN);
this.visitAny(tree.left);
this.writeSpace_();
this.write_(OF);
this.writeSpace_();
this.visitAny(tree.iterator);
this.write_(CLOSE_PAREN);
this.writeSpace_();
},
visitComprehensionIf: function(tree) {
this.write_(IF);
this.writeSpace_();
this.write_(OPEN_PAREN);
this.visitAny(tree.expression);
this.write_(CLOSE_PAREN);
this.writeSpace_();
},
visitComputedPropertyName: function(tree) {
this.write_(OPEN_SQUARE);
this.visitAny(tree.expression);
this.write_(CLOSE_SQUARE);
},
visitConditionalExpression: function(tree) {
this.visitAny(tree.condition);
this.writeSpace_();
this.write_(QUESTION);
this.writeSpace_();
this.visitAny(tree.left);
this.writeSpace_();
this.write_(COLON);
this.writeSpace_();
this.visitAny(tree.right);
},
visitContinueStatement: function(tree) {
this.write_(CONTINUE);
if (tree.name !== null) {
this.writeSpace_();
this.write_(tree.name);
}
this.write_(SEMI_COLON);
},
visitCoverInitializedName: function(tree) {
this.write_(tree.name);
this.writeSpace_();
this.write_(tree.equalToken);
this.writeSpace_();
this.visitAny(tree.initializer);
},
visitDebuggerStatement: function(tree) {
this.write_(DEBUGGER);
this.write_(SEMI_COLON);
},
visitDefaultClause: function(tree) {
this.write_(DEFAULT);
this.write_(COLON);
this.indentDepth_++;
this.writelnList_(tree.statements);
this.indentDepth_--;
},
visitDoWhileStatement: function(tree) {
this.write_(DO);
this.visitAnyBlockOrIndent_(tree.body);
this.writeSpace_();
this.write_(WHILE);
this.writeSpace_();
this.write_(OPEN_PAREN);
this.visitAny(tree.condition);
this.write_(CLOSE_PAREN);
this.write_(SEMI_COLON);
},
visitEmptyStatement: function(tree) {
this.write_(SEMI_COLON);
},
visitExportDeclaration: function(tree) {
this.writeAnnotations_(tree.annotations);
this.write_(EXPORT);
this.writeSpace_();
this.visitAny(tree.declaration);
},
visitExportDefault: function(tree) {
this.write_(DEFAULT);
this.writeSpace_();
this.visitAny(tree.expression);
switch (tree.expression.type) {
case CLASS_DECLARATION:
case FUNCTION_DECLARATION:
break;
default:
this.write_(SEMI_COLON);
}
},
visitNamedExport: function(tree) {
this.visitAny(tree.specifierSet);
if (tree.moduleSpecifier) {
this.writeSpace_();
this.write_(FROM);
this.writeSpace_();
this.visitAny(tree.moduleSpecifier);
}
this.write_(SEMI_COLON);
},
visitExportSpecifier: function(tree) {
this.write_(tree.lhs);
if (tree.rhs) {
this.writeSpace_();
this.write_(AS);
this.writeSpace_();
this.write_(tree.rhs);
}
},
visitExportSpecifierSet: function(tree) {
this.write_(OPEN_CURLY);
this.writeList_(tree.specifiers, COMMA, false);
this.write_(CLOSE_CURLY);
},
visitExportStar: function(tree) {
this.write_(STAR);
},
visitExpressionStatement: function(tree) {
this.visitAny(tree.expression);
this.write_(SEMI_COLON);
},
visitFinally: function(tree) {
this.write_(FINALLY);
this.writeSpace_();
this.visitAny(tree.block);
},
visitForOfStatement: function(tree) {
this.write_(FOR);
this.writeSpace_();
this.write_(OPEN_PAREN);
this.visitAny(tree.initializer);
this.writeSpace_();
this.write_(OF);
this.writeSpace_();
this.visitAny(tree.collection);
this.write_(CLOSE_PAREN);
this.visitAnyBlockOrIndent_(tree.body);
},
visitForInStatement: function(tree) {
this.write_(FOR);
this.writeSpace_();
this.write_(OPEN_PAREN);
this.visitAny(tree.initializer);
this.writeSpace_();
this.write_(IN);
this.writeSpace_();
this.visitAny(tree.collection);
this.write_(CLOSE_PAREN);
this.visitAnyBlockOrIndent_(tree.body);
},
visitForStatement: function(tree) {
this.write_(FOR);
this.writeSpace_();
this.write_(OPEN_PAREN);
this.visitAny(tree.initializer);
this.write_(SEMI_COLON);
this.writeSpace_();
this.visitAny(tree.condition);
this.write_(SEMI_COLON);
this.writeSpace_();
this.visitAny(tree.increment);
this.write_(CLOSE_PAREN);
this.visitAnyBlockOrIndent_(tree.body);
},
visitFormalParameterList: function(tree) {
var first = true;
for (var i = 0; i < tree.parameters.length; i++) {
var parameter = tree.parameters[i];
if (first) {
first = false;
} else {
this.write_(COMMA);
this.writeSpace_();
}
this.visitAny(parameter);
}
},
visitFormalParameter: function(tree) {
this.writeAnnotations_(tree.annotations, false);
this.currentParameterTypeAnnotation_ = tree.typeAnnotation;
this.visitAny(tree.parameter);
this.currentParameterTypeAnnotation_ = null;
},
visitFunctionBody: function(tree) {
this.write_(OPEN_CURLY);
this.writelnList_(tree.statements);
this.write_(CLOSE_CURLY);
},
visitFunctionDeclaration: function(tree) {
this.visitFunction_(tree);
},
visitFunctionExpression: function(tree) {
this.visitFunction_(tree);
},
visitFunction_: function(tree) {
this.writeAnnotations_(tree.annotations);
if (tree.isAsyncFunction())
this.write_(tree.functionKind);
this.write_(FUNCTION);
if (tree.isGenerator())
this.write_(tree.functionKind);
if (tree.name) {
this.writeSpace_();
this.visitAny(tree.name);
}
this.write_(OPEN_PAREN);
this.visitAny(tree.parameterList);
this.write_(CLOSE_PAREN);
this.writeTypeAnnotation_(tree.typeAnnotation);
this.writeSpace_();
this.visitAny(tree.body);
},
visitGeneratorComprehension: function(tree) {
this.write_(OPEN_PAREN);
this.visitList(tree.comprehensionList);
this.visitAny(tree.expression);
this.write_(CLOSE_PAREN);
},
visitGetAccessor: function(tree) {
this.writeAnnotations_(tree.annotations);
if (tree.isStatic) {
this.write_(STATIC);
this.writeSpace_();
}
this.write_(GET);
this.writeSpace_();
this.visitAny(tree.name);
this.write_(OPEN_PAREN);
this.write_(CLOSE_PAREN);
this.writeSpace_();
this.writeTypeAnnotation_(tree.typeAnnotation);
this.visitAny(tree.body);
},
visitIdentifierExpression: function(tree) {
this.write_(tree.identifierToken);
},
visitIfStatement: function(tree) {
this.write_(IF);
this.writeSpace_();
this.write_(OPEN_PAREN);
this.visitAny(tree.condition);
this.write_(CLOSE_PAREN);
this.visitAnyBlockOrIndent_(tree.ifClause);
if (tree.elseClause) {
if (tree.ifClause.type === BLOCK)
this.writeSpace_();
this.write_(ELSE);
if (tree.elseClause.type === IF_STATEMENT) {
this.writeSpace_();
this.visitAny(tree.elseClause);
} else {
this.visitAnyBlockOrIndent_(tree.elseClause);
}
}
},
visitAnyBlockOrIndent_: function(tree) {
if (tree.type === BLOCK) {
this.writeSpace_();
this.visitAny(tree);
} else {
this.visitAnyIndented_(tree);
}
},
visitAnyIndented_: function(tree) {
var indent = arguments[1] !== (void 0) ? arguments[1] : 1;
if (this.prettyPrint_) {
this.indentDepth_ += indent;
this.writeln_();
}
this.visitAny(tree);
if (this.prettyPrint_) {
this.indentDepth_ -= indent;
this.writeln_();
}
},
visitImportDeclaration: function(tree) {
this.write_(IMPORT);
this.writeSpace_();
if (tree.importClause) {
this.visitAny(tree.importClause);
this.writeSpace_();
this.write_(FROM);
this.writeSpace_();
}
this.visitAny(tree.moduleSpecifier);
this.write_(SEMI_COLON);
},
visitImportSpecifier: function(tree) {
if (tree.name) {
this.write_(tree.name);
this.writeSpace_();
this.write_(AS);
this.writeSpace_();
}
this.visitAny(tree.binding);
},
visitImportSpecifierSet: function(tree) {
if (tree.specifiers.type == STAR) {
this.write_(STAR);
} else {
this.write_(OPEN_CURLY);
this.writelnList_(tree.specifiers, COMMA);
this.write_(CLOSE_CURLY);
}
},
visitLabelledStatement: function(tree) {
this.write_(tree.name);
this.write_(COLON);
this.writeSpace_();
this.visitAny(tree.statement);
},
visitLiteralExpression: function(tree) {
this.write_(tree.literalToken);
},
visitLiteralPropertyName: function(tree) {
this.write_(tree.literalToken);
},
visitMemberExpression: function(tree) {
this.visitAny(tree.operand);
if (tree.operand.type === LITERAL_EXPRESSION && tree.operand.literalToken.type === NUMBER) {
if (!/\.|e|E/.test(tree.operand.literalToken.value))
this.writeRequiredSpace_();
}
this.write_(PERIOD);
this.write_(tree.memberName);
},
visitMemberLookupExpression: function(tree) {
this.visitAny(tree.operand);
this.write_(OPEN_SQUARE);
this.visitAny(tree.memberExpression);
this.write_(CLOSE_SQUARE);
},
visitSyntaxErrorTree: function(tree) {
this.write_('(function() {' + ("throw SyntaxError(" + JSON.stringify(tree.message) + ");") + '})()');
},
visitModule: function(tree) {
this.writelnList_(tree.scriptItemList, null);
},
visitModuleSpecifier: function(tree) {
this.write_(tree.token);
},
visitModuleDeclaration: function(tree) {
this.write_(IMPORT);
this.writeSpace_();
this.write_(STAR);
this.writeSpace_();
this.write_(AS);
this.visitAny(tree.binding);
this.writeSpace_();
this.write_(FROM);
this.writeSpace_();
this.visitAny(tree.expression);
this.write_(SEMI_COLON);
},
visitNewExpression: function(tree) {
this.write_(NEW);
this.writeSpace_();
this.visitAny(tree.operand);
this.visitAny(tree.args);
},
visitObjectLiteralExpression: function(tree) {
this.write_(OPEN_CURLY);
if (tree.propertyNameAndValues.length > 1)
this.writeln_();
this.writelnList_(tree.propertyNameAndValues, COMMA);
if (tree.propertyNameAndValues.length > 1)
this.writeln_();
this.write_(CLOSE_CURLY);
},
visitObjectPattern: function(tree) {
this.write_(OPEN_CURLY);
this.writelnList_(tree.fields, COMMA);
this.write_(CLOSE_CURLY);
},
visitObjectPatternField: function(tree) {
this.visitAny(tree.name);
if (tree.element !== null) {
this.write_(COLON);
this.writeSpace_();
this.visitAny(tree.element);
}
},
visitParenExpression: function(tree) {
this.write_(OPEN_PAREN);
$traceurRuntime.superGet(this, $ParseTreeWriter.prototype, "visitParenExpression").call(this, tree);
this.write_(CLOSE_PAREN);
},
visitPostfixExpression: function(tree) {
this.visitAny(tree.operand);
if (tree.operand.type === POSTFIX_EXPRESSION && tree.operand.operator.type === tree.operator.type) {
this.writeRequiredSpace_();
}
this.write_(tree.operator);
},
visitPredefinedType: function(tree) {
this.write_(tree.typeToken);
},
visitScript: function(tree) {
this.writelnList_(tree.scriptItemList, null);
},
visitPropertyMethodAssignment: function(tree) {
this.writeAnnotations_(tree.annotations);
if (tree.isStatic) {
this.write_(STATIC);
this.writeSpace_();
}
if (tree.isGenerator())
this.write_(STAR);
if (tree.isAsyncFunction())
this.write_(ASYNC);
this.visitAny(tree.name);
this.write_(OPEN_PAREN);
this.visitAny(tree.parameterList);
this.write_(CLOSE_PAREN);
this.writeSpace_();
this.writeTypeAnnotation_(tree.typeAnnotation);
this.visitAny(tree.body);
},
visitPropertyNameAssignment: function(tree) {
this.visitAny(tree.name);
this.write_(COLON);
this.writeSpace_();
this.visitAny(tree.value);
},
visitPropertyNameShorthand: function(tree) {
this.write_(tree.name);
},
visitPropertyVariableDeclaration: function(tree) {
this.writeAnnotations_(tree.annotations);
if (tree.isStatic) {
this.write_(STATIC);
this.writeSpace_();
}
this.visitAny(tree.name);
this.writeTypeAnnotation_(tree.typeAnnotation);
this.write_(SEMI_COLON);
},
visitTemplateLiteralExpression: function(tree) {
if (tree.operand) {
this.visitAny(tree.operand);
this.writeSpace_();
}
this.writeRaw_(BACK_QUOTE);
this.visitList(tree.elements);
this.writeRaw_(BACK_QUOTE);
},
visitTemplateLiteralPortion: function(tree) {
this.writeRaw_(tree.value);
},
visitTemplateSubstitution: function(tree) {
this.writeRaw_('$');
this.writeRaw_(OPEN_CURLY);
this.visitAny(tree.expression);
this.writeRaw_(CLOSE_CURLY);
},
visitReturnStatement: function(tree) {
this.write_(RETURN);
this.writeSpace_(tree.expression);
this.visitAny(tree.expression);
this.write_(SEMI_COLON);
},
visitRestParameter: function(tree) {
this.write_(DOT_DOT_DOT);
this.write_(tree.identifier.identifierToken);
this.writeTypeAnnotation_(this.currentParameterTypeAnnotation_);
},
visitSetAccessor: function(tree) {
this.writeAnnotations_(tree.annotations);
if (tree.isStatic) {
this.write_(STATIC);
this.writeSpace_();
}
this.write_(SET);
this.writeSpace_();
this.visitAny(tree.name);
this.write_(OPEN_PAREN);
this.visitAny(tree.parameterList);
this.write_(CLOSE_PAREN);
this.writeSpace_();
this.visitAny(tree.body);
},
visitSpreadExpression: function(tree) {
this.write_(DOT_DOT_DOT);
this.visitAny(tree.expression);
},
visitSpreadPatternElement: function(tree) {
this.write_(DOT_DOT_DOT);
this.visitAny(tree.lvalue);
},
visitStateMachine: function(tree) {
throw new Error('State machines cannot be converted to source');
},
visitSuperExpression: function(tree) {
this.write_(SUPER);
},
visitSwitchStatement: function(tree) {
this.write_(SWITCH);
this.writeSpace_();
this.write_(OPEN_PAREN);
this.visitAny(tree.expression);
this.write_(CLOSE_PAREN);
this.writeSpace_();
this.write_(OPEN_CURLY);
this.writelnList_(tree.caseClauses);
this.write_(CLOSE_CURLY);
},
visitThisExpression: function(tree) {
this.write_(THIS);
},
visitThrowStatement: function(tree) {
this.write_(THROW);
this.writeSpace_();
this.visitAny(tree.value);
this.write_(SEMI_COLON);
},
visitTryStatement: function(tree) {
this.write_(TRY);
this.writeSpace_();
this.visitAny(tree.body);
if (tree.catchBlock) {
this.writeSpace_();
this.visitAny(tree.catchBlock);
}
if (tree.finallyBlock) {
this.writeSpace_();
this.visitAny(tree.finallyBlock);
}
},
visitTypeArguments: function(tree) {
this.write_(OPEN_ANGLE);
var args = tree.args;
this.visitAny(args[0]);
for (var i = 1; i < args.length; i++) {
this.write_(COMMA);
this.writeSpace_();
this.visitAny(args[i]);
}
this.write_(CLOSE_ANGLE);
},
visitTypeName: function(tree) {
if (tree.moduleName) {
this.visitAny(tree.moduleName);
this.write_(PERIOD);
}
this.write_(tree.name);
},
visitUnaryExpression: function(tree) {
var op = tree.operator;
this.write_(op);
var operand = tree.operand;
if (operand.type === UNARY_EXPRESSION && requiresSpaceBetween(op.type, operand.operator.type)) {
this.writeRequiredSpace_();
}
this.visitAny(operand);
},
visitVariableDeclarationList: function(tree) {
this.write_(tree.declarationType);
this.writeSpace_();
this.writeList_(tree.declarations, COMMA, true, 2);
},
visitVariableDeclaration: function(tree) {
this.visitAny(tree.lvalue);
this.writeTypeAnnotation_(tree.typeAnnotation);
if (tree.initializer !== null) {
this.writeSpace_();
this.write_(EQUAL);
this.writeSpace_();
this.visitAny(tree.initializer);
}
},
visitVariableStatement: function(tree) {
$traceurRuntime.superGet(this, $ParseTreeWriter.prototype, "visitVariableStatement").call(this, tree);
this.write_(SEMI_COLON);
},
visitWhileStatement: function(tree) {
this.write_(WHILE);
this.writeSpace_();
this.write_(OPEN_PAREN);
this.visitAny(tree.condition);
this.write_(CLOSE_PAREN);
this.visitAnyBlockOrIndent_(tree.body);
},
visitWithStatement: function(tree) {
this.write_(WITH);
this.writeSpace_();
this.write_(OPEN_PAREN);
this.visitAny(tree.expression);
this.write_(CLOSE_PAREN);
this.writeSpace_();
this.visitAny(tree.body);
},
visitYieldExpression: function(tree) {
this.write_(YIELD);
if (tree.isYieldFor)
this.write_(STAR);
if (tree.expression) {
this.writeSpace_();
this.visitAny(tree.expression);
}
},
writeCurrentln_: function() {
this.result_ += this.currentLine_ + NEW_LINE;
},
writeln_: function() {
if (this.currentLineComment_) {
while (this.currentLine_.length < LINE_LENGTH) {
this.currentLine_ += ' ';
}
this.currentLine_ += ' // ' + this.currentLineComment_;
this.currentLineComment_ = null;
}
if (this.currentLine_)
this.writeCurrentln_();
this.currentLine_ = '';
},
writelnList_: function(list, delimiter) {
if (delimiter) {
this.writeList_(list, delimiter, true);
} else {
if (list.length > 0)
this.writeln_();
this.writeList_(list, null, true);
if (list.length > 0)
this.writeln_();
}
},
writeList_: function(list, delimiter, writeNewLine) {
var indent = arguments[3] !== (void 0) ? arguments[3] : 0;
var first = true;
for (var i = 0; i < list.length; i++) {
var element = list[i];
if (first) {
first = false;
} else {
if (delimiter !== null) {
this.write_(delimiter);
if (!writeNewLine)
this.writeSpace_();
}
if (writeNewLine) {
if (i === 1)
this.indentDepth_ += indent;
this.writeln_();
}
}
this.visitAny(element);
}
if (writeNewLine && list.length > 1)
this.indentDepth_ -= indent;
},
writeRaw_: function(value) {
this.currentLine_ += value;
},
write_: function(value) {
if (value === CLOSE_CURLY)
this.indentDepth_--;
if (value !== null) {
if (this.prettyPrint_) {
if (!this.currentLine_) {
for (var i = 0,
indent = this.indentDepth_; i < indent; i++) {
this.currentLine_ += ' ';
}
}
}
if (this.needsSpace_(value))
this.currentLine_ += ' ';
this.currentLine_ += value;
}
if (value === OPEN_CURLY)
this.indentDepth_++;
},
writeSpace_: function() {
var useSpace = arguments[0] !== (void 0) ? arguments[0] : this.prettyPrint_;
if (useSpace && !endsWithSpace(this.currentLine_))
this.currentLine_ += ' ';
},
writeRequiredSpace_: function() {
this.writeSpace_(true);
},
writeTypeAnnotation_: function(typeAnnotation) {
if (typeAnnotation !== null) {
this.write_(COLON);
this.writeSpace_();
this.visitAny(typeAnnotation);
}
},
writeAnnotations_: function(annotations) {
var writeNewLine = arguments[1] !== (void 0) ? arguments[1] : this.prettyPrint_;
if (annotations.length > 0) {
this.writeList_(annotations, null, writeNewLine);
if (writeNewLine)
this.writeln_();
}
},
needsSpace_: function(token) {
var line = this.currentLine_;
if (!line)
return false;
var lastCode = line.charCodeAt(line.length - 1);
if (isWhitespace(lastCode))
return false;
var firstCode = token.toString().charCodeAt(0);
return isIdentifierPart(firstCode) && (isIdentifierPart(lastCode) || lastCode === 47);
}
}, {}, ParseTreeVisitor);
function requiresSpaceBetween(first, second) {
return (first === MINUS || first === MINUS_MINUS) && (second === MINUS || second === MINUS_MINUS) || (first === PLUS || first === PLUS_PLUS) && (second === PLUS || second === PLUS_PLUS);
}
function endsWithSpace(s) {
return isWhitespace(s.charCodeAt(s.length - 1));
}
return {get ParseTreeWriter() {
return ParseTreeWriter;
}};
});
System.register("traceur@0.0.74/src/outputgeneration/ParseTreeMapWriter", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/outputgeneration/ParseTreeMapWriter";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/outputgeneration/ParseTreeMapWriter", path);
}
var ParseTreeWriter = System.get("traceur@0.0.74/src/outputgeneration/ParseTreeWriter").ParseTreeWriter;
var ParseTreeMapWriter = function ParseTreeMapWriter(sourceMapGenerator, sourceRoot) {
var options = arguments[2];
$traceurRuntime.superConstructor($ParseTreeMapWriter).call(this, options);
this.sourceMapGenerator_ = sourceMapGenerator;
this.sourceRoot_ = sourceRoot;
this.outputLineCount_ = 1;
this.isFirstMapping_ = true;
};
var $ParseTreeMapWriter = ParseTreeMapWriter;
($traceurRuntime.createClass)(ParseTreeMapWriter, {
visitAny: function(tree) {
if (!tree) {
return;
}
if (tree.location)
this.enterBranch(tree.location);
$traceurRuntime.superGet(this, $ParseTreeMapWriter.prototype, "visitAny").call(this, tree);
if (tree.location)
this.exitBranch(tree.location);
},
writeCurrentln_: function() {
$traceurRuntime.superGet(this, $ParseTreeMapWriter.prototype, "writeCurrentln_").call(this);
this.flushMappings();
this.outputLineCount_++;
this.generated_ = {
line: this.outputLineCount_,
column: 0
};
this.flushMappings();
},
write_: function(value) {
if (this.entered_) {
this.generate();
$traceurRuntime.superGet(this, $ParseTreeMapWriter.prototype, "write_").call(this, value);
this.generate();
} else {
this.generate();
$traceurRuntime.superGet(this, $ParseTreeMapWriter.prototype, "write_").call(this, value);
this.generate();
}
},
generate: function() {
var column = this.currentLine_.length ? this.currentLine_.length - 1 : 0;
this.generated_ = {
line: this.outputLineCount_,
column: column
};
this.flushMappings();
},
enterBranch: function(location) {
this.originate(location.start);
this.entered_ = true;
},
exitBranch: function(location) {
var position = location.end;
var endOfPreviousToken = {
line: position.line,
column: position.column ? position.column - 1 : 0,
source: {
name: position.source.name,
contents: position.source.contents
}
};
this.originate(endOfPreviousToken);
this.entered_ = false;
},
originate: function(position) {
var line = position.line + 1;
if (this.original_ && this.original_.line !== line)
this.flushMappings();
this.original_ = {
line: line,
column: position.column || 0
};
if (position.source.name !== this.sourceName_) {
this.sourceName_ = relativeToSourceRoot(position.source.name, this.sourceRoot_);
this.sourceMapGenerator_.setSourceContent(position.source.name, position.source.contents);
}
this.flushMappings();
},
flushMappings: function() {
if (this.original_ && this.generated_) {
this.addMapping();
this.original_ = null;
this.generated_ = null;
}
},
isSame: function(lhs, rhs) {
return lhs.line === rhs.line && lhs.column === rhs.column;
},
isSameMapping: function() {
if (!this.previousMapping_)
return false;
if (this.isSame(this.previousMapping_.generated, this.generated_) && this.isSame(this.previousMapping_.original, this.original_))
return true;
;
},
addMapping: function() {
if (this.isSameMapping())
return;
var mapping = {
generated: this.generated_,
original: this.original_,
source: this.sourceName_
};
this.sourceMapGenerator_.addMapping(mapping);
this.previousMapping_ = mapping;
}
}, {}, ParseTreeWriter);
function relativeToSourceRoot(name, sourceRoot) {
var $__2;
if (!name || name[0] === '@')
return name;
if (!sourceRoot)
return name;
var nameSegments = name.split('/');
var rootSegments = sourceRoot.split('/');
if (rootSegments[rootSegments.length - 1]) {
rootSegments.push('');
}
var commonSegmentsLength = 0;
var uniqueSegments = [];
nameSegments.forEach((function(segment, index) {
if (segment === rootSegments[index]) {
commonSegmentsLength++;
return false;
}
uniqueSegments.push(segment);
}));
if (commonSegmentsLength < 1 || commonSegmentsLength === rootSegments.length)
return name;
var dotDotSegments = rootSegments.length - commonSegmentsLength - 1;
var segments = [];
while (dotDotSegments--) {
segments.push('..');
}
($__2 = segments).push.apply($__2, $traceurRuntime.spread(uniqueSegments));
return segments.join('/');
}
return {
get ParseTreeMapWriter() {
return ParseTreeMapWriter;
},
get relativeToSourceRoot() {
return relativeToSourceRoot;
}
};
});
System.register("traceur@0.0.74/src/outputgeneration/SourceMapIntegration", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/outputgeneration/SourceMapIntegration";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/outputgeneration/SourceMapIntegration", path);
}
function makeDefine(mapping, id) {
var require = function(id) {
return mapping[id];
};
var exports = mapping[id] = {};
var module = null;
return function(factory) {
factory(require, exports, module);
};
}
var define,
m = {};
define = makeDefine(m, './util');
if (typeof define !== 'function') {
var define = require('amdefine')(module, require);
}
define(function(require, exports, module) {
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;
function normalize(aPath) {
var path = aPath;
var url = urlParse(aPath);
if (url) {
if (!url.path) {
return aPath;
}
path = url.path;
}
var isAbsolute = (path.charAt(0) === '/');
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 === '') {
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;
function join(aRoot, aPath) {
var aPathUrl = urlParse(aPath);
var aRootUrl = urlParse(aRoot);
if (aRootUrl) {
aRoot = aRootUrl.path || '/';
}
if (aPathUrl && !aPathUrl.scheme) {
if (aRootUrl) {
aPathUrl.scheme = aRootUrl.scheme;
}
return urlGenerate(aPathUrl);
}
if (aPathUrl || aPath.match(dataUrlRegexp)) {
return aPath;
}
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;
function toSetString(aStr) {
return '$' + aStr;
}
exports.toSetString = toSetString;
function fromSetString(aStr) {
return aStr.substr(1);
}
exports.fromSetString = fromSetString;
function relative(aRoot, aPath) {
aRoot = aRoot.replace(/\/$/, '');
var url = urlParse(aRoot);
if (aPath.charAt(0) == "/" && url && url.path == "/") {
return aPath.slice(1);
}
return aPath.indexOf(aRoot + '/') === 0 ? aPath.substr(aRoot.length + 1) : aPath;
}
exports.relative = relative;
function strcmp(aStr1, aStr2) {
var s1 = aStr1 || "";
var s2 = aStr2 || "";
return (s1 > s2) - (s1 < s2);
}
function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
var cmp;
cmp = strcmp(mappingA.source, mappingB.source);
if (cmp) {
return cmp;
}
cmp = mappingA.originalLine - mappingB.originalLine;
if (cmp) {
return cmp;
}
cmp = mappingA.originalColumn - mappingB.originalColumn;
if (cmp || onlyCompareOriginal) {
return cmp;
}
cmp = strcmp(mappingA.name, mappingB.name);
if (cmp) {
return cmp;
}
cmp = mappingA.generatedLine - mappingB.generatedLine;
if (cmp) {
return cmp;
}
return mappingA.generatedColumn - mappingB.generatedColumn;
}
;
exports.compareByOriginalPositions = compareByOriginalPositions;
function compareByGeneratedPositions(mappingA, mappingB, onlyCompareGenerated) {
var cmp;
cmp = mappingA.generatedLine - mappingB.generatedLine;
if (cmp) {
return cmp;
}
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
if (cmp || onlyCompareGenerated) {
return cmp;
}
cmp = strcmp(mappingA.source, mappingB.source);
if (cmp) {
return cmp;
}
cmp = mappingA.originalLine - mappingB.originalLine;
if (cmp) {
return cmp;
}
cmp = mappingA.originalColumn - mappingB.originalColumn;
if (cmp) {
return cmp;
}
return strcmp(mappingA.name, mappingB.name);
}
;
exports.compareByGeneratedPositions = compareByGeneratedPositions;
});
define = makeDefine(m, './array-set');
if (typeof define !== 'function') {
var define = require('amdefine')(module, require);
}
define(function(require, exports, module) {
var util = require('./util');
function ArraySet() {
this._array = [];
this._set = {};
}
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;
};
ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
var isDuplicate = this.has(aStr);
var idx = this._array.length;
if (!isDuplicate || aAllowDuplicates) {
this._array.push(aStr);
}
if (!isDuplicate) {
this._set[util.toSetString(aStr)] = idx;
}
};
ArraySet.prototype.has = function ArraySet_has(aStr) {
return Object.prototype.hasOwnProperty.call(this._set, util.toSetString(aStr));
};
ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
if (this.has(aStr)) {
return this._set[util.toSetString(aStr)];
}
throw new Error('"' + aStr + '" is not in the set.');
};
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);
};
ArraySet.prototype.toArray = function ArraySet_toArray() {
return this._array.slice();
};
exports.ArraySet = ArraySet;
});
define = makeDefine(m, './base64');
if (typeof define !== 'function') {
var define = require('amdefine')(module, require);
}
define(function(require, exports, module) {
var charToIntMap = {};
var intToCharMap = {};
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('').forEach(function(ch, index) {
charToIntMap[ch] = index;
intToCharMap[index] = ch;
});
exports.encode = function base64_encode(aNumber) {
if (aNumber in intToCharMap) {
return intToCharMap[aNumber];
}
throw new TypeError("Must be between 0 and 63: " + aNumber);
};
exports.decode = function base64_decode(aChar) {
if (aChar in charToIntMap) {
return charToIntMap[aChar];
}
throw new TypeError("Not a valid base 64 digit: " + aChar);
};
});
define = makeDefine(m, './base64-vlq');
if (typeof define !== 'function') {
var define = require('amdefine')(module, require);
}
define(function(require, exports, module) {
var base64 = require('./base64');
var VLQ_BASE_SHIFT = 5;
var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
var VLQ_BASE_MASK = VLQ_BASE - 1;
var VLQ_CONTINUATION_BIT = VLQ_BASE;
function toVLQSigned(aValue) {
return aValue < 0 ? ((-aValue) << 1) + 1 : (aValue << 1) + 0;
}
function fromVLQSigned(aValue) {
var isNegative = (aValue & 1) === 1;
var shifted = aValue >> 1;
return isNegative ? -shifted : shifted;
}
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) {
digit |= VLQ_CONTINUATION_BIT;
}
encoded += base64.encode(digit);
} while (vlq > 0);
return encoded;
};
exports.decode = function base64VLQ_decode(aStr) {
var i = 0;
var strLen = aStr.length;
var result = 0;
var shift = 0;
var continuation,
digit;
do {
if (i >= strLen) {
throw new Error("Expected more digits in base 64 VLQ value.");
}
digit = base64.decode(aStr.charAt(i++));
continuation = !!(digit & VLQ_CONTINUATION_BIT);
digit &= VLQ_BASE_MASK;
result = result + (digit << shift);
shift += VLQ_BASE_SHIFT;
} while (continuation);
return {
value: fromVLQSigned(result),
rest: aStr.slice(i)
};
};
});
define = makeDefine(m, './binary-search');
if (typeof define !== 'function') {
var define = require('amdefine')(module, require);
}
define(function(require, exports, module) {
function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare) {
var mid = Math.floor((aHigh - aLow) / 2) + aLow;
var cmp = aCompare(aNeedle, aHaystack[mid], true);
if (cmp === 0) {
return aHaystack[mid];
} else if (cmp > 0) {
if (aHigh - mid > 1) {
return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare);
}
return aHaystack[mid];
} else {
if (mid - aLow > 1) {
return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare);
}
return aLow < 0 ? null : aHaystack[aLow];
}
}
exports.search = function search(aNeedle, aHaystack, aCompare) {
return aHaystack.length > 0 ? recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare) : null;
};
});
define = makeDefine(m, './source-map-generator');
if (typeof define !== 'function') {
var define = require('amdefine')(module, require);
}
define(function(require, exports, module) {
var base64VLQ = require('./base64-vlq');
var util = require('./util');
var ArraySet = require('./array-set').ArraySet;
function SourceMapGenerator(aArgs) {
if (!aArgs) {
aArgs = {};
}
this._file = util.getArg(aArgs, 'file', null);
this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
this._sources = new ArraySet();
this._names = new ArraySet();
this._mappings = [];
this._sourcesContents = null;
}
SourceMapGenerator.prototype._version = 3;
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) {
newMapping.source = mapping.source;
if (sourceRoot) {
newMapping.source = util.relative(sourceRoot, newMapping.source);
}
newMapping.original = {
line: mapping.originalLine,
column: mapping.originalColumn
};
if (mapping.name) {
newMapping.name = mapping.name;
}
}
generator.addMapping(newMapping);
});
aSourceMapConsumer.sources.forEach(function(sourceFile) {
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
if (content) {
generator.setSourceContent(sourceFile, content);
}
});
return generator;
};
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);
this._validateMapping(generated, original, source, name);
if (source && !this._sources.has(source)) {
this._sources.add(source);
}
if (name && !this._names.has(name)) {
this._names.add(name);
}
this._mappings.push({
generatedLine: generated.line,
generatedColumn: generated.column,
originalLine: original != null && original.line,
originalColumn: original != null && original.column,
source: source,
name: name
});
};
SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
var source = aSourceFile;
if (this._sourceRoot) {
source = util.relative(this._sourceRoot, source);
}
if (aSourceContent !== null) {
if (!this._sourcesContents) {
this._sourcesContents = {};
}
this._sourcesContents[util.toSetString(source)] = aSourceContent;
} else {
delete this._sourcesContents[util.toSetString(source)];
if (Object.keys(this._sourcesContents).length === 0) {
this._sourcesContents = null;
}
}
};
SourceMapGenerator.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
if (!aSourceFile) {
if (!aSourceMapConsumer.file) {
throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + 'or the source map\'s "file" property. Both were omitted.');
}
aSourceFile = aSourceMapConsumer.file;
}
var sourceRoot = this._sourceRoot;
if (sourceRoot) {
aSourceFile = util.relative(sourceRoot, aSourceFile);
}
var newSources = new ArraySet();
var newNames = new ArraySet();
this._mappings.forEach(function(mapping) {
if (mapping.source === aSourceFile && mapping.originalLine) {
var original = aSourceMapConsumer.originalPositionFor({
line: mapping.originalLine,
column: mapping.originalColumn
});
if (original.source !== null) {
mapping.source = original.source;
if (aSourceMapPath) {
mapping.source = util.join(aSourceMapPath, mapping.source);
}
if (sourceRoot) {
mapping.source = util.relative(sourceRoot, mapping.source);
}
mapping.originalLine = original.line;
mapping.originalColumn = original.column;
if (original.name !== null && mapping.name !== null) {
mapping.name = original.name;
}
}
}
var source = mapping.source;
if (source && !newSources.has(source)) {
newSources.add(source);
}
var name = mapping.name;
if (name && !newNames.has(name)) {
newNames.add(name);
}
}, this);
this._sources = newSources;
this._names = newNames;
aSourceMapConsumer.sources.forEach(function(sourceFile) {
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
if (content) {
if (aSourceMapPath) {
sourceFile = util.join(aSourceMapPath, sourceFile);
}
if (sourceRoot) {
sourceFile = util.relative(sourceRoot, sourceFile);
}
this.setSourceContent(sourceFile, content);
}
}, this);
};
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) {
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) {
return;
} else {
throw new Error('Invalid mapping: ' + JSON.stringify({
generated: aGenerated,
source: aSource,
original: aOriginal,
name: aName
}));
}
};
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;
this._mappings.sort(util.compareByGeneratedPositions);
for (var i = 0,
len = this._mappings.length; i < len; i++) {
mapping = this._mappings[i];
if (mapping.generatedLine !== previousGeneratedLine) {
previousGeneratedColumn = 0;
while (mapping.generatedLine !== previousGeneratedLine) {
result += ';';
previousGeneratedLine++;
}
} else {
if (i > 0) {
if (!util.compareByGeneratedPositions(mapping, this._mappings[i - 1])) {
continue;
}
result += ',';
}
}
result += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn);
previousGeneratedColumn = mapping.generatedColumn;
if (mapping.source) {
result += base64VLQ.encode(this._sources.indexOf(mapping.source) - previousSource);
previousSource = this._sources.indexOf(mapping.source);
result += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine);
previousOriginalLine = mapping.originalLine - 1;
result += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn);
previousOriginalColumn = mapping.originalColumn;
if (mapping.name) {
result += base64VLQ.encode(this._names.indexOf(mapping.name) - previousName);
previousName = this._names.indexOf(mapping.name);
}
}
}
return result;
};
SourceMapGenerator.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
return aSources.map(function(source) {
if (!this._sourcesContents) {
return null;
}
if (aSourceRoot) {
source = util.relative(aSourceRoot, source);
}
var key = util.toSetString(source);
return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null;
}, this);
};
SourceMapGenerator.prototype.toJSON = function SourceMapGenerator_toJSON() {
var map = {
version: this._version,
file: this._file,
sources: this._sources.toArray(),
names: this._names.toArray(),
mappings: this._serializeMappings()
};
if (this._sourceRoot) {
map.sourceRoot = this._sourceRoot;
}
if (this._sourcesContents) {
map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
}
return map;
};
SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() {
return JSON.stringify(this);
};
exports.SourceMapGenerator = SourceMapGenerator;
});
define = makeDefine(m, './source-map-consumer');
if (typeof define !== 'function') {
var define = require('amdefine')(module, require);
}
define(function(require, exports, module) {
var util = require('./util');
var binarySearch = require('./binary-search');
var ArraySet = require('./array-set').ArraySet;
var base64VLQ = require('./base64-vlq');
function SourceMapConsumer(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');
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);
if (version != this._version) {
throw new Error('Unsupported version: ' + version);
}
this._names = ArraySet.fromArray(names, true);
this._sources = ArraySet.fromArray(sources, true);
this.sourceRoot = sourceRoot;
this.sourcesContent = sourcesContent;
this._mappings = mappings;
this.file = file;
}
SourceMapConsumer.fromSourceMap = function SourceMapConsumer_fromSourceMap(aSourceMap) {
var smc = Object.create(SourceMapConsumer.prototype);
smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
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;
smc.__generatedMappings = aSourceMap._mappings.slice().sort(util.compareByGeneratedPositions);
smc.__originalMappings = aSourceMap._mappings.slice().sort(util.compareByOriginalPositions);
return smc;
};
SourceMapConsumer.prototype._version = 3;
Object.defineProperty(SourceMapConsumer.prototype, 'sources', {get: function() {
return this._sources.toArray().map(function(s) {
return this.sourceRoot ? util.join(this.sourceRoot, s) : s;
}, this);
}});
SourceMapConsumer.prototype.__generatedMappings = null;
Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {get: function() {
if (!this.__generatedMappings) {
this.__generatedMappings = [];
this.__originalMappings = [];
this._parseMappings(this._mappings, this.sourceRoot);
}
return this.__generatedMappings;
}});
SourceMapConsumer.prototype.__originalMappings = null;
Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {get: function() {
if (!this.__originalMappings) {
this.__generatedMappings = [];
this.__originalMappings = [];
this._parseMappings(this._mappings, this.sourceRoot);
}
return this.__originalMappings;
}});
SourceMapConsumer.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 mappingSeparator = /^[,;]/;
var str = aStr;
var mapping;
var temp;
while (str.length > 0) {
if (str.charAt(0) === ';') {
generatedLine++;
str = str.slice(1);
previousGeneratedColumn = 0;
} else if (str.charAt(0) === ',') {
str = str.slice(1);
} else {
mapping = {};
mapping.generatedLine = generatedLine;
temp = base64VLQ.decode(str);
mapping.generatedColumn = previousGeneratedColumn + temp.value;
previousGeneratedColumn = mapping.generatedColumn;
str = temp.rest;
if (str.length > 0 && !mappingSeparator.test(str.charAt(0))) {
temp = base64VLQ.decode(str);
mapping.source = this._sources.at(previousSource + temp.value);
previousSource += temp.value;
str = temp.rest;
if (str.length === 0 || mappingSeparator.test(str.charAt(0))) {
throw new Error('Found a source, but no line and column');
}
temp = base64VLQ.decode(str);
mapping.originalLine = previousOriginalLine + temp.value;
previousOriginalLine = mapping.originalLine;
mapping.originalLine += 1;
str = temp.rest;
if (str.length === 0 || mappingSeparator.test(str.charAt(0))) {
throw new Error('Found a source and line, but no column');
}
temp = base64VLQ.decode(str);
mapping.originalColumn = previousOriginalColumn + temp.value;
previousOriginalColumn = mapping.originalColumn;
str = temp.rest;
if (str.length > 0 && !mappingSeparator.test(str.charAt(0))) {
temp = base64VLQ.decode(str);
mapping.name = this._names.at(previousName + temp.value);
previousName += temp.value;
str = temp.rest;
}
}
this.__generatedMappings.push(mapping);
if (typeof mapping.originalLine === 'number') {
this.__originalMappings.push(mapping);
}
}
}
this.__generatedMappings.sort(util.compareByGeneratedPositions);
this.__originalMappings.sort(util.compareByOriginalPositions);
};
SourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator) {
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);
};
SourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) {
var needle = {
generatedLine: util.getArg(aArgs, 'line'),
generatedColumn: util.getArg(aArgs, 'column')
};
var mapping = this._findMapping(needle, this._generatedMappings, "generatedLine", "generatedColumn", util.compareByGeneratedPositions);
if (mapping && mapping.generatedLine === needle.generatedLine) {
var source = util.getArg(mapping, 'source', null);
if (source && this.sourceRoot) {
source = util.join(this.sourceRoot, source);
}
return {
source: source,
line: util.getArg(mapping, 'originalLine', null),
column: util.getArg(mapping, 'originalColumn', null),
name: util.getArg(mapping, 'name', null)
};
}
return {
source: null,
line: null,
column: null,
name: null
};
};
SourceMapConsumer.prototype.sourceContentFor = function SourceMapConsumer_sourceContentFor(aSource) {
if (!this.sourcesContent) {
return null;
}
if (this.sourceRoot) {
aSource = util.relative(this.sourceRoot, aSource);
}
if (this._sources.has(aSource)) {
return this.sourcesContent[this._sources.indexOf(aSource)];
}
var url;
if (this.sourceRoot && (url = util.urlParse(this.sourceRoot))) {
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)];
}
}
throw new Error('"' + aSource + '" is not in the SourceMap.');
};
SourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) {
var needle = {
source: util.getArg(aArgs, 'source'),
originalLine: util.getArg(aArgs, 'line'),
originalColumn: util.getArg(aArgs, 'column')
};
if (this.sourceRoot) {
needle.source = util.relative(this.sourceRoot, needle.source);
}
var mapping = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions);
if (mapping) {
return {
line: util.getArg(mapping, 'generatedLine', null),
column: util.getArg(mapping, 'generatedColumn', null)
};
}
return {
line: null,
column: null
};
};
SourceMapConsumer.GENERATED_ORDER = 1;
SourceMapConsumer.ORIGINAL_ORDER = 2;
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;
if (source && sourceRoot) {
source = util.join(sourceRoot, source);
}
return {
source: source,
generatedLine: mapping.generatedLine,
generatedColumn: mapping.generatedColumn,
originalLine: mapping.originalLine,
originalColumn: mapping.originalColumn,
name: mapping.name
};
}).forEach(aCallback, context);
};
exports.SourceMapConsumer = SourceMapConsumer;
});
define = makeDefine(m, './source-node');
if (typeof define !== 'function') {
var define = require('amdefine')(module, require);
}
define(function(require, exports, module) {
var SourceMapGenerator = require('./source-map-generator').SourceMapGenerator;
var util = require('./util');
var REGEX_NEWLINE = /(\r?\n)/g;
var REGEX_CHARACTER = /\r\n|[\s\S]/g;
function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
this.children = [];
this.sourceContents = {};
this.line = aLine === undefined ? null : aLine;
this.column = aColumn === undefined ? null : aColumn;
this.source = aSource === undefined ? null : aSource;
this.name = aName === undefined ? null : aName;
if (aChunks != null)
this.add(aChunks);
}
SourceNode.fromStringWithSourceMap = function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer) {
var node = new SourceNode();
var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
var shiftNextLine = function() {
var lineContents = remainingLines.shift();
var newLine = remainingLines.shift() || "";
return lineContents + newLine;
};
var lastGeneratedLine = 1,
lastGeneratedColumn = 0;
var lastMapping = null;
aSourceMapConsumer.eachMapping(function(mapping) {
if (lastMapping !== null) {
if (lastGeneratedLine < mapping.generatedLine) {
var code = "";
addMappingWithCode(lastMapping, shiftNextLine());
lastGeneratedLine++;
lastGeneratedColumn = 0;
} else {
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);
lastMapping = mapping;
return;
}
}
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);
if (remainingLines.length > 0) {
if (lastMapping) {
addMappingWithCode(lastMapping, shiftNextLine());
}
node.add(remainingLines.join(""));
}
aSourceMapConsumer.sources.forEach(function(sourceFile) {
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
if (content) {
node.setSourceContent(sourceFile, content);
}
});
return node;
function addMappingWithCode(mapping, code) {
if (mapping === null || mapping.source === undefined) {
node.add(code);
} else {
node.add(new SourceNode(mapping.originalLine, mapping.originalColumn, mapping.source, code, mapping.name));
}
}
};
SourceNode.prototype.add = function SourceNode_add(aChunk) {
if (Array.isArray(aChunk)) {
aChunk.forEach(function(chunk) {
this.add(chunk);
}, this);
} else if (aChunk instanceof SourceNode || 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;
};
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 instanceof SourceNode || 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;
};
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 instanceof SourceNode) {
chunk.walk(aFn);
} else {
if (chunk !== '') {
aFn(chunk, {
source: this.source,
line: this.line,
column: this.column,
name: this.name
});
}
}
}
};
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;
};
SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
var lastChild = this.children[this.children.length - 1];
if (lastChild instanceof SourceNode) {
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;
};
SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
};
SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) {
for (var i = 0,
len = this.children.length; i < len; i++) {
if (this.children[i] instanceof SourceNode) {
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]]);
}
};
SourceNode.prototype.toString = function SourceNode_toString() {
var str = "";
this.walk(function(chunk) {
str += chunk;
});
return str;
};
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;
}
chunk.match(REGEX_CHARACTER).forEach(function(ch, idx, array) {
if (REGEX_NEWLINE.test(ch)) {
generated.line++;
generated.column = 0;
if (idx + 1 === array.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 += ch.length;
}
});
});
this.walkSourceContents(function(sourceFile, sourceContent) {
map.setSourceContent(sourceFile, sourceContent);
});
return {
code: generated.code,
map: map
};
};
exports.SourceNode = SourceNode;
});
var SourceMapGenerator = m['./source-map-generator'].SourceMapGenerator;
var SourceMapConsumer = m['./source-map-consumer'].SourceMapConsumer;
var SourceNode = m['./source-node'].SourceNode;
var join = m['./util'].join;
return {
get SourceMapGenerator() {
return SourceMapGenerator;
},
get SourceMapConsumer() {
return SourceMapConsumer;
},
get SourceNode() {
return SourceNode;
},
get join() {
return join;
}
};
});
System.register("traceur@0.0.74/src/outputgeneration/toSource", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/outputgeneration/toSource";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/outputgeneration/toSource", path);
}
var ParseTreeMapWriter = System.get("traceur@0.0.74/src/outputgeneration/ParseTreeMapWriter").ParseTreeMapWriter;
var ParseTreeWriter = System.get("traceur@0.0.74/src/outputgeneration/ParseTreeWriter").ParseTreeWriter;
var SourceMapGenerator = System.get("traceur@0.0.74/src/outputgeneration/SourceMapIntegration").SourceMapGenerator;
function toSource(tree) {
var options = arguments[1];
var outputName = arguments[2] !== (void 0) ? arguments[2] : '';
var sourceRoot = arguments[3];
var sourceMapGenerator = options && options.sourceMapGenerator;
var sourcemaps = options && options.sourceMaps;
if (!sourceMapGenerator && sourcemaps) {
sourceMapGenerator = new SourceMapGenerator({
file: outputName,
sourceRoot: sourceRoot
});
}
var writer;
if (sourceMapGenerator)
writer = new ParseTreeMapWriter(sourceMapGenerator, sourceRoot, options);
else
writer = new ParseTreeWriter(options);
writer.visitAny(tree);
return [writer.toString(), sourceMapGenerator && sourceMapGenerator.toString()];
}
return {get toSource() {
return toSource;
}};
});
System.register("traceur@0.0.74/src/outputgeneration/TreeWriter", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/outputgeneration/TreeWriter";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/outputgeneration/TreeWriter", path);
}
var toSource = System.get("traceur@0.0.74/src/outputgeneration/toSource").toSource;
function write(tree) {
var options = arguments[1];
var outputName = arguments[2] !== (void 0) ? arguments[2] : '';
var sourceRoot = arguments[3];
var $__1 = toSource(tree, options, outputName, sourceRoot),
result = $__1[0],
sourceMap = $__1[1];
if (sourceMap)
options.generatedSourceMap = sourceMap;
return result;
}
var TreeWriter = function TreeWriter() {};
($traceurRuntime.createClass)(TreeWriter, {}, {});
TreeWriter.write = write;
return {
get write() {
return write;
},
get TreeWriter() {
return TreeWriter;
}
};
});
System.register("traceur@0.0.74/src/syntax/ParseTreeValidator", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/syntax/ParseTreeValidator";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/syntax/ParseTreeValidator", path);
}
var NewExpression = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees").NewExpression;
var ParseTreeVisitor = System.get("traceur@0.0.74/src/syntax/ParseTreeVisitor").ParseTreeVisitor;
var TreeWriter = System.get("traceur@0.0.74/src/outputgeneration/TreeWriter").TreeWriter;
var $__3 = System.get("traceur@0.0.74/src/syntax/TokenType"),
AMPERSAND = $__3.AMPERSAND,
AMPERSAND_EQUAL = $__3.AMPERSAND_EQUAL,
AND = $__3.AND,
BAR = $__3.BAR,
BAR_EQUAL = $__3.BAR_EQUAL,
CARET = $__3.CARET,
CARET_EQUAL = $__3.CARET_EQUAL,
CLOSE_ANGLE = $__3.CLOSE_ANGLE,
EQUAL = $__3.EQUAL,
EQUAL_EQUAL = $__3.EQUAL_EQUAL,
EQUAL_EQUAL_EQUAL = $__3.EQUAL_EQUAL_EQUAL,
GREATER_EQUAL = $__3.GREATER_EQUAL,
IDENTIFIER = $__3.IDENTIFIER,
IN = $__3.IN,
INSTANCEOF = $__3.INSTANCEOF,
LEFT_SHIFT = $__3.LEFT_SHIFT,
LEFT_SHIFT_EQUAL = $__3.LEFT_SHIFT_EQUAL,
LESS_EQUAL = $__3.LESS_EQUAL,
MINUS = $__3.MINUS,
MINUS_EQUAL = $__3.MINUS_EQUAL,
NOT_EQUAL = $__3.NOT_EQUAL,
NOT_EQUAL_EQUAL = $__3.NOT_EQUAL_EQUAL,
NUMBER = $__3.NUMBER,
OPEN_ANGLE = $__3.OPEN_ANGLE,
OR = $__3.OR,
PERCENT = $__3.PERCENT,
PERCENT_EQUAL = $__3.PERCENT_EQUAL,
PLUS = $__3.PLUS,
PLUS_EQUAL = $__3.PLUS_EQUAL,
RIGHT_SHIFT = $__3.RIGHT_SHIFT,
RIGHT_SHIFT_EQUAL = $__3.RIGHT_SHIFT_EQUAL,
SLASH = $__3.SLASH,
SLASH_EQUAL = $__3.SLASH_EQUAL,
STAR = $__3.STAR,
STAR_EQUAL = $__3.STAR_EQUAL,
STAR_STAR = $__3.STAR_STAR,
STAR_STAR_EQUAL = $__3.STAR_STAR_EQUAL,
STRING = $__3.STRING,
UNSIGNED_RIGHT_SHIFT = $__3.UNSIGNED_RIGHT_SHIFT,
UNSIGNED_RIGHT_SHIFT_EQUAL = $__3.UNSIGNED_RIGHT_SHIFT_EQUAL;
var $__4 = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType"),
ARRAY_PATTERN = $__4.ARRAY_PATTERN,
ASSIGNMENT_ELEMENT = $__4.ASSIGNMENT_ELEMENT,
BINDING_ELEMENT = $__4.BINDING_ELEMENT,
BINDING_IDENTIFIER = $__4.BINDING_IDENTIFIER,
BLOCK = $__4.BLOCK,
CASE_CLAUSE = $__4.CASE_CLAUSE,
CATCH = $__4.CATCH,
CLASS_DECLARATION = $__4.CLASS_DECLARATION,
COMPUTED_PROPERTY_NAME = $__4.COMPUTED_PROPERTY_NAME,
DEFAULT_CLAUSE = $__4.DEFAULT_CLAUSE,
EXPORT_DEFAULT = $__4.EXPORT_DEFAULT,
EXPORT_SPECIFIER = $__4.EXPORT_SPECIFIER,
EXPORT_SPECIFIER_SET = $__4.EXPORT_SPECIFIER_SET,
EXPORT_STAR = $__4.EXPORT_STAR,
FINALLY = $__4.FINALLY,
FORMAL_PARAMETER = $__4.FORMAL_PARAMETER,
FORMAL_PARAMETER_LIST = $__4.FORMAL_PARAMETER_LIST,
FUNCTION_BODY = $__4.FUNCTION_BODY,
FUNCTION_DECLARATION = $__4.FUNCTION_DECLARATION,
GET_ACCESSOR = $__4.GET_ACCESSOR,
IDENTIFIER_EXPRESSION = $__4.IDENTIFIER_EXPRESSION,
IMPORTED_BINDING = $__4.IMPORTED_BINDING,
LITERAL_PROPERTY_NAME = $__4.LITERAL_PROPERTY_NAME,
MODULE_DECLARATION = $__4.MODULE_DECLARATION,
MODULE_SPECIFIER = $__4.MODULE_SPECIFIER,
NAMED_EXPORT = $__4.NAMED_EXPORT,
OBJECT_PATTERN = $__4.OBJECT_PATTERN,
OBJECT_PATTERN_FIELD = $__4.OBJECT_PATTERN_FIELD,
PROPERTY_METHOD_ASSIGNMENT = $__4.PROPERTY_METHOD_ASSIGNMENT,
PROPERTY_NAME_ASSIGNMENT = $__4.PROPERTY_NAME_ASSIGNMENT,
PROPERTY_NAME_SHORTHAND = $__4.PROPERTY_NAME_SHORTHAND,
PROPERTY_VARIABLE_DECLARATION = $__4.PROPERTY_VARIABLE_DECLARATION,
REST_PARAMETER = $__4.REST_PARAMETER,
SET_ACCESSOR = $__4.SET_ACCESSOR,
TEMPLATE_LITERAL_PORTION = $__4.TEMPLATE_LITERAL_PORTION,
TEMPLATE_SUBSTITUTION = $__4.TEMPLATE_SUBSTITUTION,
TYPE_ARGUMENTS = $__4.TYPE_ARGUMENTS,
TYPE_NAME = $__4.TYPE_NAME,
VARIABLE_DECLARATION_LIST = $__4.VARIABLE_DECLARATION_LIST,
VARIABLE_STATEMENT = $__4.VARIABLE_STATEMENT;
var assert = System.get("traceur@0.0.74/src/util/assert").assert;
var ValidationError = function ValidationError(tree, message) {
this.tree = tree;
this.message = message;
};
($traceurRuntime.createClass)(ValidationError, {}, {}, Error);
var ParseTreeValidator = function ParseTreeValidator() {
$traceurRuntime.superConstructor($ParseTreeValidator).apply(this, arguments);
};
var $ParseTreeValidator = ParseTreeValidator;
($traceurRuntime.createClass)(ParseTreeValidator, {
fail_: function(tree, message) {
throw new ValidationError(tree, message);
},
check_: function(condition, tree, message) {
if (!condition) {
this.fail_(tree, message);
}
},
checkVisit_: function(condition, tree, message) {
this.check_(condition, tree, message);
this.visitAny(tree);
},
checkType_: function(type, tree, message) {
this.checkVisit_(tree.type === type, tree, message);
},
visitArgumentList: function(tree) {
for (var i = 0; i < tree.args.length; i++) {
var argument = tree.args[i];
this.checkVisit_(argument.isAssignmentOrSpread(), argument, 'assignment or spread expected');
}
},
visitArrayLiteralExpression: function(tree) {
for (var i = 0; i < tree.elements.length; i++) {
var element = tree.elements[i];
this.checkVisit_(element === null || element.isAssignmentOrSpread(), element, 'assignment or spread expected');
}
},
visitArrayPattern: function(tree) {
for (var i = 0; i < tree.elements.length; i++) {
var element = tree.elements[i];
this.checkVisit_(element === null || element.type === BINDING_ELEMENT || element.type == ASSIGNMENT_ELEMENT || element.isLeftHandSideExpression() || element.isPattern() || element.isSpreadPatternElement(), element, 'null, sub pattern, left hand side expression or spread expected');
if (element && element.isSpreadPatternElement()) {
this.check_(i === (tree.elements.length - 1), element, 'spread in array patterns must be the last element');
}
}
},
visitBinaryExpression: function(tree) {
switch (tree.operator.type) {
case EQUAL:
case STAR_EQUAL:
case STAR_STAR_EQUAL:
case SLASH_EQUAL:
case PERCENT_EQUAL:
case PLUS_EQUAL:
case MINUS_EQUAL:
case LEFT_SHIFT_EQUAL:
case RIGHT_SHIFT_EQUAL:
case UNSIGNED_RIGHT_SHIFT_EQUAL:
case AMPERSAND_EQUAL:
case CARET_EQUAL:
case BAR_EQUAL:
this.check_(tree.left.isLeftHandSideExpression() || tree.left.isPattern(), tree.left, 'left hand side expression or pattern expected');
this.check_(tree.right.isAssignmentExpression(), tree.right, 'assignment expression expected');
break;
case AND:
case OR:
case BAR:
case CARET:
case AMPERSAND:
case EQUAL_EQUAL:
case NOT_EQUAL:
case EQUAL_EQUAL_EQUAL:
case NOT_EQUAL_EQUAL:
case OPEN_ANGLE:
case CLOSE_ANGLE:
case GREATER_EQUAL:
case LESS_EQUAL:
case INSTANCEOF:
case IN:
case LEFT_SHIFT:
case RIGHT_SHIFT:
case UNSIGNED_RIGHT_SHIFT:
case PLUS:
case MINUS:
case STAR:
case SLASH:
case PERCENT:
case STAR_STAR:
this.check_(tree.left.isAssignmentExpression(), tree.left, 'assignment expression expected');
this.check_(tree.right.isAssignmentExpression(), tree.right, 'assignment expression expected');
break;
default:
this.fail_(tree, 'unexpected binary operator');
}
this.visitAny(tree.left);
this.visitAny(tree.right);
},
visitBindingElement: function(tree) {
var binding = tree.binding;
this.checkVisit_(binding.type == BINDING_IDENTIFIER || binding.type == OBJECT_PATTERN || binding.type == ARRAY_PATTERN, binding, 'expected valid binding element');
this.visitAny(tree.initializer);
},
visitAssignmentElement: function(tree) {
var assignment = tree.assignment;
this.checkVisit_(assignment.type == OBJECT_PATTERN || assignment.type == ARRAY_PATTERN || assignment.isLeftHandSideExpression(), assignment, 'expected valid assignment element');
this.visitAny(tree.initializer);
},
visitBlock: function(tree) {
for (var i = 0; i < tree.statements.length; i++) {
var statement = tree.statements[i];
this.checkVisit_(statement.isStatementListItem(), statement, 'statement or function declaration expected');
}
},
visitCallExpression: function(tree) {
this.check_(tree.operand.isMemberExpression(), tree.operand, 'member expression expected');
if (tree.operand instanceof NewExpression) {
this.check_(tree.operand.args !== null, tree.operand, 'new args expected');
}
this.visitAny(tree.operand);
this.visitAny(tree.args);
},
visitCaseClause: function(tree) {
this.checkVisit_(tree.expression.isExpression(), tree.expression, 'expression expected');
for (var i = 0; i < tree.statements.length; i++) {
var statement = tree.statements[i];
this.checkVisit_(statement.isStatement(), statement, 'statement expected');
}
},
visitCatch: function(tree) {
this.checkVisit_(tree.binding.isPattern() || tree.binding.type == BINDING_IDENTIFIER, tree.binding, 'binding identifier expected');
this.checkVisit_(tree.catchBody.type === BLOCK, tree.catchBody, 'block expected');
},
visitClassDeclaration: function(tree) {
for (var i = 0; i < tree.elements.length; i++) {
var element = tree.elements[i];
switch (element.type) {
case GET_ACCESSOR:
case SET_ACCESSOR:
case PROPERTY_METHOD_ASSIGNMENT:
case PROPERTY_VARIABLE_DECLARATION:
break;
default:
this.fail_(element, 'class element expected');
}
this.visitAny(element);
}
},
visitCommaExpression: function(tree) {
for (var i = 0; i < tree.expressions.length; i++) {
var expression = tree.expressions[i];
this.checkVisit_(expression.isAssignmentExpression(), expression, 'expression expected');
}
},
visitConditionalExpression: function(tree) {
this.checkVisit_(tree.condition.isAssignmentExpression(), tree.condition, 'expression expected');
this.checkVisit_(tree.left.isAssignmentExpression(), tree.left, 'expression expected');
this.checkVisit_(tree.right.isAssignmentExpression(), tree.right, 'expression expected');
},
visitCoverFormals: function(tree) {
this.fail_(tree, 'CoverFormals should have been removed');
},
visitCoverInitializedName: function(tree) {
this.fail_(tree, 'CoverInitializedName should have been removed');
},
visitDefaultClause: function(tree) {
for (var i = 0; i < tree.statements.length; i++) {
var statement = tree.statements[i];
this.checkVisit_(statement.isStatement(), statement, 'statement expected');
}
},
visitDoWhileStatement: function(tree) {
this.checkVisit_(tree.body.isStatement(), tree.body, 'statement expected');
this.checkVisit_(tree.condition.isExpression(), tree.condition, 'expression expected');
},
visitExportDeclaration: function(tree) {
var declType = tree.declaration.type;
this.checkVisit_(declType == VARIABLE_STATEMENT || declType == FUNCTION_DECLARATION || declType == MODULE_DECLARATION || declType == CLASS_DECLARATION || declType == NAMED_EXPORT || declType == EXPORT_DEFAULT, tree.declaration, 'expected valid export tree');
},
visitNamedExport: function(tree) {
if (tree.moduleSpecifier) {
this.checkVisit_(tree.moduleSpecifier.type == MODULE_SPECIFIER, tree.moduleSpecifier, 'module expression expected');
}
var specifierType = tree.specifierSet.type;
this.checkVisit_(specifierType == EXPORT_SPECIFIER_SET || specifierType == EXPORT_STAR, tree.specifierSet, 'specifier set or identifier expected');
},
visitExportSpecifierSet: function(tree) {
this.check_(tree.specifiers.length > 0, tree, 'expected at least one identifier');
for (var i = 0; i < tree.specifiers.length; i++) {
var specifier = tree.specifiers[i];
this.checkVisit_(specifier.type == EXPORT_SPECIFIER || specifier.type == IDENTIFIER_EXPRESSION, specifier, 'expected valid export specifier');
}
},
visitExpressionStatement: function(tree) {
this.checkVisit_(tree.expression.isExpression(), tree.expression, 'expression expected');
},
visitFinally: function(tree) {
this.checkVisit_(tree.block.type === BLOCK, tree.block, 'block expected');
},
visitForOfStatement: function(tree) {
this.checkVisit_(tree.initializer.isPattern() || tree.initializer.type === IDENTIFIER_EXPRESSION || tree.initializer.type === VARIABLE_DECLARATION_LIST && tree.initializer.declarations.length === 1, tree.initializer, 'for-each statement may not have more than one variable declaration');
this.checkVisit_(tree.collection.isExpression(), tree.collection, 'expression expected');
this.checkVisit_(tree.body.isStatement(), tree.body, 'statement expected');
},
visitForInStatement: function(tree) {
if (tree.initializer.type === VARIABLE_DECLARATION_LIST) {
this.checkVisit_(tree.initializer.declarations.length <= 1, tree.initializer, 'for-in statement may not have more than one variable declaration');
} else {
this.checkVisit_(tree.initializer.isPattern() || tree.initializer.isExpression(), tree.initializer, 'variable declaration, expression or ' + 'pattern expected');
}
this.checkVisit_(tree.collection.isExpression(), tree.collection, 'expression expected');
this.checkVisit_(tree.body.isStatement(), tree.body, 'statement expected');
},
visitFormalParameterList: function(tree) {
for (var i = 0; i < tree.parameters.length; i++) {
var parameter = tree.parameters[i];
assert(parameter.type === FORMAL_PARAMETER);
parameter = parameter.parameter;
switch (parameter.type) {
case BINDING_ELEMENT:
break;
case REST_PARAMETER:
this.checkVisit_(i === tree.parameters.length - 1, parameter, 'rest parameters must be the last parameter in a parameter list');
this.checkType_(BINDING_IDENTIFIER, parameter.identifier, 'binding identifier expected');
break;
default:
this.fail_(parameter, 'parameters must be identifiers or rest' + (" parameters. Found: " + parameter.type));
break;
}
this.visitAny(parameter);
}
},
visitForStatement: function(tree) {
if (tree.initializer !== null) {
this.checkVisit_(tree.initializer.isExpression() || tree.initializer.type === VARIABLE_DECLARATION_LIST, tree.initializer, 'variable declaration list or expression expected');
}
if (tree.condition !== null) {
this.checkVisit_(tree.condition.isExpression(), tree.condition, 'expression expected');
}
if (tree.increment !== null) {
this.checkVisit_(tree.increment.isExpression(), tree.increment, 'expression expected');
}
this.checkVisit_(tree.body.isStatement(), tree.body, 'statement expected');
},
visitFunctionBody: function(tree) {
for (var i = 0; i < tree.statements.length; i++) {
var statement = tree.statements[i];
this.checkVisit_(statement.isStatementListItem(), statement, 'statement expected');
}
},
visitFunctionDeclaration: function(tree) {
this.checkType_(BINDING_IDENTIFIER, tree.name, 'binding identifier expected');
this.visitFunction_(tree);
},
visitFunctionExpression: function(tree) {
if (tree.name !== null) {
this.checkType_(BINDING_IDENTIFIER, tree.name, 'binding identifier expected');
}
this.visitFunction_(tree);
},
visitFunction_: function(tree) {
this.checkType_(FORMAL_PARAMETER_LIST, tree.parameterList, 'formal parameters expected');
this.checkType_(FUNCTION_BODY, tree.body, 'function body expected');
},
visitGetAccessor: function(tree) {
this.checkPropertyName_(tree.name);
this.checkType_(FUNCTION_BODY, tree.body, 'function body expected');
},
visitIfStatement: function(tree) {
this.checkVisit_(tree.condition.isExpression(), tree.condition, 'expression expected');
this.checkVisit_(tree.ifClause.isStatement(), tree.ifClause, 'statement expected');
if (tree.elseClause !== null) {
this.checkVisit_(tree.elseClause.isStatement(), tree.elseClause, 'statement expected');
}
},
visitImportSpecifier: function(tree) {
this.checkType_(IMPORTED_BINDING, tree.binding, 'ImportedBinding expected');
},
visitImportedBinding: function(tree) {
this.checkType_(BINDING_IDENTIFIER, tree.binding, 'binding identifier expected');
},
visitLabelledStatement: function(tree) {
this.checkVisit_(tree.statement.isStatement(), tree.statement, 'statement expected');
},
visitMemberExpression: function(tree) {
this.check_(tree.operand.isMemberExpression(), tree.operand, 'member expression expected');
if (tree.operand instanceof NewExpression) {
this.check_(tree.operand.args !== null, tree.operand, 'new args expected');
}
this.visitAny(tree.operand);
},
visitMemberLookupExpression: function(tree) {
this.check_(tree.operand.isMemberExpression(), tree.operand, 'member expression expected');
if (tree.operand instanceof NewExpression) {
this.check_(tree.operand.args !== null, tree.operand, 'new args expected');
}
this.visitAny(tree.operand);
},
visitSyntaxErrorTree: function(tree) {
this.fail_(tree, ("parse tree contains SyntaxError: " + tree.message));
},
visitModuleSpecifier: function(tree) {
this.check_(tree.token.type == STRING || tree.moduleName, 'string or identifier expected');
},
visitModuleDeclaration: function(tree) {
this.checkType_(IMPORTED_BINDING, tree.binding, 'ImportedBinding expected');
this.checkType_(MODULE_SPECIFIER, tree.expression, 'module expression expected');
},
visitNewExpression: function(tree) {
this.checkVisit_(tree.operand.isMemberExpression(), tree.operand, 'member expression expected');
this.visitAny(tree.args);
},
visitObjectLiteralExpression: function(tree) {
for (var i = 0; i < tree.propertyNameAndValues.length; i++) {
var propertyNameAndValue = tree.propertyNameAndValues[i];
switch (propertyNameAndValue.type) {
case GET_ACCESSOR:
case SET_ACCESSOR:
case PROPERTY_METHOD_ASSIGNMENT:
this.check_(!propertyNameAndValue.isStatic, propertyNameAndValue, 'static is not allowed in object literal expression');
case PROPERTY_NAME_ASSIGNMENT:
case PROPERTY_NAME_SHORTHAND:
break;
default:
this.fail_(propertyNameAndValue, 'accessor, property name ' + 'assignment or property method assigment expected');
}
this.visitAny(propertyNameAndValue);
}
},
visitObjectPattern: function(tree) {
for (var i = 0; i < tree.fields.length; i++) {
var field = tree.fields[i];
this.checkVisit_(field.type === OBJECT_PATTERN_FIELD || field.type === ASSIGNMENT_ELEMENT || field.type === BINDING_ELEMENT, field, 'object pattern field expected');
}
},
visitObjectPatternField: function(tree) {
this.checkPropertyName_(tree.name);
this.checkVisit_(tree.element.type === ASSIGNMENT_ELEMENT || tree.element.type === BINDING_ELEMENT || tree.element.isPattern() || tree.element.isLeftHandSideExpression(), tree.element, 'binding element expected');
},
visitParenExpression: function(tree) {
if (tree.expression.isPattern()) {
this.visitAny(tree.expression);
} else {
this.checkVisit_(tree.expression.isExpression(), tree.expression, 'expression expected');
}
},
visitPostfixExpression: function(tree) {
this.checkVisit_(tree.operand.isAssignmentExpression(), tree.operand, 'assignment expression expected');
},
visitPredefinedType: function(tree) {},
visitScript: function(tree) {
for (var i = 0; i < tree.scriptItemList.length; i++) {
var scriptItemList = tree.scriptItemList[i];
this.checkVisit_(scriptItemList.isScriptElement(), scriptItemList, 'global script item expected');
}
},
checkPropertyName_: function(tree) {
this.checkVisit_(tree.type === LITERAL_PROPERTY_NAME || tree.type === COMPUTED_PROPERTY_NAME, tree, 'property name expected');
},
visitPropertyNameAssignment: function(tree) {
this.checkPropertyName_(tree.name);
this.checkVisit_(tree.value.isAssignmentExpression(), tree.value, 'assignment expression expected');
},
visitPropertyNameShorthand: function(tree) {
this.check_(tree.name.type === IDENTIFIER, tree, 'identifier token expected');
},
visitLiteralPropertyName: function(tree) {
var type = tree.literalToken.type;
this.check_(tree.literalToken.isKeyword() || type === IDENTIFIER || type === NUMBER || type === STRING, tree, 'Unexpected token in literal property name');
},
visitTemplateLiteralExpression: function(tree) {
if (tree.operand) {
this.checkVisit_(tree.operand.isMemberExpression(), tree.operand, 'member or call expression expected');
}
for (var i = 0; i < tree.elements.length; i++) {
var element = tree.elements[i];
if (i % 2) {
this.checkType_(TEMPLATE_SUBSTITUTION, element, 'Template literal substitution expected');
} else {
this.checkType_(TEMPLATE_LITERAL_PORTION, element, 'Template literal portion expected');
}
}
},
visitReturnStatement: function(tree) {
if (tree.expression !== null) {
this.checkVisit_(tree.expression.isExpression(), tree.expression, 'expression expected');
}
},
visitSetAccessor: function(tree) {
this.checkPropertyName_(tree.name);
this.checkType_(FUNCTION_BODY, tree.body, 'function body expected');
},
visitSpreadExpression: function(tree) {
this.checkVisit_(tree.expression.isAssignmentExpression(), tree.expression, 'assignment expression expected');
},
visitStateMachine: function(tree) {
this.fail_(tree, 'State machines are never valid outside of the ' + 'GeneratorTransformer pass.');
},
visitSwitchStatement: function(tree) {
this.checkVisit_(tree.expression.isExpression(), tree.expression, 'expression expected');
var defaultCount = 0;
for (var i = 0; i < tree.caseClauses.length; i++) {
var caseClause = tree.caseClauses[i];
if (caseClause.type === DEFAULT_CLAUSE) {
++defaultCount;
this.checkVisit_(defaultCount <= 1, caseClause, 'no more than one default clause allowed');
} else {
this.checkType_(CASE_CLAUSE, caseClause, 'case or default clause expected');
}
}
},
visitThrowStatement: function(tree) {
if (tree.value === null) {
return;
}
this.checkVisit_(tree.value.isExpression(), tree.value, 'expression expected');
},
visitTryStatement: function(tree) {
this.checkType_(BLOCK, tree.body, 'block expected');
if (tree.catchBlock !== null) {
this.checkType_(CATCH, tree.catchBlock, 'catch block expected');
}
if (tree.finallyBlock !== null) {
this.checkType_(FINALLY, tree.finallyBlock, 'finally block expected');
}
if (tree.catchBlock === null && tree.finallyBlock === null) {
this.fail_(tree, 'either catch or finally must be present');
}
},
visitTypeArguments: function(tree) {
var args = tree.args;
for (var i = 0; i < args.length; i++) {
this.checkVisit_(args[i].isType(), args[i], 'Type arguments must be type expressions');
}
},
visitTypeName: function(tree) {
this.checkVisit_(tree.moduleName === null || tree.moduleName.type === TYPE_NAME, tree.moduleName, 'moduleName must be null or a TypeName');
this.check_(tree.name.type === IDENTIFIER, tree, 'name must be an identifier');
},
visitTypeReference: function(tree) {
this.checkType_(TYPE_NAME, tree.typeName, 'typeName must be a TypeName');
this.checkType_(TYPE_ARGUMENTS, tree.args, 'args must be a TypeArguments');
},
visitUnaryExpression: function(tree) {
this.checkVisit_(tree.operand.isAssignmentExpression(), tree.operand, 'assignment expression expected');
},
visitVariableDeclaration: function(tree) {
this.checkVisit_(tree.lvalue.isPattern() || tree.lvalue.type == BINDING_IDENTIFIER, tree.lvalue, 'binding identifier expected, found: ' + tree.lvalue.type);
if (tree.initializer !== null) {
this.checkVisit_(tree.initializer.isAssignmentExpression(), tree.initializer, 'assignment expression expected');
}
},
visitWhileStatement: function(tree) {
this.checkVisit_(tree.condition.isExpression(), tree.condition, 'expression expected');
this.checkVisit_(tree.body.isStatement(), tree.body, 'statement expected');
},
visitWithStatement: function(tree) {
this.checkVisit_(tree.expression.isExpression(), tree.expression, 'expression expected');
this.checkVisit_(tree.body.isStatement(), tree.body, 'statement expected');
},
visitYieldExpression: function(tree) {
if (tree.expression !== null) {
this.checkVisit_(tree.expression.isExpression(), tree.expression, 'expression expected');
}
}
}, {}, ParseTreeVisitor);
ParseTreeValidator.validate = function(tree) {
var validator = new ParseTreeValidator();
try {
validator.visitAny(tree);
} catch (e) {
if (!(e instanceof ValidationError)) {
throw e;
}
var location = null;
if (e.tree !== null) {
location = e.tree.location;
}
if (location === null) {
location = tree.location;
}
var locationString = location !== null ? location.start.toString() : '(unknown)';
throw new Error(("Parse tree validation failure '" + e.message + "' at " + locationString + ":") + '\n\n' + TreeWriter.write(tree, {
highlighted: e.tree,
showLineNumbers: true
}) + '\n');
}
};
return {get ParseTreeValidator() {
return ParseTreeValidator;
}};
});
System.register("traceur@0.0.74/src/codegeneration/MultiTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/MultiTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/MultiTransformer", path);
}
var ParseTreeValidator = System.get("traceur@0.0.74/src/syntax/ParseTreeValidator").ParseTreeValidator;
var MultiTransformer = function MultiTransformer(reporter, validate) {
this.reporter_ = reporter;
this.validate_ = validate;
this.treeTransformers_ = [];
};
($traceurRuntime.createClass)(MultiTransformer, {
append: function(treeTransformer) {
this.treeTransformers_.push(treeTransformer);
},
transform: function(tree) {
var reporter = this.reporter_;
var validate = this.validate_;
this.treeTransformers_.every((function(transformTree) {
tree = transformTree(tree);
if (reporter.hadError())
return false;
if (validate)
ParseTreeValidator.validate(tree);
return true;
}));
return tree;
}
}, {});
return {get MultiTransformer() {
return MultiTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/NumericLiteralTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/NumericLiteralTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/NumericLiteralTransformer", path);
}
var ParseTreeTransformer = System.get("traceur@0.0.74/src/codegeneration/ParseTreeTransformer").ParseTreeTransformer;
var $__1 = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees"),
LiteralExpression = $__1.LiteralExpression,
LiteralPropertyName = $__1.LiteralPropertyName;
var LiteralToken = System.get("traceur@0.0.74/src/syntax/LiteralToken").LiteralToken;
var NUMBER = System.get("traceur@0.0.74/src/syntax/TokenType").NUMBER;
function needsTransform(token) {
return token.type === NUMBER && /^0[bBoO]/.test(token.value);
}
function transformToken(token) {
return new LiteralToken(NUMBER, String(token.processedValue), token.location);
}
var NumericLiteralTransformer = function NumericLiteralTransformer() {
$traceurRuntime.superConstructor($NumericLiteralTransformer).apply(this, arguments);
};
var $NumericLiteralTransformer = NumericLiteralTransformer;
($traceurRuntime.createClass)(NumericLiteralTransformer, {
transformLiteralExpression: function(tree) {
var token = tree.literalToken;
if (needsTransform(token))
return new LiteralExpression(tree.location, transformToken(token));
return tree;
},
transformLiteralPropertyName: function(tree) {
var token = tree.literalToken;
if (needsTransform(token))
return new LiteralPropertyName(tree.location, transformToken(token));
return tree;
}
}, {}, ParseTreeTransformer);
return {get NumericLiteralTransformer() {
return NumericLiteralTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/ObjectLiteralTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/ObjectLiteralTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/ObjectLiteralTransformer", path);
}
var FindVisitor = System.get("traceur@0.0.74/src/codegeneration/FindVisitor").FindVisitor;
var $__1 = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees"),
FunctionExpression = $__1.FunctionExpression,
IdentifierExpression = $__1.IdentifierExpression,
LiteralExpression = $__1.LiteralExpression;
var TempVarTransformer = System.get("traceur@0.0.74/src/codegeneration/TempVarTransformer").TempVarTransformer;
var IDENTIFIER = System.get("traceur@0.0.74/src/syntax/TokenType").IDENTIFIER;
var $__4 = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType"),
COMPUTED_PROPERTY_NAME = $__4.COMPUTED_PROPERTY_NAME,
LITERAL_PROPERTY_NAME = $__4.LITERAL_PROPERTY_NAME;
var $__5 = System.get("traceur@0.0.74/src/codegeneration/ParseTreeFactory"),
createAssignmentExpression = $__5.createAssignmentExpression,
createCommaExpression = $__5.createCommaExpression,
createDefineProperty = $__5.createDefineProperty,
createEmptyParameterList = $__5.createEmptyParameterList,
createFunctionExpression = $__5.createFunctionExpression,
createIdentifierExpression = $__5.createIdentifierExpression,
createObjectCreate = $__5.createObjectCreate,
createObjectLiteralExpression = $__5.createObjectLiteralExpression,
createParenExpression = $__5.createParenExpression,
createPropertyNameAssignment = $__5.createPropertyNameAssignment,
createStringLiteral = $__5.createStringLiteral;
var propName = System.get("traceur@0.0.74/src/staticsemantics/PropName").propName;
var transformOptions = System.get("traceur@0.0.74/src/Options").transformOptions;
var FindAdvancedProperty = function FindAdvancedProperty(tree) {
this.protoExpression = null;
$traceurRuntime.superConstructor($FindAdvancedProperty).call(this, tree, true);
};
var $FindAdvancedProperty = FindAdvancedProperty;
($traceurRuntime.createClass)(FindAdvancedProperty, {
visitPropertyNameAssignment: function(tree) {
if (isProtoName(tree.name))
this.protoExpression = tree.value;
else
$traceurRuntime.superGet(this, $FindAdvancedProperty.prototype, "visitPropertyNameAssignment").call(this, tree);
},
visitComputedPropertyName: function(tree) {
if (transformOptions.computedPropertyNames)
this.found = true;
}
}, {}, FindVisitor);
function isProtoName(tree) {
return propName(tree) === '__proto__';
}
var ObjectLiteralTransformer = function ObjectLiteralTransformer(identifierGenerator) {
$traceurRuntime.superConstructor($ObjectLiteralTransformer).call(this, identifierGenerator);
this.protoExpression = null;
this.needsAdvancedTransform = false;
this.seenAccessors = null;
};
var $ObjectLiteralTransformer = ObjectLiteralTransformer;
($traceurRuntime.createClass)(ObjectLiteralTransformer, {
findSeenAccessor_: function(name) {
if (name.type === COMPUTED_PROPERTY_NAME)
return null;
var s = propName(name);
return this.seenAccessors[s];
},
removeSeenAccessor_: function(name) {
if (name.type === COMPUTED_PROPERTY_NAME)
return;
var s = propName(name);
delete this.seenAccessors[s];
},
addSeenAccessor_: function(name, descr) {
if (name.type === COMPUTED_PROPERTY_NAME)
return;
var s = propName(name);
this.seenAccessors[s] = descr;
},
createProperty_: function(name, descr) {
var expression;
if (name.type === LITERAL_PROPERTY_NAME) {
if (this.needsAdvancedTransform)
expression = this.getPropertyName_(name);
else
expression = name;
} else {
expression = name.expression;
}
if (descr.get || descr.set) {
var oldAccessor = this.findSeenAccessor_(name);
if (oldAccessor) {
oldAccessor.get = descr.get || oldAccessor.get;
oldAccessor.set = descr.set || oldAccessor.set;
this.removeSeenAccessor_(name);
return null;
} else {
this.addSeenAccessor_(name, descr);
}
}
return [expression, descr];
},
getPropertyName_: function(nameTree) {
var token = nameTree.literalToken;
switch (token.type) {
case IDENTIFIER:
return createStringLiteral(token.value);
default:
if (token.isKeyword())
return createStringLiteral(token.type);
return new LiteralExpression(token.location, token);
}
},
transformClassDeclaration: function(tree) {
return tree;
},
transformClassExpression: function(tree) {
return tree;
},
transformObjectLiteralExpression: function(tree) {
var oldNeedsTransform = this.needsAdvancedTransform;
var oldSeenAccessors = this.seenAccessors;
try {
var finder = new FindAdvancedProperty(tree);
if (!finder.found) {
this.needsAdvancedTransform = false;
return $traceurRuntime.superGet(this, $ObjectLiteralTransformer.prototype, "transformObjectLiteralExpression").call(this, tree);
}
this.needsAdvancedTransform = true;
this.seenAccessors = Object.create(null);
var properties = this.transformList(tree.propertyNameAndValues);
properties = properties.filter((function(tree) {
return tree;
}));
var tempVar = this.addTempVar();
var tempVarIdentifierExpression = createIdentifierExpression(tempVar);
var expressions = properties.map((function(property) {
var expression = property[0];
var descr = property[1];
return createDefineProperty(tempVarIdentifierExpression, expression, descr);
}));
var protoExpression = this.transformAny(finder.protoExpression);
var objectExpression;
if (protoExpression)
objectExpression = createObjectCreate(protoExpression);
else
objectExpression = createObjectLiteralExpression([]);
expressions.unshift(createAssignmentExpression(tempVarIdentifierExpression, objectExpression));
expressions.push(tempVarIdentifierExpression);
return createParenExpression(createCommaExpression(expressions));
} finally {
this.needsAdvancedTransform = oldNeedsTransform;
this.seenAccessors = oldSeenAccessors;
}
},
transformPropertyNameAssignment: function(tree) {
if (!this.needsAdvancedTransform)
return $traceurRuntime.superGet(this, $ObjectLiteralTransformer.prototype, "transformPropertyNameAssignment").call(this, tree);
if (isProtoName(tree.name))
return null;
return this.createProperty_(tree.name, {
value: this.transformAny(tree.value),
configurable: true,
enumerable: true,
writable: true
});
},
transformGetAccessor: function(tree) {
if (!this.needsAdvancedTransform)
return $traceurRuntime.superGet(this, $ObjectLiteralTransformer.prototype, "transformGetAccessor").call(this, tree);
var body = this.transformAny(tree.body);
var func = createFunctionExpression(createEmptyParameterList(), body);
return this.createProperty_(tree.name, {
get: func,
configurable: true,
enumerable: true
});
},
transformSetAccessor: function(tree) {
if (!this.needsAdvancedTransform)
return $traceurRuntime.superGet(this, $ObjectLiteralTransformer.prototype, "transformSetAccessor").call(this, tree);
var body = this.transformAny(tree.body);
var parameterList = this.transformAny(tree.parameterList);
var func = createFunctionExpression(parameterList, body);
return this.createProperty_(tree.name, {
set: func,
configurable: true,
enumerable: true
});
},
transformPropertyMethodAssignment: function(tree) {
var func = new FunctionExpression(tree.location, null, tree.functionKind, this.transformAny(tree.parameterList), tree.typeAnnotation, [], this.transformAny(tree.body));
if (!this.needsAdvancedTransform) {
return createPropertyNameAssignment(tree.name, func);
}
var expression = this.transformAny(tree.name);
return this.createProperty_(tree.name, {
value: func,
configurable: true,
enumerable: true,
writable: true
});
},
transformPropertyNameShorthand: function(tree) {
if (!this.needsAdvancedTransform)
return $traceurRuntime.superGet(this, $ObjectLiteralTransformer.prototype, "transformPropertyNameShorthand").call(this, tree);
var expression = this.transformAny(tree.name);
return this.createProperty_(tree.name, {
value: new IdentifierExpression(tree.location, tree.name.identifierToken),
configurable: true,
enumerable: false,
writable: true
});
}
}, {}, TempVarTransformer);
return {get ObjectLiteralTransformer() {
return ObjectLiteralTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/PropertyNameShorthandTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/PropertyNameShorthandTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/PropertyNameShorthandTransformer", path);
}
var $__0 = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees"),
IdentifierExpression = $__0.IdentifierExpression,
LiteralPropertyName = $__0.LiteralPropertyName,
PropertyNameAssignment = $__0.PropertyNameAssignment;
var ParseTreeTransformer = System.get("traceur@0.0.74/src/codegeneration/ParseTreeTransformer").ParseTreeTransformer;
var PropertyNameShorthandTransformer = function PropertyNameShorthandTransformer() {
$traceurRuntime.superConstructor($PropertyNameShorthandTransformer).apply(this, arguments);
};
var $PropertyNameShorthandTransformer = PropertyNameShorthandTransformer;
($traceurRuntime.createClass)(PropertyNameShorthandTransformer, {transformPropertyNameShorthand: function(tree) {
return new PropertyNameAssignment(tree.location, new LiteralPropertyName(tree.location, tree.name), new IdentifierExpression(tree.location, tree.name));
}}, {}, ParseTreeTransformer);
return {get PropertyNameShorthandTransformer() {
return PropertyNameShorthandTransformer;
}};
});
System.register("traceur@0.0.74/src/outputgeneration/regexpuRewritePattern", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/outputgeneration/regexpuRewritePattern";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/outputgeneration/regexpuRewritePattern", path);
}
var modules = {};
var module = {};
var exports = module.exports = {};
var require = function(id) {
return modules[id];
};
;
(function(root) {
var freeExports = typeof exports == 'object' && exports;
var freeModule = typeof module == 'object' && module && module.exports == freeExports && module;
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.'
};
var HIGH_SURROGATE_MIN = 0xD800;
var HIGH_SURROGATE_MAX = 0xDBFF;
var LOW_SURROGATE_MIN = 0xDC00;
var LOW_SURROGATE_MAX = 0xDFFF;
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]';
};
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 {
result.push(previous + 1, tmp);
previous = tmp;
}
}
}
if (!isStart) {
result.push(tmp + 1);
}
return result;
};
var dataRemove = function(data, codePoint) {
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) {
if (codePoint == start) {
if (end == start + 1) {
data.splice(index, 2);
return data;
} else {
data[index] = codePoint + 1;
return data;
}
} else if (codePoint == end - 1) {
data[index + 1] = codePoint;
return data;
} else {
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);
}
var index = 0;
var start;
var end;
while (index < data.length) {
start = data[index];
end = data[index + 1] - 1;
if (start > rangeEnd) {
return data;
}
if (rangeStart <= start && rangeEnd >= end) {
data.splice(index, 2);
continue;
}
if (rangeStart >= start && rangeEnd < end) {
if (rangeStart == start) {
data[index] = rangeEnd + 1;
data[index + 1] = end + 1;
return data;
}
data.splice(index, 2, start, rangeStart, rangeEnd + 1, end + 1);
return data;
}
if (rangeStart >= start && rangeStart <= end) {
data[index + 1] = rangeStart;
} else if (rangeEnd >= start && rangeEnd <= end) {
data[index] = rangeEnd + 1;
return data;
}
index += 2;
}
return data;
};
var dataAdd = function(data, codePoint) {
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];
if (codePoint >= start && codePoint < end) {
return data;
}
if (codePoint == start - 1) {
data[index] = codePoint;
return data;
}
if (start > codePoint) {
data.splice(lastIndex != null ? lastIndex + 2 : 0, 0, codePoint, codePoint + 1);
return data;
}
if (codePoint == end) {
if (codePoint + 1 == data[index + 2]) {
data.splice(index, 4, start, data[index + 3]);
return data;
}
data[index + 1] = codePoint + 1;
return data;
}
lastIndex = index;
index += 2;
}
data.push(codePoint, codePoint + 1);
return data;
};
var dataAddData = function(dataA, dataB) {
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) {
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);
}
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) {
if (start == rangeEnd + 1) {
data.splice(index - 1, 2);
return data;
}
if (start > rangeEnd) {
return data;
}
if (start >= rangeStart && start <= rangeEnd) {
if (end > rangeStart && end - 1 <= rangeEnd) {
data.splice(index, 2);
index -= 2;
} else {
data.splice(index - 1, 2);
index -= 2;
}
}
} else if (start == rangeEnd + 1) {
data[index] = rangeStart;
return data;
} else if (start > rangeEnd) {
data.splice(index, 0, rangeStart, rangeEnd + 1);
return data;
} else if (rangeStart >= start && rangeStart < end && rangeEnd + 1 <= end) {
return data;
} else if ((rangeStart >= start && rangeStart < end) || end == rangeStart) {
data[index + 1] = rangeEnd + 1;
added = true;
} else if (rangeStart <= start && rangeEnd + 1 >= end) {
data[index] = rangeStart;
data[index + 1] = rangeEnd + 1;
added = true;
}
index += 2;
}
if (!added) {
data.push(rangeStart, rangeEnd + 1);
}
return data;
};
var dataContains = function(data, codePoint) {
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) {
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) {
return data.length == 2 && data[0] + 1 == data[1];
};
var dataToArray = function(data) {
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;
};
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;
if (codePoint == 0x09) {
string = '\\t';
} 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)) {
string = '\\' + stringFromCharCode(codePoint);
} else if (codePoint >= 0x20 && codePoint <= 0x7E) {
string = stringFromCharCode(codePoint);
} else if (codePoint <= 0xFF) {
string = '\\x' + pad(hex(codePoint), 2);
} else {
string = '\\u' + pad(hex(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) {
second = symbol.charCodeAt(1);
return (first - HIGH_SURROGATE_MIN) * 0x400 + second - LOW_SURROGATE_MIN + 0x10000;
}
return first;
};
var createBMPCharacterClasses = function(data) {
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;
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) {
var loneHighSurrogates = [];
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;
if (start <= 0xFFFF && end <= 0xFFFF) {
if (start >= HIGH_SURROGATE_MIN && start <= HIGH_SURROGATE_MAX) {
if (end <= HIGH_SURROGATE_MAX) {
loneHighSurrogates.push(start, end + 1);
} else {
loneHighSurrogates.push(start, HIGH_SURROGATE_MAX + 1);
bmp.push(HIGH_SURROGATE_MAX + 1, end + 1);
}
} else if (end >= HIGH_SURROGATE_MIN && end <= HIGH_SURROGATE_MAX) {
bmp.push(start, HIGH_SURROGATE_MIN);
loneHighSurrogates.push(HIGH_SURROGATE_MIN, end + 1);
} else if (start < HIGH_SURROGATE_MIN && end > HIGH_SURROGATE_MAX) {
bmp.push(start, HIGH_SURROGATE_MIN, HIGH_SURROGATE_MAX + 1, end + 1);
loneHighSurrogates.push(HIGH_SURROGATE_MIN, HIGH_SURROGATE_MAX + 1);
} else {
bmp.push(start, end + 1);
}
} else if (start <= 0xFFFF && end > 0xFFFF) {
if (start >= HIGH_SURROGATE_MIN && start <= HIGH_SURROGATE_MAX) {
loneHighSurrogates.push(start, HIGH_SURROGATE_MAX + 1);
bmp.push(HIGH_SURROGATE_MAX + 1, 0xFFFF + 1);
} else if (start < HIGH_SURROGATE_MIN) {
bmp.push(start, HIGH_SURROGATE_MIN, HIGH_SURROGATE_MAX + 1, 0xFFFF + 1);
loneHighSurrogates.push(HIGH_SURROGATE_MIN, HIGH_SURROGATE_MAX + 1);
} else {
bmp.push(start, 0xFFFF + 1);
}
astral.push(0xFFFF + 1, end + 1);
} else {
astral.push(start, end + 1);
}
index += 2;
}
return {
'loneHighSurrogates': loneHighSurrogates,
'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];
tmpLow = lowSurrogates;
while (nextHighSurrogates && highSurrogates[0] == nextHighSurrogates[0] && highSurrogates[1] == nextHighSurrogates[1]) {
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;
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) {
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);
}
surrogateMappings.splice(innerIndex, 1);
--innerIndex;
}
}
}
return surrogateMappings;
};
var surrogateSet = function(data) {
if (!data.length) {
return [];
}
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;
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]]);
}
if (!complete && startHigh + 1 < endHigh) {
if (endsWithHighestLowSurrogate) {
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]]);
}
}
if (!complete) {
surrogateMappings.push([[endHigh, endHigh + 1], [LOW_SURROGATE_MIN, endLow + 1]]);
}
prevStartHigh = startHigh;
prevEndHigh = endHigh;
index += 2;
}
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) {
var result = [];
var parts = splitAtBMP(data);
var loneHighSurrogates = parts.loneHighSurrogates;
var bmp = parts.bmp;
var astral = parts.astral;
var hasAstral = !dataIsEmpty(parts.astral);
var hasLoneSurrogates = !dataIsEmpty(loneHighSurrogates);
var surrogateMappings = surrogateSet(astral);
if (!hasAstral && hasLoneSurrogates) {
bmp = dataAddData(bmp, loneHighSurrogates);
}
if (!dataIsEmpty(bmp)) {
result.push(createBMPCharacterClasses(bmp));
}
if (surrogateMappings.length) {
result.push(createSurrogateCharacterClasses(surrogateMappings));
}
if (hasAstral && hasLoneSurrogates) {
result.push(createBMPCharacterClasses(loneHighSurrogates));
}
return result.join('|');
};
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.0.1';
var proto = regenerate.prototype;
extend(proto, {
'add': function(value) {
var $this = this;
if (value == null) {
return $this;
}
if (value instanceof regenerate) {
$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) {
$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;
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() {
var result = createCharacterClassesFromData(this.data);
return result.replace(regexNull, '\\0$1');
},
'toRegExp': function(flags) {
return RegExp(this.toString(), flags || '');
},
'valueOf': function() {
return dataToArray(this.data);
}
});
proto.toArray = proto.valueOf;
if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
define(function() {
return regenerate;
});
} else if (freeExports && !freeExports.nodeType) {
if (freeModule) {
freeModule.exports = regenerate;
} else {
freeExports.regenerate = regenerate;
}
} else {
root.regenerate = regenerate;
}
}(this));
modules['regenerate'] = module.exports || window.regenerate;
;
(function() {
'use strict';
var objectTypes = {
'function': true,
'object': true
};
var root = (objectTypes[typeof window] && window) || this;
var oldRoot = root;
var freeExports = objectTypes[typeof exports] && exports;
var freeModule = objectTypes[typeof module] && module && !module.nodeType && module;
var freeGlobal = freeExports && freeModule && typeof global == 'object' && global;
if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal)) {
root = freeGlobal;
}
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) || codePoint < 0 || codePoint > 0x10FFFF || floor(codePoint) != codePoint) {
throw RangeError('Invalid code point: ' + codePoint);
}
if (codePoint <= 0xFFFF) {
codeUnits.push(codePoint);
} else {
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;
if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
define(function() {
return {'generate': generate};
});
} else if (freeExports && freeModule) {
freeExports.generate = generate;
} else {
root.regjsgen = {'generate': generate};
}
}.call(this));
modules['regjsgen'] = {generate: exports.generate || window.regjsgen};
(function() {
function parse(str, flags) {
var hasUnicodeFlag = (flags || "").indexOf("u") !== -1;
var pos = 0;
var closedCaptureCounter = 0;
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) {
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,
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) {
if (min.codePoint > max.codePoint) {
throw SyntaxError('invalid range in character class');
}
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)) {
throw SyntaxError('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() {
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;
while (term = parseTerm()) {
res.push(term);
}
if (res.length === 1) {
return res[0];
}
return createAlternative(res, from, pos);
}
function parseTerm() {
if (pos >= str.length || current('|') || current(')')) {
return null;
}
var anchor = parseAnchor();
if (anchor) {
return anchor;
}
var atom = parseAtom();
if (!atom) {
throw SyntaxError('Expected atom');
}
var quantifier = parseQuantifier() || false;
if (quantifier) {
quantifier.body = flattenBody(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) {
throw SyntaxError('Expected disjunction');
}
skip(')');
var group = createGroup(type, flattenBody(body), from, pos);
if (type == 'normal') {
closedCaptureCounter++;
}
return group;
}
function parseAnchor() {
var res,
from = pos;
if (match('^')) {
return createAnchor('start', 1);
} else if (match('$')) {
return createAnchor('end', 1);
} else if (match('\\b')) {
return createAnchor('boundary', 2);
} else if (match('\\B')) {
return createAnchor('not-boundary', 2);
} else {
return parseGroup('(?=', 'lookahead', '(?!', 'negativeLookahead');
}
}
function parseQuantifier() {
var res;
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) {
throw SyntaxError('numbers out of order in {} quantifier');
}
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() {
var res;
if (res = matchReg(/^[^^$\\.*+?(){[|]/)) {
return createCharacter(res);
} else if (match('.')) {
return createDot();
} else if (match('\\')) {
res = parseAtomEscape();
if (!res) {
throw SyntaxError('atomEscape');
}
return res;
} else if (res = parseCharacterClass()) {
return res;
} else {
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) {
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) {
var res;
res = parseDecimalEscape();
if (res) {
return res;
}
if (insideCharacterClass) {
if (match('b')) {
return createEscaped('singleEscape', 0x0008, '\\b');
} else if (match('B')) {
throw SyntaxError('\\B not possible inside of CharacterClass');
}
}
res = parseCharacterEscape();
return res;
}
function parseDecimalEscape() {
var res,
match;
if (res = matchReg(/^(?!0)\d+/)) {
match = res[0];
var refIdx = parseInt(res[0], 10);
if (refIdx <= closedCaptureCounter) {
return createReference(res[0]);
} else {
incr(-res[0].length);
if (res = matchReg(/^[0-7]{1,3}/)) {
return createEscaped('octal', parseInt(res[0], 8), res[0], 1);
} else {
res = createCharacter(matchReg(/^[89]/));
return updateRawStart(res, res.range[0] - 1);
}
}
} else if (res = matchReg(/^[0-7]{1,3}/)) {
match = res[0];
if (/^0{1,3}$/.test(match)) {
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() {
var res;
if (res = matchReg(/^[fnrtv]/)) {
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])/)) {
return createEscaped('controlLetter', res[1].charCodeAt(0) % 32, res[1], 2);
} else if (res = matchReg(/^x([0-9a-fA-F]{2})/)) {
return createEscaped('hexadecimalEscape', parseInt(res[1], 16), res[1], 2);
} else if (res = matchReg(/^u([0-9a-fA-F]{4})/)) {
return parseUnicodeSurrogatePairEscape(createEscaped('unicodeEscape', parseInt(res[1], 16), res[1], 2));
} else if (hasUnicodeFlag && (res = matchReg(/^u\{([0-9a-fA-F]{1,6})\}/))) {
return createEscaped('unicodeCodePointEscape', parseInt(res[1], 16), res[1], 4);
} else {
return parseIdentityEscape();
}
}
function isIdentifierPart(ch) {
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) || (ch >= 65 && ch <= 90) || (ch >= 97 && ch <= 122) || (ch >= 48 && ch <= 57) || (ch === 92) || ((ch >= 0x80) && NonAsciiIdentifierPart.test(String.fromCharCode(ch)));
}
function parseIdentityEscape() {
var ZWJ = '\u200C';
var ZWNJ = '\u200D';
var res;
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() {
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() {
var res;
if (current(']')) {
return [];
} else {
res = parseNonemptyClassRanges();
if (!res) {
throw SyntaxError('nonEmptyClassRanges');
}
return res;
}
}
function parseHelperClassRanges(atom) {
var from,
to,
res;
if (current('-') && !next(']')) {
skip('-');
res = parseClassAtom();
if (!res) {
throw SyntaxError('classAtom');
}
to = pos;
var classRanges = parseClassRanges();
if (!classRanges) {
throw SyntaxError('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) {
throw SyntaxError('nonEmptyClassRangesNoDash');
}
return [atom].concat(res);
}
function parseNonemptyClassRanges() {
var atom = parseClassAtom();
if (!atom) {
throw SyntaxError('classAtom');
}
if (current(']')) {
return [atom];
}
return parseHelperClassRanges(atom);
}
function parseNonemptyClassRangesNoDash() {
var res = parseClassAtom();
if (!res) {
throw SyntaxError('classAtom');
}
if (current(']')) {
return res;
}
return parseHelperClassRanges(res);
}
function parseClassAtom() {
if (match('-')) {
return createCharacter('-');
} else {
return parseClassAtomNoDash();
}
}
function parseClassAtomNoDash() {
var res;
if (res = matchReg(/^[^\\\]-]/)) {
return createCharacter(res[0]);
} else if (match('\\')) {
res = parseClassEscape();
if (!res) {
throw SyntaxError('classEscape');
}
return parseUnicodeSurrogatePairEscape(res);
}
}
str = String(str);
if (str === '') {
str = '(?:)';
}
var result = parseDisjunction();
if (result.range[1] !== str.length) {
throw SyntaxError('Could not parse entire input - got stuck: ' + str);
}
return result;
}
;
var regjsparser = {parse: parse};
if (typeof module !== 'undefined' && module.exports) {
module.exports = regjsparser;
} else {
window.regjsparser = regjsparser;
}
}());
modules['regjsparser'] = module.exports || window.regjsparser;
modules['./data/iu-mappings.json'] = ({
"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,
"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
});
var regenerate = require('regenerate');
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)
};
modules['./data/character-class-escape-sets.js'] = {
REGULAR: exports.REGULAR,
UNICODE: exports.UNICODE,
UNICODE_IGNORE_CASE: exports.UNICODE_IGNORE_CASE
};
var generate = require('regjsgen').generate;
var parse = require('regjsparser').parse;
var regenerate = require('regenerate');
var iuMappings = require('./data/iu-mappings.json');
var ESCAPE_SETS = require('./data/character-class-escape-sets.js');
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);
}
var UNICODE_SET = regenerate().addRange(0x0, 0x10FFFF);
var BMP_SET = regenerate().addRange(0x0, 0xFFFF);
var DOT_SET_UNICODE = UNICODE_SET.clone().remove(0x000A, 0x000D, 0x2028, 0x2029);
var DOT_SET = DOT_SET_UNICODE.clone().intersection(BMP_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) {
target[key] = source[key];
}
}
function update(item, pattern) {
var tree = parse(pattern, '');
switch (tree.type) {
case 'characterClass':
case 'group':
case 'value':
break;
default:
tree = wrap(tree, pattern);
}
assign(item, tree);
}
function wrap(tree, pattern) {
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;
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':
break;
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);
};
var regexpuRewritePattern = module.exports;
return {get regexpuRewritePattern() {
return regexpuRewritePattern;
}};
});
System.register("traceur@0.0.74/src/codegeneration/RegularExpressionTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/RegularExpressionTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/RegularExpressionTransformer", path);
}
var ParseTreeTransformer = System.get("traceur@0.0.74/src/codegeneration/ParseTreeTransformer").ParseTreeTransformer;
var LiteralExpression = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees").LiteralExpression;
var LiteralToken = System.get("traceur@0.0.74/src/syntax/LiteralToken").LiteralToken;
var REGULAR_EXPRESSION = System.get("traceur@0.0.74/src/syntax/TokenType").REGULAR_EXPRESSION;
var regexpuRewritePattern = System.get("traceur@0.0.74/src/outputgeneration/regexpuRewritePattern").regexpuRewritePattern;
var RegularExpressionTransformer = function RegularExpressionTransformer() {
$traceurRuntime.superConstructor($RegularExpressionTransformer).apply(this, arguments);
};
var $RegularExpressionTransformer = RegularExpressionTransformer;
($traceurRuntime.createClass)(RegularExpressionTransformer, {transformLiteralExpression: function(tree) {
var token = tree.literalToken;
if (token.type === REGULAR_EXPRESSION) {
var value = token.value;
var lastIndex = value.lastIndexOf('/');
var pattern = value.slice(1, lastIndex);
var flags = value.slice(lastIndex + 1);
if (flags.indexOf('u') !== -1) {
var result = '/' + regexpuRewritePattern(pattern, flags) + '/' + flags.replace('u', '');
return new LiteralExpression(tree.location, new LiteralToken(REGULAR_EXPRESSION, result, token.location));
}
}
return tree;
}}, {}, ParseTreeTransformer);
return {get RegularExpressionTransformer() {
return RegularExpressionTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/RestParameterTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/RestParameterTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/RestParameterTransformer", path);
}
var $__0 = Object.freeze(Object.defineProperties(["\n for (var ", " = [], ", " = ", ";\n ", " < arguments.length; ", "++)\n ", "[", " - ", "] = arguments[", "];"], {raw: {value: Object.freeze(["\n for (var ", " = [], ", " = ", ";\n ", " < arguments.length; ", "++)\n ", "[", " - ", "] = arguments[", "];"])}})),
$__1 = Object.freeze(Object.defineProperties(["\n for (var ", " = [], ", " = 0;\n ", " < arguments.length; ", "++)\n ", "[", "] = arguments[", "];"], {raw: {value: Object.freeze(["\n for (var ", " = [], ", " = 0;\n ", " < arguments.length; ", "++)\n ", "[", "] = arguments[", "];"])}}));
var FormalParameterList = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees").FormalParameterList;
var ParameterTransformer = System.get("traceur@0.0.74/src/codegeneration/ParameterTransformer").ParameterTransformer;
var createIdentifierToken = System.get("traceur@0.0.74/src/codegeneration/ParseTreeFactory").createIdentifierToken;
var parseStatement = System.get("traceur@0.0.74/src/codegeneration/PlaceholderParser").parseStatement;
function hasRestParameter(parameterList) {
var parameters = parameterList.parameters;
return parameters.length > 0 && parameters[parameters.length - 1].isRestParameter();
}
function getRestParameterLiteralToken(parameterList) {
var parameters = parameterList.parameters;
return parameters[parameters.length - 1].parameter.identifier.identifierToken;
}
var RestParameterTransformer = function RestParameterTransformer() {
$traceurRuntime.superConstructor($RestParameterTransformer).apply(this, arguments);
};
var $RestParameterTransformer = RestParameterTransformer;
($traceurRuntime.createClass)(RestParameterTransformer, {transformFormalParameterList: function(tree) {
var transformed = $traceurRuntime.superGet(this, $RestParameterTransformer.prototype, "transformFormalParameterList").call(this, tree);
if (hasRestParameter(transformed)) {
var parametersWithoutRestParam = new FormalParameterList(transformed.location, transformed.parameters.slice(0, -1));
var startIndex = transformed.parameters.length - 1;
var i = createIdentifierToken(this.getTempIdentifier());
var name = getRestParameterLiteralToken(transformed);
var loop;
if (startIndex) {
loop = parseStatement($__0, name, i, startIndex, i, i, name, i, startIndex, i);
} else {
loop = parseStatement($__1, name, i, i, i, name, i, i);
}
this.parameterStatements.push(loop);
return parametersWithoutRestParam;
}
return transformed;
}}, {}, ParameterTransformer);
return {get RestParameterTransformer() {
return RestParameterTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/SpreadTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/SpreadTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/SpreadTransformer", path);
}
var $__0 = Object.freeze(Object.defineProperties(["$traceurRuntime.spread(", ")"], {raw: {value: Object.freeze(["$traceurRuntime.spread(", ")"])}}));
var $__1 = System.get("traceur@0.0.74/src/syntax/PredefinedName"),
APPLY = $__1.APPLY,
BIND = $__1.BIND,
FUNCTION = $__1.FUNCTION,
PROTOTYPE = $__1.PROTOTYPE;
var $__2 = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType"),
MEMBER_EXPRESSION = $__2.MEMBER_EXPRESSION,
MEMBER_LOOKUP_EXPRESSION = $__2.MEMBER_LOOKUP_EXPRESSION,
SPREAD_EXPRESSION = $__2.SPREAD_EXPRESSION;
var TempVarTransformer = System.get("traceur@0.0.74/src/codegeneration/TempVarTransformer").TempVarTransformer;
var $__4 = System.get("traceur@0.0.74/src/codegeneration/ParseTreeFactory"),
createArgumentList = $__4.createArgumentList,
createArrayLiteralExpression = $__4.createArrayLiteralExpression,
createAssignmentExpression = $__4.createAssignmentExpression,
createCallExpression = $__4.createCallExpression,
createEmptyArgumentList = $__4.createEmptyArgumentList,
createIdentifierExpression = $__4.createIdentifierExpression,
createMemberExpression = $__4.createMemberExpression,
createMemberLookupExpression = $__4.createMemberLookupExpression,
createNewExpression = $__4.createNewExpression,
createNullLiteral = $__4.createNullLiteral,
createParenExpression = $__4.createParenExpression;
var parseExpression = System.get("traceur@0.0.74/src/codegeneration/PlaceholderParser").parseExpression;
function hasSpreadMember(trees) {
return trees.some((function(tree) {
return tree && tree.type == SPREAD_EXPRESSION;
}));
}
var SpreadTransformer = function SpreadTransformer() {
$traceurRuntime.superConstructor($SpreadTransformer).apply(this, arguments);
};
var $SpreadTransformer = SpreadTransformer;
($traceurRuntime.createClass)(SpreadTransformer, {
createArrayFromElements_: function(elements) {
var length = elements.length;
var args = [];
var lastArray;
for (var i = 0; i < length; i++) {
if (elements[i] && elements[i].type === SPREAD_EXPRESSION) {
if (lastArray) {
args.push(createArrayLiteralExpression(lastArray));
lastArray = null;
}
args.push(this.transformAny(elements[i].expression));
} else {
if (!lastArray)
lastArray = [];
lastArray.push(this.transformAny(elements[i]));
}
}
if (lastArray)
args.push(createArrayLiteralExpression(lastArray));
return parseExpression($__0, createArgumentList(args));
},
desugarCallSpread_: function(tree) {
var operand = this.transformAny(tree.operand);
var functionObject,
contextObject;
this.pushTempScope();
if (operand.type == MEMBER_EXPRESSION) {
var tempIdent = createIdentifierExpression(this.addTempVar());
var parenExpression = createParenExpression(createAssignmentExpression(tempIdent, operand.operand));
var memberName = operand.memberName;
contextObject = tempIdent;
functionObject = createMemberExpression(parenExpression, memberName);
} else if (tree.operand.type == MEMBER_LOOKUP_EXPRESSION) {
var tempIdent = createIdentifierExpression(this.addTempVar());
var parenExpression = createParenExpression(createAssignmentExpression(tempIdent, operand.operand));
var memberExpression = this.transformAny(operand.memberExpression);
contextObject = tempIdent;
functionObject = createMemberLookupExpression(parenExpression, memberExpression);
} else {
contextObject = createNullLiteral();
functionObject = operand;
}
this.popTempScope();
var arrayExpression = this.createArrayFromElements_(tree.args.args);
return createCallExpression(createMemberExpression(functionObject, APPLY), createArgumentList([contextObject, arrayExpression]));
},
desugarNewSpread_: function(tree) {
var arrayExpression = $traceurRuntime.spread([createNullLiteral()], tree.args.args);
arrayExpression = this.createArrayFromElements_(arrayExpression);
return createNewExpression(createParenExpression(createCallExpression(createMemberExpression(FUNCTION, PROTOTYPE, BIND, APPLY), createArgumentList([this.transformAny(tree.operand), arrayExpression]))), createEmptyArgumentList());
},
transformArrayLiteralExpression: function(tree) {
if (hasSpreadMember(tree.elements)) {
return this.createArrayFromElements_(tree.elements);
}
return $traceurRuntime.superGet(this, $SpreadTransformer.prototype, "transformArrayLiteralExpression").call(this, tree);
},
transformCallExpression: function(tree) {
if (hasSpreadMember(tree.args.args)) {
return this.desugarCallSpread_(tree);
}
return $traceurRuntime.superGet(this, $SpreadTransformer.prototype, "transformCallExpression").call(this, tree);
},
transformNewExpression: function(tree) {
if (tree.args != null && hasSpreadMember(tree.args.args)) {
return this.desugarNewSpread_(tree);
}
return $traceurRuntime.superGet(this, $SpreadTransformer.prototype, "transformNewExpression").call(this, tree);
}
}, {}, TempVarTransformer);
return {get SpreadTransformer() {
return SpreadTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/SymbolTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/SymbolTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/SymbolTransformer", path);
}
var $__0 = Object.freeze(Object.defineProperties(["$traceurRuntime.toProperty(", ") in ", ""], {raw: {value: Object.freeze(["$traceurRuntime.toProperty(", ") in ", ""])}})),
$__1 = Object.freeze(Object.defineProperties(["", "[$traceurRuntime.toProperty(", ")]"], {raw: {value: Object.freeze(["", "[$traceurRuntime.toProperty(", ")]"])}})),
$__2 = Object.freeze(Object.defineProperties(["(typeof ", " === 'undefined' ?\n 'undefined' : ", ")"], {raw: {value: Object.freeze(["(typeof ", " === 'undefined' ?\n 'undefined' : ", ")"])}})),
$__3 = Object.freeze(Object.defineProperties(["$traceurRuntime.typeof(", ")"], {raw: {value: Object.freeze(["$traceurRuntime.typeof(", ")"])}})),
$__4 = Object.freeze(Object.defineProperties(["if (!$traceurRuntime.isSymbolString(", ")) ", ""], {raw: {value: Object.freeze(["if (!$traceurRuntime.isSymbolString(", ")) ", ""])}}));
var $__5 = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees"),
BinaryExpression = $__5.BinaryExpression,
MemberLookupExpression = $__5.MemberLookupExpression,
ForInStatement = $__5.ForInStatement,
UnaryExpression = $__5.UnaryExpression;
var ExplodeExpressionTransformer = System.get("traceur@0.0.74/src/codegeneration/ExplodeExpressionTransformer").ExplodeExpressionTransformer;
var $__7 = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType"),
IDENTIFIER_EXPRESSION = $__7.IDENTIFIER_EXPRESSION,
LITERAL_EXPRESSION = $__7.LITERAL_EXPRESSION,
UNARY_EXPRESSION = $__7.UNARY_EXPRESSION,
VARIABLE_DECLARATION_LIST = $__7.VARIABLE_DECLARATION_LIST;
var TempVarTransformer = System.get("traceur@0.0.74/src/codegeneration/TempVarTransformer").TempVarTransformer;
var $__9 = System.get("traceur@0.0.74/src/syntax/TokenType"),
EQUAL_EQUAL = $__9.EQUAL_EQUAL,
EQUAL_EQUAL_EQUAL = $__9.EQUAL_EQUAL_EQUAL,
IN = $__9.IN,
NOT_EQUAL = $__9.NOT_EQUAL,
NOT_EQUAL_EQUAL = $__9.NOT_EQUAL_EQUAL,
STRING = $__9.STRING,
TYPEOF = $__9.TYPEOF;
var $__10 = System.get("traceur@0.0.74/src/codegeneration/PlaceholderParser"),
parseExpression = $__10.parseExpression,
parseStatement = $__10.parseStatement;
var ExplodeSymbolExpression = function ExplodeSymbolExpression() {
$traceurRuntime.superConstructor($ExplodeSymbolExpression).apply(this, arguments);
};
var $ExplodeSymbolExpression = ExplodeSymbolExpression;
($traceurRuntime.createClass)(ExplodeSymbolExpression, {
transformArrowFunctionExpression: function(tree) {
return tree;
},
transformClassExpression: function(tree) {
return tree;
},
transformFunctionBody: function(tree) {
return tree;
}
}, {}, ExplodeExpressionTransformer);
function isEqualityExpression(tree) {
switch (tree.operator.type) {
case EQUAL_EQUAL:
case EQUAL_EQUAL_EQUAL:
case NOT_EQUAL:
case NOT_EQUAL_EQUAL:
return true;
}
return false;
}
function isTypeof(tree) {
return tree.type === UNARY_EXPRESSION && tree.operator.type === TYPEOF;
}
function isSafeTypeofString(tree) {
if (tree.type !== LITERAL_EXPRESSION)
return false;
var value = tree.literalToken.processedValue;
switch (value) {
case 'symbol':
case 'object':
return false;
}
return true;
}
var SymbolTransformer = function SymbolTransformer() {
$traceurRuntime.superConstructor($SymbolTransformer).apply(this, arguments);
};
var $SymbolTransformer = SymbolTransformer;
($traceurRuntime.createClass)(SymbolTransformer, {
transformTypeofOperand_: function(tree) {
var operand = this.transformAny(tree.operand);
return new UnaryExpression(tree.location, tree.operator, operand);
},
transformBinaryExpression: function(tree) {
if (tree.operator.type === IN) {
var name = this.transformAny(tree.left);
var object = this.transformAny(tree.right);
if (name.type === LITERAL_EXPRESSION)
return new BinaryExpression(tree.location, name, tree.operator, object);
return parseExpression($__0, name, object);
}
if (isEqualityExpression(tree)) {
if (isTypeof(tree.left) && isSafeTypeofString(tree.right)) {
var left = this.transformTypeofOperand_(tree.left);
var right = tree.right;
return new BinaryExpression(tree.location, left, tree.operator, right);
}
if (isTypeof(tree.right) && isSafeTypeofString(tree.left)) {
var left = tree.left;
var right = this.transformTypeofOperand_(tree.right);
return new BinaryExpression(tree.location, left, tree.operator, right);
}
}
return $traceurRuntime.superGet(this, $SymbolTransformer.prototype, "transformBinaryExpression").call(this, tree);
},
transformMemberLookupExpression: function(tree) {
var operand = this.transformAny(tree.operand);
var memberExpression = this.transformAny(tree.memberExpression);
if (memberExpression.type === LITERAL_EXPRESSION && memberExpression.literalToken.type !== STRING) {
return new MemberLookupExpression(tree.location, operand, memberExpression);
}
return parseExpression($__1, operand, memberExpression);
},
transformUnaryExpression: function(tree) {
if (tree.operator.type !== TYPEOF)
return $traceurRuntime.superGet(this, $SymbolTransformer.prototype, "transformUnaryExpression").call(this, tree);
var operand = this.transformAny(tree.operand);
var expression = this.getRuntimeTypeof(operand);
if (operand.type === IDENTIFIER_EXPRESSION) {
return parseExpression($__2, operand, expression);
}
return expression;
},
getRuntimeTypeof: function(operand) {
return parseExpression($__3, operand);
},
transformForInStatement: function(tree) {
var initializer = this.transformAny(tree.initializer);
var collection = this.transformAny(tree.collection);
var body = this.transformAny(tree.body);
var initIdentToken;
if (initializer.type === VARIABLE_DECLARATION_LIST) {
initIdentToken = initializer.declarations[0].lvalue.identifierToken;
} else {
initIdentToken = initializer.identifierToken;
}
if (!initIdentToken) {
throw new Error('Not implemented');
}
body = parseStatement($__4, initIdentToken, body);
return new ForInStatement(tree.location, initializer, collection, body);
}
}, {}, TempVarTransformer);
return {get SymbolTransformer() {
return SymbolTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/TemplateLiteralTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/TemplateLiteralTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/TemplateLiteralTransformer", path);
}
var $__0 = Object.freeze(Object.defineProperties(["Object.freeze(Object.defineProperties(", ", {\n raw: {\n value: Object.freeze(", ")\n }\n }))"], {raw: {value: Object.freeze(["Object.freeze(Object.defineProperties(", ", {\n raw: {\n value: Object.freeze(", ")\n }\n }))"])}}));
var $__1 = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType"),
BINARY_EXPRESSION = $__1.BINARY_EXPRESSION,
COMMA_EXPRESSION = $__1.COMMA_EXPRESSION,
CONDITIONAL_EXPRESSION = $__1.CONDITIONAL_EXPRESSION,
TEMPLATE_LITERAL_PORTION = $__1.TEMPLATE_LITERAL_PORTION;
var $__2 = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees"),
LiteralExpression = $__2.LiteralExpression,
ParenExpression = $__2.ParenExpression;
var LiteralToken = System.get("traceur@0.0.74/src/syntax/LiteralToken").LiteralToken;
var ParseTreeTransformer = System.get("traceur@0.0.74/src/codegeneration/ParseTreeTransformer").ParseTreeTransformer;
var TempVarTransformer = System.get("traceur@0.0.74/src/codegeneration/TempVarTransformer").TempVarTransformer;
var $__6 = System.get("traceur@0.0.74/src/syntax/TokenType"),
PERCENT = $__6.PERCENT,
PLUS = $__6.PLUS,
SLASH = $__6.SLASH,
STAR = $__6.STAR,
STRING = $__6.STRING;
var $__7 = System.get("traceur@0.0.74/src/codegeneration/ParseTreeFactory"),
createArgumentList = $__7.createArgumentList,
createArrayLiteralExpression = $__7.createArrayLiteralExpression,
createBinaryExpression = $__7.createBinaryExpression,
createCallExpression = $__7.createCallExpression,
createIdentifierExpression = $__7.createIdentifierExpression,
createOperatorToken = $__7.createOperatorToken,
createStringLiteral = $__7.createStringLiteral;
var parseExpression = System.get("traceur@0.0.74/src/codegeneration/PlaceholderParser").parseExpression;
function createCallSiteIdObject(tree) {
var elements = tree.elements;
var cooked = createCookedStringArray(elements);
var raw = createRawStringArray(elements);
return parseExpression($__0, cooked, raw);
}
function maybeAddEmptyStringAtEnd(elements, items) {
var length = elements.length;
if (!length || elements[length - 1].type !== TEMPLATE_LITERAL_PORTION)
items.push(createStringLiteral(''));
}
function createRawStringArray(elements) {
var items = [];
for (var i = 0; i < elements.length; i += 2) {
var str = elements[i].value.value;
str = str.replace(/\r\n?/g, '\n');
str = JSON.stringify(str);
str = replaceRaw(str);
var loc = elements[i].location;
var expr = new LiteralExpression(loc, new LiteralToken(STRING, str, loc));
items.push(expr);
}
maybeAddEmptyStringAtEnd(elements, items);
return createArrayLiteralExpression(items);
}
function createCookedStringLiteralExpression(tree) {
var str = cookString(tree.value.value);
var loc = tree.location;
return new LiteralExpression(loc, new LiteralToken(STRING, str, loc));
}
function createCookedStringArray(elements) {
var items = [];
for (var i = 0; i < elements.length; i += 2) {
items.push(createCookedStringLiteralExpression(elements[i]));
}
maybeAddEmptyStringAtEnd(elements, items);
return createArrayLiteralExpression(items);
}
function replaceRaw(s) {
return s.replace(/\u2028|\u2029/g, function(c) {
switch (c) {
case '\u2028':
return '\\u2028';
case '\u2029':
return '\\u2029';
default:
throw Error('Not reachable');
}
});
}
function cookString(s) {
var sb = ['"'];
var i = 0,
k = 1,
c,
c2;
while (i < s.length) {
c = s[i++];
switch (c) {
case '\\':
c2 = s[i++];
switch (c2) {
case '\n':
case '\u2028':
case '\u2029':
break;
case '\r':
if (s[i + 1] === '\n') {
i++;
}
break;
default:
sb[k++] = c;
sb[k++] = c2;
}
break;
case '"':
sb[k++] = '\\"';
break;
case '\n':
sb[k++] = '\\n';
break;
case '\r':
if (s[i] === '\n')
i++;
sb[k++] = '\\n';
break;
case '\t':
sb[k++] = '\\t';
break;
case '\f':
sb[k++] = '\\f';
break;
case '\b':
sb[k++] = '\\b';
break;
case '\u2028':
sb[k++] = '\\u2028';
break;
case '\u2029':
sb[k++] = '\\u2029';
break;
default:
sb[k++] = c;
}
}
sb[k++] = '"';
return sb.join('');
}
var TemplateLiteralTransformer = function TemplateLiteralTransformer() {
$traceurRuntime.superConstructor($TemplateLiteralTransformer).apply(this, arguments);
};
var $TemplateLiteralTransformer = TemplateLiteralTransformer;
($traceurRuntime.createClass)(TemplateLiteralTransformer, {
transformFunctionBody: function(tree) {
return ParseTreeTransformer.prototype.transformFunctionBody.call(this, tree);
},
transformTemplateLiteralExpression: function(tree) {
if (!tree.operand)
return this.createDefaultTemplateLiteral(tree);
var operand = this.transformAny(tree.operand);
var elements = tree.elements;
var callsiteIdObject = createCallSiteIdObject(tree);
var idName = this.addTempVar(callsiteIdObject);
var args = [createIdentifierExpression(idName)];
for (var i = 1; i < elements.length; i += 2) {
args.push(this.transformAny(elements[i]));
}
return createCallExpression(operand, createArgumentList(args));
},
transformTemplateSubstitution: function(tree) {
var transformedTree = this.transformAny(tree.expression);
switch (transformedTree.type) {
case BINARY_EXPRESSION:
switch (transformedTree.operator.type) {
case STAR:
case PERCENT:
case SLASH:
return transformedTree;
}
case COMMA_EXPRESSION:
case CONDITIONAL_EXPRESSION:
return new ParenExpression(null, transformedTree);
}
return transformedTree;
},
transformTemplateLiteralPortion: function(tree) {
return createCookedStringLiteralExpression(tree);
},
createDefaultTemplateLiteral: function(tree) {
var length = tree.elements.length;
if (length === 0) {
var loc = tree.location;
return new LiteralExpression(loc, new LiteralToken(STRING, '""', loc));
}
var firstNonEmpty = tree.elements[0].value.value === '' ? -1 : 0;
var binaryExpression = this.transformAny(tree.elements[0]);
if (length == 1)
return binaryExpression;
var plusToken = createOperatorToken(PLUS);
for (var i = 1; i < length; i++) {
var element = tree.elements[i];
if (element.type === TEMPLATE_LITERAL_PORTION) {
if (element.value.value === '')
continue;
else if (firstNonEmpty < 0 && i === 2)
binaryExpression = binaryExpression.right;
}
var transformedTree = this.transformAny(tree.elements[i]);
binaryExpression = createBinaryExpression(binaryExpression, plusToken, transformedTree);
}
return new ParenExpression(null, binaryExpression);
}
}, {}, TempVarTransformer);
return {get TemplateLiteralTransformer() {
return TemplateLiteralTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/TypeAssertionTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/TypeAssertionTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/TypeAssertionTransformer", path);
}
var $__0 = Object.freeze(Object.defineProperties(["assert.type(", ", ", ")"], {raw: {value: Object.freeze(["assert.type(", ", ", ")"])}})),
$__1 = Object.freeze(Object.defineProperties(["assert.argumentTypes(", ")"], {raw: {value: Object.freeze(["assert.argumentTypes(", ")"])}})),
$__2 = Object.freeze(Object.defineProperties(["return assert.returnType((", "), ", ")"], {raw: {value: Object.freeze(["return assert.returnType((", "), ", ")"])}})),
$__3 = Object.freeze(Object.defineProperties(["$traceurRuntime.type.any"], {raw: {value: Object.freeze(["$traceurRuntime.type.any"])}}));
var $__4 = System.get("traceur@0.0.74/src/syntax/trees/ParseTreeType"),
BINDING_ELEMENT = $__4.BINDING_ELEMENT,
REST_PARAMETER = $__4.REST_PARAMETER;
var $__5 = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees"),
ImportDeclaration = $__5.ImportDeclaration,
ImportSpecifier = $__5.ImportSpecifier,
ImportSpecifierSet = $__5.ImportSpecifierSet,
Module = $__5.Module,
ModuleSpecifier = $__5.ModuleSpecifier,
Script = $__5.Script,
VariableDeclaration = $__5.VariableDeclaration;
var $__6 = System.get("traceur@0.0.74/src/codegeneration/ParseTreeFactory"),
createArgumentList = $__6.createArgumentList,
createIdentifierExpression = $__6.createIdentifierExpression,
createImportedBinding = $__6.createImportedBinding,
createStringLiteralToken = $__6.createStringLiteralToken;
var $__7 = System.get("traceur@0.0.74/src/codegeneration/PlaceholderParser"),
parseExpression = $__7.parseExpression,
parseStatement = $__7.parseStatement;
var ParameterTransformer = System.get("traceur@0.0.74/src/codegeneration/ParameterTransformer").ParameterTransformer;
var options = System.get("traceur@0.0.74/src/Options").options;
var TypeAssertionTransformer = function TypeAssertionTransformer(identifierGenerator) {
$traceurRuntime.superConstructor($TypeAssertionTransformer).call(this, identifierGenerator);
this.returnTypeStack_ = [];
this.parametersStack_ = [];
this.assertionAdded_ = false;
};
var $TypeAssertionTransformer = TypeAssertionTransformer;
($traceurRuntime.createClass)(TypeAssertionTransformer, {
transformScript: function(tree) {
return this.prependAssertionImport_($traceurRuntime.superGet(this, $TypeAssertionTransformer.prototype, "transformScript").call(this, tree), Script);
},
transformModule: function(tree) {
return this.prependAssertionImport_($traceurRuntime.superGet(this, $TypeAssertionTransformer.prototype, "transformModule").call(this, tree), Module);
},
transformVariableDeclaration: function(tree) {
if (tree.typeAnnotation && tree.initializer) {
var assert = parseExpression($__0, tree.initializer, tree.typeAnnotation);
tree = new VariableDeclaration(tree.location, tree.lvalue, tree.typeAnnotation, assert);
this.assertionAdded_ = true;
}
return $traceurRuntime.superGet(this, $TypeAssertionTransformer.prototype, "transformVariableDeclaration").call(this, tree);
},
transformFormalParameterList: function(tree) {
this.parametersStack_.push({
atLeastOneParameterTyped: false,
arguments: []
});
var transformed = $traceurRuntime.superGet(this, $TypeAssertionTransformer.prototype, "transformFormalParameterList").call(this, tree);
var params = this.parametersStack_.pop();
if (params.atLeastOneParameterTyped) {
var argumentList = createArgumentList(params.arguments);
var assertStatement = parseStatement($__1, argumentList);
this.parameterStatements.push(assertStatement);
this.assertionAdded_ = true;
}
return transformed;
},
transformFormalParameter: function(tree) {
var transformed = $traceurRuntime.superGet(this, $TypeAssertionTransformer.prototype, "transformFormalParameter").call(this, tree);
switch (transformed.parameter.type) {
case BINDING_ELEMENT:
this.transformBindingElementParameter_(transformed.parameter, transformed.typeAnnotation);
break;
case REST_PARAMETER:
break;
}
return transformed;
},
transformGetAccessor: function(tree) {
this.pushReturnType_(tree.typeAnnotation);
tree = $traceurRuntime.superGet(this, $TypeAssertionTransformer.prototype, "transformGetAccessor").call(this, tree);
this.popReturnType_();
return tree;
},
transformPropertyMethodAssignment: function(tree) {
this.pushReturnType_(tree.typeAnnotation);
tree = $traceurRuntime.superGet(this, $TypeAssertionTransformer.prototype, "transformPropertyMethodAssignment").call(this, tree);
this.popReturnType_();
return tree;
},
transformFunctionDeclaration: function(tree) {
this.pushReturnType_(tree.typeAnnotation);
tree = $traceurRuntime.superGet(this, $TypeAssertionTransformer.prototype, "transformFunctionDeclaration").call(this, tree);
this.popReturnType_();
return tree;
},
transformFunctionExpression: function(tree) {
this.pushReturnType_(tree.typeAnnotation);
tree = $traceurRuntime.superGet(this, $TypeAssertionTransformer.prototype, "transformFunctionExpression").call(this, tree);
this.popReturnType_();
return tree;
},
transformArrowFunctionExpression: function(tree) {
this.pushReturnType_(null);
tree = $traceurRuntime.superGet(this, $TypeAssertionTransformer.prototype, "transformArrowFunctionExpression").call(this, tree);
this.popReturnType_();
return tree;
},
transformReturnStatement: function(tree) {
tree = $traceurRuntime.superGet(this, $TypeAssertionTransformer.prototype, "transformReturnStatement").call(this, tree);
if (this.returnType_ && tree.expression) {
this.assertionAdded_ = true;
return parseStatement($__2, tree.expression, this.returnType_);
}
return tree;
},
transformBindingElementParameter_: function(element, typeAnnotation) {
if (!element.binding.isPattern()) {
if (typeAnnotation) {
this.paramTypes_.atLeastOneParameterTyped = true;
} else {
typeAnnotation = parseExpression($__3);
}
this.paramTypes_.arguments.push(createIdentifierExpression(element.binding.identifierToken), typeAnnotation);
return;
}
},
pushReturnType_: function(typeAnnotation) {
this.returnTypeStack_.push(this.transformAny(typeAnnotation));
},
prependAssertionImport_: function(tree, Ctor) {
if (!this.assertionAdded_ || options.typeAssertionModule === null)
return tree;
var binding = createImportedBinding('assert');
var importStatement = new ImportDeclaration(null, new ImportSpecifierSet(null, [new ImportSpecifier(null, binding, null)]), new ModuleSpecifier(null, createStringLiteralToken(options.typeAssertionModule)));
tree = new Ctor(tree.location, $traceurRuntime.spread([importStatement], tree.scriptItemList), tree.moduleName);
return tree;
},
popReturnType_: function() {
return this.returnTypeStack_.pop();
},
get returnType_() {
return this.returnTypeStack_.length > 0 ? this.returnTypeStack_[this.returnTypeStack_.length - 1] : null;
},
get paramTypes_() {
return this.parametersStack_[this.parametersStack_.length - 1];
}
}, {}, ParameterTransformer);
return {get TypeAssertionTransformer() {
return TypeAssertionTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/TypeToExpressionTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/TypeToExpressionTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/TypeToExpressionTransformer", path);
}
var $__0 = Object.freeze(Object.defineProperties(["$traceurRuntime.type.", ")"], {raw: {value: Object.freeze(["$traceurRuntime.type.", ")"])}})),
$__1 = Object.freeze(Object.defineProperties(["$traceurRuntime.genericType(", ")"], {raw: {value: Object.freeze(["$traceurRuntime.genericType(", ")"])}}));
var ParseTreeTransformer = System.get("traceur@0.0.74/src/codegeneration/ParseTreeTransformer").ParseTreeTransformer;
var $__3 = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees"),
ArgumentList = $__3.ArgumentList,
IdentifierExpression = $__3.IdentifierExpression,
MemberExpression = $__3.MemberExpression;
var parseExpression = System.get("traceur@0.0.74/src/codegeneration/PlaceholderParser").parseExpression;
var TypeToExpressionTransformer = function TypeToExpressionTransformer() {
$traceurRuntime.superConstructor($TypeToExpressionTransformer).apply(this, arguments);
};
var $TypeToExpressionTransformer = TypeToExpressionTransformer;
($traceurRuntime.createClass)(TypeToExpressionTransformer, {
transformTypeName: function(tree) {
if (tree.moduleName) {
var operand = this.transformAny(tree.moduleName);
return new MemberExpression(tree.location, operand, tree.name);
}
return new IdentifierExpression(tree.location, tree.name);
},
transformPredefinedType: function(tree) {
return parseExpression($__0, tree.typeToken);
},
transformTypeReference: function(tree) {
var typeName = this.transformAny(tree.typeName);
var args = this.transformAny(tree.args);
var argumentList = new ArgumentList(tree.location, $traceurRuntime.spread([typeName], args));
return parseExpression($__1, argumentList);
},
transformTypeArguments: function(tree) {
return this.transformList(tree.args);
}
}, {}, ParseTreeTransformer);
return {get TypeToExpressionTransformer() {
return TypeToExpressionTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/TypeTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/TypeTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/TypeTransformer", path);
}
var $__0 = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees"),
FormalParameter = $__0.FormalParameter,
FunctionDeclaration = $__0.FunctionDeclaration,
FunctionExpression = $__0.FunctionExpression,
GetAccessor = $__0.GetAccessor,
PropertyMethodAssignment = $__0.PropertyMethodAssignment,
VariableDeclaration = $__0.VariableDeclaration;
var ParseTreeTransformer = System.get("traceur@0.0.74/src/codegeneration/ParseTreeTransformer").ParseTreeTransformer;
var TypeTransformer = function TypeTransformer() {
$traceurRuntime.superConstructor($TypeTransformer).apply(this, arguments);
};
var $TypeTransformer = TypeTransformer;
($traceurRuntime.createClass)(TypeTransformer, {
transformVariableDeclaration: function(tree) {
if (tree.typeAnnotation) {
tree = new VariableDeclaration(tree.location, tree.lvalue, null, tree.initializer);
}
return $traceurRuntime.superGet(this, $TypeTransformer.prototype, "transformVariableDeclaration").call(this, tree);
},
transformFormalParameter: function(tree) {
if (tree.typeAnnotation !== null)
return new FormalParameter(tree.location, tree.parameter, null, []);
return tree;
},
transformFunctionDeclaration: function(tree) {
if (tree.typeAnnotation) {
tree = new FunctionDeclaration(tree.location, tree.name, tree.functionKind, tree.parameterList, null, tree.annotations, tree.body);
}
return $traceurRuntime.superGet(this, $TypeTransformer.prototype, "transformFunctionDeclaration").call(this, tree);
},
transformFunctionExpression: function(tree) {
if (tree.typeAnnotation) {
tree = new FunctionExpression(tree.location, tree.name, tree.functionKind, tree.parameterList, null, tree.annotations, tree.body);
}
return $traceurRuntime.superGet(this, $TypeTransformer.prototype, "transformFunctionExpression").call(this, tree);
},
transformPropertyMethodAssignment: function(tree) {
if (tree.typeAnnotation) {
tree = new PropertyMethodAssignment(tree.location, tree.isStatic, tree.functionKind, tree.name, tree.parameterList, null, tree.annotations, tree.body);
}
return $traceurRuntime.superGet(this, $TypeTransformer.prototype, "transformPropertyMethodAssignment").call(this, tree);
},
transformGetAccessor: function(tree) {
if (tree.typeAnnotation) {
tree = new GetAccessor(tree.location, tree.isStatic, tree.name, null, tree.annotations, tree.body);
}
return $traceurRuntime.superGet(this, $TypeTransformer.prototype, "transformGetAccessor").call(this, tree);
}
}, {}, ParseTreeTransformer);
return {get TypeTransformer() {
return TypeTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/UnicodeEscapeSequenceTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/UnicodeEscapeSequenceTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/UnicodeEscapeSequenceTransformer", path);
}
var ParseTreeTransformer = System.get("traceur@0.0.74/src/codegeneration/ParseTreeTransformer").ParseTreeTransformer;
var LiteralExpression = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees").LiteralExpression;
var STRING = System.get("traceur@0.0.74/src/syntax/TokenType").STRING;
var re = /(\\*)\\u{([0-9a-fA-F]+)}/g;
function zeroPad(value) {
return '0000'.slice(value.length) + value;
}
function needsTransform(token) {
return token.type === STRING && re.test(token.value);
}
function transformToken(token) {
return token.value.replace(re, (function(match, backslashes, hexDigits) {
var backslashIsEscaped = backslashes.length % 2 === 1;
if (backslashIsEscaped) {
return match;
}
var codePoint = parseInt(hexDigits, 16);
var value;
if (codePoint <= 0xFFFF) {
value = '\\u' + zeroPad(codePoint.toString(16).toUpperCase());
} else {
var high = Math.floor((codePoint - 0x10000) / 0x400) + 0xD800;
var low = (codePoint - 0x10000) % 0x400 + 0xDC00;
value = '\\u' + high.toString(16).toUpperCase() + '\\u' + low.toString(16).toUpperCase();
}
return backslashes + value;
}));
}
var UnicodeEscapeSequenceTransformer = function UnicodeEscapeSequenceTransformer() {
$traceurRuntime.superConstructor($UnicodeEscapeSequenceTransformer).apply(this, arguments);
};
var $UnicodeEscapeSequenceTransformer = UnicodeEscapeSequenceTransformer;
($traceurRuntime.createClass)(UnicodeEscapeSequenceTransformer, {transformLiteralExpression: function(tree) {
var token = tree.literalToken;
if (needsTransform(token))
return new LiteralExpression(tree.location, transformToken(token));
return tree;
}}, {}, ParseTreeTransformer);
return {get UnicodeEscapeSequenceTransformer() {
return UnicodeEscapeSequenceTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/UniqueIdentifierGenerator", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/UniqueIdentifierGenerator";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/UniqueIdentifierGenerator", path);
}
var UniqueIdentifierGenerator = function UniqueIdentifierGenerator() {
this.identifierIndex = 0;
};
($traceurRuntime.createClass)(UniqueIdentifierGenerator, {generateUniqueIdentifier: function() {
return ("$__" + this.identifierIndex++);
}}, {});
return {get UniqueIdentifierGenerator() {
return UniqueIdentifierGenerator;
}};
});
System.register("traceur@0.0.74/src/codegeneration/FromOptionsTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/FromOptionsTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/FromOptionsTransformer", path);
}
var AmdTransformer = System.get("traceur@0.0.74/src/codegeneration/AmdTransformer").AmdTransformer;
var AnnotationsTransformer = System.get("traceur@0.0.74/src/codegeneration/AnnotationsTransformer").AnnotationsTransformer;
var ArrayComprehensionTransformer = System.get("traceur@0.0.74/src/codegeneration/ArrayComprehensionTransformer").ArrayComprehensionTransformer;
var ArrowFunctionTransformer = System.get("traceur@0.0.74/src/codegeneration/ArrowFunctionTransformer").ArrowFunctionTransformer;
var BlockBindingTransformer = System.get("traceur@0.0.74/src/codegeneration/BlockBindingTransformer").BlockBindingTransformer;
var ClassTransformer = System.get("traceur@0.0.74/src/codegeneration/ClassTransformer").ClassTransformer;
var CommonJsModuleTransformer = System.get("traceur@0.0.74/src/codegeneration/CommonJsModuleTransformer").CommonJsModuleTransformer;
var ExponentiationTransformer = System.get("traceur@0.0.74/src/codegeneration/ExponentiationTransformer").ExponentiationTransformer;
var validateConst = System.get("traceur@0.0.74/src/semantics/ConstChecker").validate;
var DefaultParametersTransformer = System.get("traceur@0.0.74/src/codegeneration/DefaultParametersTransformer").DefaultParametersTransformer;
var DestructuringTransformer = System.get("traceur@0.0.74/src/codegeneration/DestructuringTransformer").DestructuringTransformer;
var ForOfTransformer = System.get("traceur@0.0.74/src/codegeneration/ForOfTransformer").ForOfTransformer;
var validateFreeVariables = System.get("traceur@0.0.74/src/semantics/FreeVariableChecker").validate;
var GeneratorComprehensionTransformer = System.get("traceur@0.0.74/src/codegeneration/GeneratorComprehensionTransformer").GeneratorComprehensionTransformer;
var GeneratorTransformPass = System.get("traceur@0.0.74/src/codegeneration/GeneratorTransformPass").GeneratorTransformPass;
var InlineModuleTransformer = System.get("traceur@0.0.74/src/codegeneration/InlineModuleTransformer").InlineModuleTransformer;
var MemberVariableTransformer = System.get("traceur@0.0.74/src/codegeneration/MemberVariableTransformer").MemberVariableTransformer;
var ModuleTransformer = System.get("traceur@0.0.74/src/codegeneration/ModuleTransformer").ModuleTransformer;
var MultiTransformer = System.get("traceur@0.0.74/src/codegeneration/MultiTransformer").MultiTransformer;
var NumericLiteralTransformer = System.get("traceur@0.0.74/src/codegeneration/NumericLiteralTransformer").NumericLiteralTransformer;
var ObjectLiteralTransformer = System.get("traceur@0.0.74/src/codegeneration/ObjectLiteralTransformer").ObjectLiteralTransformer;
var PropertyNameShorthandTransformer = System.get("traceur@0.0.74/src/codegeneration/PropertyNameShorthandTransformer").PropertyNameShorthandTransformer;
var InstantiateModuleTransformer = System.get("traceur@0.0.74/src/codegeneration/InstantiateModuleTransformer").InstantiateModuleTransformer;
var RegularExpressionTransformer = System.get("traceur@0.0.74/src/codegeneration/RegularExpressionTransformer").RegularExpressionTransformer;
var RestParameterTransformer = System.get("traceur@0.0.74/src/codegeneration/RestParameterTransformer").RestParameterTransformer;
var SpreadTransformer = System.get("traceur@0.0.74/src/codegeneration/SpreadTransformer").SpreadTransformer;
var SymbolTransformer = System.get("traceur@0.0.74/src/codegeneration/SymbolTransformer").SymbolTransformer;
var TemplateLiteralTransformer = System.get("traceur@0.0.74/src/codegeneration/TemplateLiteralTransformer").TemplateLiteralTransformer;
var TypeTransformer = System.get("traceur@0.0.74/src/codegeneration/TypeTransformer").TypeTransformer;
var TypeAssertionTransformer = System.get("traceur@0.0.74/src/codegeneration/TypeAssertionTransformer").TypeAssertionTransformer;
var TypeToExpressionTransformer = System.get("traceur@0.0.74/src/codegeneration/TypeToExpressionTransformer").TypeToExpressionTransformer;
var UnicodeEscapeSequenceTransformer = System.get("traceur@0.0.74/src/codegeneration/UnicodeEscapeSequenceTransformer").UnicodeEscapeSequenceTransformer;
var UniqueIdentifierGenerator = System.get("traceur@0.0.74/src/codegeneration/UniqueIdentifierGenerator").UniqueIdentifierGenerator;
var $__33 = System.get("traceur@0.0.74/src/Options"),
options = $__33.options,
transformOptions = $__33.transformOptions;
var FromOptionsTransformer = function FromOptionsTransformer(reporter) {
var idGenerator = arguments[1] !== (void 0) ? arguments[1] : new UniqueIdentifierGenerator();
var $__34 = this;
$traceurRuntime.superConstructor($FromOptionsTransformer).call(this, reporter, options.validate);
var append = (function(transformer) {
$__34.append((function(tree) {
return new transformer(idGenerator, reporter).transformAny(tree);
}));
});
if (transformOptions.blockBinding) {
this.append((function(tree) {
validateConst(tree, reporter);
return tree;
}));
}
if (options.freeVariableChecker) {
this.append((function(tree) {
validateFreeVariables(tree, reporter);
return tree;
}));
}
if (transformOptions.exponentiation)
append(ExponentiationTransformer);
if (transformOptions.numericLiterals)
append(NumericLiteralTransformer);
if (transformOptions.unicodeExpressions)
append(RegularExpressionTransformer);
if (transformOptions.templateLiterals)
append(TemplateLiteralTransformer);
if (options.types)
append(TypeToExpressionTransformer);
if (transformOptions.unicodeEscapeSequences)
append(UnicodeEscapeSequenceTransformer);
if (transformOptions.annotations)
append(AnnotationsTransformer);
if (options.memberVariables)
append(MemberVariableTransformer);
if (options.typeAssertions)
append(TypeAssertionTransformer);
if (transformOptions.propertyNameShorthand)
append(PropertyNameShorthandTransformer);
if (transformOptions.modules) {
switch (transformOptions.modules) {
case 'commonjs':
append(CommonJsModuleTransformer);
break;
case 'amd':
append(AmdTransformer);
break;
case 'inline':
append(InlineModuleTransformer);
break;
case 'instantiate':
append(InstantiateModuleTransformer);
break;
case 'register':
append(ModuleTransformer);
break;
default:
throw new Error('Invalid modules transform option');
}
}
if (transformOptions.arrowFunctions)
append(ArrowFunctionTransformer);
if (transformOptions.classes)
append(ClassTransformer);
if (transformOptions.propertyMethods || transformOptions.computedPropertyNames) {
append(ObjectLiteralTransformer);
}
if (transformOptions.generatorComprehension)
append(GeneratorComprehensionTransformer);
if (transformOptions.arrayComprehension)
append(ArrayComprehensionTransformer);
if (transformOptions.forOf)
append(ForOfTransformer);
if (transformOptions.restParameters)
append(RestParameterTransformer);
if (transformOptions.defaultParameters)
append(DefaultParametersTransformer);
if (transformOptions.destructuring)
append(DestructuringTransformer);
if (transformOptions.types)
append(TypeTransformer);
if (transformOptions.spread)
append(SpreadTransformer);
if (transformOptions.blockBinding) {
this.append((function(tree) {
var transformer = new BlockBindingTransformer(idGenerator, reporter, tree);
return transformer.transformAny(tree);
}));
}
if (transformOptions.generators || transformOptions.asyncFunctions)
append(GeneratorTransformPass);
if (transformOptions.symbols)
append(SymbolTransformer);
};
var $FromOptionsTransformer = FromOptionsTransformer;
($traceurRuntime.createClass)(FromOptionsTransformer, {}, {}, MultiTransformer);
return {get FromOptionsTransformer() {
return FromOptionsTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/PureES6Transformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/PureES6Transformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/PureES6Transformer", path);
}
var AnnotationsTransformer = System.get("traceur@0.0.74/src/codegeneration/AnnotationsTransformer").AnnotationsTransformer;
var validateFreeVariables = System.get("traceur@0.0.74/src/semantics/FreeVariableChecker").validate;
var MemberVariableTransformer = System.get("traceur@0.0.74/src/codegeneration/MemberVariableTransformer").MemberVariableTransformer;
var MultiTransformer = System.get("traceur@0.0.74/src/codegeneration/MultiTransformer").MultiTransformer;
var TypeTransformer = System.get("traceur@0.0.74/src/codegeneration/TypeTransformer").TypeTransformer;
var UniqueIdentifierGenerator = System.get("traceur@0.0.74/src/codegeneration/UniqueIdentifierGenerator").UniqueIdentifierGenerator;
var options = System.get("traceur@0.0.74/src/Options").options;
var PureES6Transformer = function PureES6Transformer(reporter) {
var idGenerator = arguments[1] !== (void 0) ? arguments[1] : new UniqueIdentifierGenerator();
var $__7 = this;
$traceurRuntime.superConstructor($PureES6Transformer).call(this, reporter, options.validate);
var append = (function(transformer) {
$__7.append((function(tree) {
return new transformer(idGenerator, reporter).transformAny(tree);
}));
});
if (options.freeVariableChecker) {
this.append((function(tree) {
validateFreeVariables(tree, reporter);
return tree;
}));
}
if (options.memberVariables)
append(MemberVariableTransformer);
append(AnnotationsTransformer);
append(TypeTransformer);
};
var $PureES6Transformer = PureES6Transformer;
($traceurRuntime.createClass)(PureES6Transformer, {}, {}, MultiTransformer);
return {get PureES6Transformer() {
return PureES6Transformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/module/AttachModuleNameTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/module/AttachModuleNameTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/module/AttachModuleNameTransformer", path);
}
var ParseTreeTransformer = System.get("traceur@0.0.74/src/codegeneration/ParseTreeTransformer").ParseTreeTransformer;
var $__1 = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees"),
Module = $__1.Module,
Script = $__1.Script;
var AttachModuleNameTransformer = function AttachModuleNameTransformer(moduleName) {
this.moduleName_ = moduleName;
};
($traceurRuntime.createClass)(AttachModuleNameTransformer, {
transformModule: function(tree) {
return new Module(tree.location, tree.scriptItemList, this.moduleName_);
},
transformScript: function(tree) {
return new Script(tree.location, tree.scriptItemList, this.moduleName_);
}
}, {}, ParseTreeTransformer);
return {get AttachModuleNameTransformer() {
return AttachModuleNameTransformer;
}};
});
System.register("traceur@0.0.74/src/Compiler", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/Compiler";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/Compiler", path);
}
var AttachModuleNameTransformer = System.get("traceur@0.0.74/src/codegeneration/module/AttachModuleNameTransformer").AttachModuleNameTransformer;
var FromOptionsTransformer = System.get("traceur@0.0.74/src/codegeneration/FromOptionsTransformer").FromOptionsTransformer;
var Parser = System.get("traceur@0.0.74/src/syntax/Parser").Parser;
var PureES6Transformer = System.get("traceur@0.0.74/src/codegeneration/PureES6Transformer").PureES6Transformer;
var SourceFile = System.get("traceur@0.0.74/src/syntax/SourceFile").SourceFile;
var CollectingErrorReporter = System.get("traceur@0.0.74/src/util/CollectingErrorReporter").CollectingErrorReporter;
var $__6 = System.get("traceur@0.0.74/src/Options"),
Options = $__6.Options,
traceurOptions = $__6.options,
versionLockedOptions = $__6.versionLockedOptions;
var ParseTreeMapWriter = System.get("traceur@0.0.74/src/outputgeneration/ParseTreeMapWriter").ParseTreeMapWriter;
var ParseTreeWriter = System.get("traceur@0.0.74/src/outputgeneration/ParseTreeWriter").ParseTreeWriter;
var SourceMapGenerator = System.get("traceur@0.0.74/src/outputgeneration/SourceMapIntegration").SourceMapGenerator;
function merge() {
for (var srcs = [],
$__11 = 0; $__11 < arguments.length; $__11++)
srcs[$__11] = arguments[$__11];
var dest = Object.create(null);
srcs.forEach((function(src) {
Object.keys(src).forEach((function(key) {
dest[key] = src[key];
}));
var srcModules = src.modules;
if (typeof srcModules !== 'undefined') {
dest.modules = srcModules;
}
}));
return dest;
}
function basePath(name) {
if (!name)
return null;
var lastSlash = name.lastIndexOf('/');
if (lastSlash < 0)
return null;
return name.substring(0, lastSlash + 1);
}
var Compiler = function Compiler() {
var overridingOptions = arguments[0] !== (void 0) ? arguments[0] : {};
this.options_ = new Options(this.defaultOptions());
this.options_.setFromObject(overridingOptions);
this.sourceMapGenerator_ = null;
this.sourceMapInfo_ = null;
};
var $Compiler = Compiler;
($traceurRuntime.createClass)(Compiler, {
compile: function(content) {
var sourceName = arguments[1] !== (void 0) ? arguments[1] : '';
var outputName = arguments[2] !== (void 0) ? arguments[2] : '';
var sourceRoot = arguments[3];
sourceName = this.normalize(sourceName);
outputName = this.normalize(outputName);
var tree = this.parse(content, sourceName);
var moduleName = this.options_.moduleName;
if (moduleName) {
if (typeof moduleName !== 'string')
moduleName = sourceName.replace(/\.js$/, '');
}
tree = this.transform(tree, moduleName);
return this.write(tree, outputName, sourceRoot);
},
throwIfErrors: function(errorReporter) {
if (errorReporter.hadError())
throw errorReporter.errors;
},
parse: function(content) {
var sourceName = arguments[1] !== (void 0) ? arguments[1] : '';
sourceName = this.normalize(sourceName);
this.sourceMapGenerator_ = null;
traceurOptions.setFromObject(this.options_);
var errorReporter = new CollectingErrorReporter();
var sourceFile = new SourceFile(sourceName, content);
var parser = new Parser(sourceFile, errorReporter);
var tree = this.options_.script ? parser.parseScript() : parser.parseModule();
this.throwIfErrors(errorReporter);
return tree;
},
transform: function(tree) {
var moduleName = arguments[1];
var transformer;
if (moduleName) {
var transformer = new AttachModuleNameTransformer(moduleName);
tree = transformer.transformAny(tree);
}
var errorReporter = new CollectingErrorReporter();
if (this.options_.outputLanguage.toLowerCase() === 'es6') {
transformer = new PureES6Transformer(errorReporter);
} else {
transformer = new FromOptionsTransformer(errorReporter);
}
var transformedTree = transformer.transform(tree);
this.throwIfErrors(errorReporter);
return transformedTree;
},
createSourceMapGenerator_: function(outputName) {
var sourceRoot = arguments[1];
if (this.options_.sourceMaps) {
var sourceRoot = sourceRoot || basePath(outputName);
return new SourceMapGenerator({
file: outputName,
sourceRoot: sourceRoot
});
}
},
getSourceMap: function() {
if (this.sourceMapGenerator_)
return this.sourceMapGenerator_.toString();
},
get sourceMapInfo() {
return this.sourceMapInfo_;
},
write: function(tree) {
var outputName = arguments[1];
var sourceRoot = arguments[2];
outputName = this.normalize(outputName);
sourceRoot = this.normalize(sourceRoot);
var writer;
this.sourceMapGenerator_ = this.createSourceMapGenerator_(outputName, sourceRoot);
if (this.sourceMapGenerator_) {
writer = new ParseTreeMapWriter(this.sourceMapGenerator_, sourceRoot, this.options_);
} else {
writer = new ParseTreeWriter(this.options_);
}
writer.visitAny(tree);
var compiledCode = writer.toString(tree);
if (this.sourceMapGenerator_) {
var sourceMappingURL = this.sourceMappingURL(outputName);
compiledCode += '\n//# sourceMappingURL=' + sourceMappingURL + '\n';
}
return compiledCode;
},
sourceName: function(filename) {
return filename;
},
sourceMappingURL: function(filename) {
this.sourceMapInfo_ = {
url: filename,
map: this.getSourceMap()
};
if (this.options_.sourceMaps === 'inline') {
if (Reflect.global.btoa) {
return 'data:application/json;base64,' + btoa(unescape(encodeURIComponent(this.getSourceMap())));
}
}
return filename.split('/').pop().replace(/\.js$/, '.map');
},
sourceNameFromTree: function(tree) {
return tree.location.start.source.name;
},
defaultOptions: function() {
return versionLockedOptions;
},
normalize: function(name) {
return name && name.replace(/\\/g, '/');
}
}, {
script: function(content) {
var options = arguments[1] !== (void 0) ? arguments[1] : {};
options = new Options(options);
options.script = true;
return new $Compiler(options).compile(content);
},
module: function(content) {
var options = arguments[1] !== (void 0) ? arguments[1] : {};
options = new Options(options);
options.modules = 'register';
return new $Compiler(options).compile(content);
},
amdOptions: function() {
var options = arguments[0] !== (void 0) ? arguments[0] : {};
var amdOptions = {
modules: 'amd',
sourceMaps: false,
moduleName: false
};
return merge(amdOptions, options);
},
commonJSOptions: function() {
var options = arguments[0] !== (void 0) ? arguments[0] : {};
var commonjsOptions = {
modules: 'commonjs',
sourceMaps: false,
moduleName: false
};
return merge(commonjsOptions, options);
}
});
return {get Compiler() {
return Compiler;
}};
});
System.register("traceur@0.0.74/src/codegeneration/module/ValidationVisitor", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/module/ValidationVisitor";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/module/ValidationVisitor", path);
}
var ModuleVisitor = System.get("traceur@0.0.74/src/codegeneration/module/ModuleVisitor").ModuleVisitor;
var ValidationVisitor = function ValidationVisitor() {
$traceurRuntime.superConstructor($ValidationVisitor).apply(this, arguments);
};
var $ValidationVisitor = ValidationVisitor;
($traceurRuntime.createClass)(ValidationVisitor, {
checkExport_: function(tree, name) {
var description = this.validatingModuleDescription_;
if (description && !description.getExport(name)) {
var moduleName = description.normalizedName;
this.reportError(tree, ("'" + name + "' is not exported by '" + moduleName + "'"));
}
},
checkImport_: function(tree, name) {
var existingImport = this.moduleSymbol.getImport(name);
if (existingImport) {
this.reportError(tree, ("'" + name + "' was previously imported at " + existingImport.location.start));
} else {
this.moduleSymbol.addImport(name, tree);
}
},
visitAndValidate_: function(moduleDescription, tree) {
var validatingModuleDescription = this.validatingModuleDescription_;
this.validatingModuleDescription_ = moduleDescription;
this.visitAny(tree);
this.validatingModuleDescription_ = validatingModuleDescription;
},
visitNamedExport: function(tree) {
if (tree.moduleSpecifier) {
var name = tree.moduleSpecifier.token.processedValue;
var moduleDescription = this.getExportsListForModuleSpecifier(name);
this.visitAndValidate_(moduleDescription, tree.specifierSet);
}
},
visitExportSpecifier: function(tree) {
this.checkExport_(tree, tree.lhs.value);
},
visitImportDeclaration: function(tree) {
var name = tree.moduleSpecifier.token.processedValue;
var moduleDescription = this.getExportsListForModuleSpecifier(name);
this.visitAndValidate_(moduleDescription, tree.importClause);
},
visitImportSpecifier: function(tree) {
var importName = tree.binding.getStringValue();
var exportName = tree.name ? tree.name.value : importName;
this.checkImport_(tree, importName);
this.checkExport_(tree, exportName);
},
visitImportedBinding: function(tree) {
var importName = tree.binding.getStringValue();
this.checkImport_(tree, importName);
this.checkExport_(tree, 'default');
}
}, {}, ModuleVisitor);
return {get ValidationVisitor() {
return ValidationVisitor;
}};
});
System.register("traceur@0.0.74/src/codegeneration/module/ExportListBuilder", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/module/ExportListBuilder";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/module/ExportListBuilder", path);
}
var ExportVisitor = System.get("traceur@0.0.74/src/codegeneration/module/ExportVisitor").ExportVisitor;
var ValidationVisitor = System.get("traceur@0.0.74/src/codegeneration/module/ValidationVisitor").ValidationVisitor;
var transformOptions = System.get("traceur@0.0.74/src/Options").transformOptions;
function buildExportList(deps, loader, reporter) {
if (!transformOptions.modules)
return;
function doVisit(ctor) {
for (var i = 0; i < deps.length; i++) {
var visitor = new ctor(reporter, loader, deps[i]);
visitor.visitAny(deps[i].tree);
}
}
function reverseVisit(ctor) {
for (var i = deps.length - 1; i >= 0; i--) {
var visitor = new ctor(reporter, loader, deps[i]);
visitor.visitAny(deps[i].tree);
}
}
reverseVisit(ExportVisitor);
doVisit(ValidationVisitor);
}
return {get buildExportList() {
return buildExportList;
}};
});
System.register("traceur@0.0.74/src/codegeneration/module/ModuleSpecifierVisitor", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/module/ModuleSpecifierVisitor";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/module/ModuleSpecifierVisitor", path);
}
var ParseTreeVisitor = System.get("traceur@0.0.74/src/syntax/ParseTreeVisitor").ParseTreeVisitor;
var options = System.get("traceur@0.0.74/src/Options").options;
var ModuleSpecifierVisitor = function ModuleSpecifierVisitor() {
$traceurRuntime.superConstructor($ModuleSpecifierVisitor).call(this);
this.moduleSpecifiers_ = Object.create(null);
};
var $ModuleSpecifierVisitor = ModuleSpecifierVisitor;
($traceurRuntime.createClass)(ModuleSpecifierVisitor, {
get moduleSpecifiers() {
return Object.keys(this.moduleSpecifiers_);
},
visitModuleSpecifier: function(tree) {
this.moduleSpecifiers_[tree.token.processedValue] = true;
},
visitVariableDeclaration: function(tree) {
this.addTypeAssertionDependency_(tree.typeAnnotation);
return $traceurRuntime.superGet(this, $ModuleSpecifierVisitor.prototype, "visitVariableDeclaration").call(this, tree);
},
visitFormalParameter: function(tree) {
this.addTypeAssertionDependency_(tree.typeAnnotation);
return $traceurRuntime.superGet(this, $ModuleSpecifierVisitor.prototype, "visitFormalParameter").call(this, tree);
},
visitGetAccessor: function(tree) {
this.addTypeAssertionDependency_(tree.typeAnnotation);
return $traceurRuntime.superGet(this, $ModuleSpecifierVisitor.prototype, "visitGetAccessor").call(this, tree);
},
visitPropertyMethodAssignment: function(tree) {
this.addTypeAssertionDependency_(tree.typeAnnotation);
return $traceurRuntime.superGet(this, $ModuleSpecifierVisitor.prototype, "visitPropertyMethodAssignment").call(this, tree);
},
visitFunctionDeclaration: function(tree) {
this.addTypeAssertionDependency_(tree.typeAnnotation);
return $traceurRuntime.superGet(this, $ModuleSpecifierVisitor.prototype, "visitFunctionDeclaration").call(this, tree);
},
visitFunctionExpression: function(tree) {
this.addTypeAssertionDependency_(tree.typeAnnotation);
return $traceurRuntime.superGet(this, $ModuleSpecifierVisitor.prototype, "visitFunctionExpression").call(this, tree);
},
addTypeAssertionDependency_: function(typeAnnotation) {
if (typeAnnotation !== null && options.typeAssertionModule !== null)
this.moduleSpecifiers_[options.typeAssertionModule] = true;
}
}, {}, ParseTreeVisitor);
return {get ModuleSpecifierVisitor() {
return ModuleSpecifierVisitor;
}};
});
System.register("traceur@0.0.74/src/runtime/system-map", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/runtime/system-map";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/runtime/system-map", path);
}
function prefixMatchLength(name, prefix) {
var prefixParts = prefix.split('/');
var nameParts = name.split('/');
if (prefixParts.length > nameParts.length)
return 0;
for (var i = 0; i < prefixParts.length; i++) {
if (nameParts[i] != prefixParts[i])
return 0;
}
return prefixParts.length;
}
function applyMap(map, name, parentName) {
var curMatch,
curMatchLength = 0;
var curParent,
curParentMatchLength = 0;
if (parentName) {
var mappedName;
Object.getOwnPropertyNames(map).some(function(p) {
var curMap = map[p];
if (curMap && typeof curMap === 'object') {
if (prefixMatchLength(parentName, p) <= curParentMatchLength)
return;
Object.getOwnPropertyNames(curMap).forEach(function(q) {
if (prefixMatchLength(name, q) > curMatchLength) {
curMatch = q;
curMatchLength = q.split('/').length;
curParent = p;
curParentMatchLength = p.split('/').length;
}
});
}
if (curMatch) {
var subPath = name.split('/').splice(curMatchLength).join('/');
mappedName = map[curParent][curMatch] + (subPath ? '/' + subPath : '');
return mappedName;
}
});
}
if (mappedName)
return mappedName;
Object.getOwnPropertyNames(map).forEach(function(p) {
var curMap = map[p];
if (curMap && typeof curMap === 'string') {
if (prefixMatchLength(name, p) > curMatchLength) {
curMatch = p;
curMatchLength = p.split('/').length;
}
}
});
if (!curMatch)
return name;
var subPath = name.split('/').splice(curMatchLength).join('/');
return map[curMatch] + (subPath ? '/' + subPath : '');
}
var systemjs = {applyMap: applyMap};
return {get systemjs() {
return systemjs;
}};
});
System.register("traceur@0.0.74/src/util/url", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/util/url";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/util/url", path);
}
var canonicalizeUrl = $traceurRuntime.canonicalizeUrl;
var isAbsolute = $traceurRuntime.isAbsolute;
var removeDotSegments = $traceurRuntime.removeDotSegments;
var resolveUrl = $traceurRuntime.resolveUrl;
return {
get canonicalizeUrl() {
return canonicalizeUrl;
},
get isAbsolute() {
return isAbsolute;
},
get removeDotSegments() {
return removeDotSegments;
},
get resolveUrl() {
return resolveUrl;
}
};
});
System.register("traceur@0.0.74/src/runtime/LoaderCompiler", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/runtime/LoaderCompiler";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/runtime/LoaderCompiler", path);
}
var AttachModuleNameTransformer = System.get("traceur@0.0.74/src/codegeneration/module/AttachModuleNameTransformer").AttachModuleNameTransformer;
var FromOptionsTransformer = System.get("traceur@0.0.74/src/codegeneration/FromOptionsTransformer").FromOptionsTransformer;
var buildExportList = System.get("traceur@0.0.74/src/codegeneration/module/ExportListBuilder").buildExportList;
var CollectingErrorReporter = System.get("traceur@0.0.74/src/util/CollectingErrorReporter").CollectingErrorReporter;
var Compiler = System.get("traceur@0.0.74/src/Compiler").Compiler;
var ModuleSpecifierVisitor = System.get("traceur@0.0.74/src/codegeneration/module/ModuleSpecifierVisitor").ModuleSpecifierVisitor;
var ModuleSymbol = System.get("traceur@0.0.74/src/codegeneration/module/ModuleSymbol").ModuleSymbol;
var Parser = System.get("traceur@0.0.74/src/syntax/Parser").Parser;
var globalOptions = System.get("traceur@0.0.74/src/Options").options;
var SourceFile = System.get("traceur@0.0.74/src/syntax/SourceFile").SourceFile;
var systemjs = System.get("traceur@0.0.74/src/runtime/system-map").systemjs;
var toSource = System.get("traceur@0.0.74/src/outputgeneration/toSource").toSource;
var UniqueIdentifierGenerator = System.get("traceur@0.0.74/src/codegeneration/UniqueIdentifierGenerator").UniqueIdentifierGenerator;
var $__13 = System.get("traceur@0.0.74/src/util/url"),
isAbsolute = $__13.isAbsolute,
resolveUrl = $__13.resolveUrl;
var assert = System.get("traceur@0.0.74/src/util/assert").assert;
var NOT_STARTED = 0;
var LOADING = 1;
var LOADED = 2;
var PARSED = 3;
var TRANSFORMING = 4;
var TRANSFORMED = 5;
var COMPLETE = 6;
var ERROR = 7;
var identifierGenerator = new UniqueIdentifierGenerator();
var anonymousSourcesSeen = 0;
var LoaderCompiler = function LoaderCompiler() {};
($traceurRuntime.createClass)(LoaderCompiler, {
getModuleSpecifiers: function(codeUnit) {
this.parse(codeUnit);
codeUnit.state = PARSED;
var moduleSpecifierVisitor = new ModuleSpecifierVisitor();
moduleSpecifierVisitor.visit(codeUnit.metadata.tree);
return moduleSpecifierVisitor.moduleSpecifiers;
},
parse: function(codeUnit) {
assert(!codeUnit.metadata.tree);
var metadata = codeUnit.metadata;
var options = metadata.traceurOptions;
if (codeUnit.type === 'script')
options.script = true;
metadata.compiler = new Compiler(options);
var sourceName = codeUnit.metadata.sourceName = codeUnit.address || codeUnit.normalizedName || String(++anonymousSourcesSeen);
metadata.tree = metadata.compiler.parse(codeUnit.source, sourceName);
},
transform: function(codeUnit) {
var metadata = codeUnit.metadata;
metadata.transformedTree = metadata.compiler.transform(metadata.tree, codeUnit.normalizedName);
},
write: function(codeUnit) {
var metadata = codeUnit.metadata;
var outputName = metadata.outputName || metadata.sourceName || '';
var sourceRoot = metadata.sourceRoot;
metadata.transcoded = metadata.compiler.write(metadata.transformedTree, outputName);
if (codeUnit.address && metadata.transcoded)
metadata.transcoded += '//# sourceURL=' + codeUnit.address;
},
evaluateCodeUnit: function(codeUnit) {
var result = ('global', eval)(codeUnit.metadata.transcoded);
codeUnit.metadata.transformedTree = null;
return result;
},
analyzeDependencies: function(dependencies, loader) {
var deps = [];
for (var i = 0; i < dependencies.length; i++) {
var codeUnit = dependencies[i];
assert(codeUnit.state >= PARSED);
if (codeUnit.state == PARSED) {
var symbol = codeUnit.metadata.moduleSymbol = new ModuleSymbol(codeUnit.metadata.tree, codeUnit.normalizedName);
deps.push(symbol);
}
}
this.checkForErrors((function(reporter) {
return buildExportList(deps, loader, reporter);
}));
},
checkForErrors: function(fncOfReporter) {
var reporter = new CollectingErrorReporter();
var result = fncOfReporter(reporter);
if (reporter.hadError())
throw reporter.toError();
return result;
}
}, {});
return {get LoaderCompiler() {
return LoaderCompiler;
}};
});
System.register("traceur@0.0.74/src/runtime/InternalLoader", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/runtime/InternalLoader";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/runtime/InternalLoader", path);
}
var assert = System.get("traceur@0.0.74/src/util/assert").assert;
var LoaderCompiler = System.get("traceur@0.0.74/src/runtime/LoaderCompiler").LoaderCompiler;
var ExportsList = System.get("traceur@0.0.74/src/codegeneration/module/ModuleSymbol").ExportsList;
var Map = System.get("traceur@0.0.74/src/runtime/polyfills/Map").Map;
var $__4 = System.get("traceur@0.0.74/src/util/url"),
isAbsolute = $__4.isAbsolute,
resolveUrl = $__4.resolveUrl;
var Options = System.get("traceur@0.0.74/src/Options").Options;
var NOT_STARTED = 0;
var LOADING = 1;
var LOADED = 2;
var PARSED = 3;
var TRANSFORMING = 4;
var TRANSFORMED = 5;
var COMPLETE = 6;
var ERROR = 7;
function mapToValues(map) {
var array = [];
map.forEach((function(v) {
array.push(v);
}));
return array;
}
var LoaderError = function LoaderError(msg, tree) {
this.message = msg;
this.tree = tree;
this.name = 'LoaderError';
};
($traceurRuntime.createClass)(LoaderError, {}, {}, Error);
var CodeUnit = function CodeUnit(loaderCompiler, normalizedName, type, state, name, referrerName, address) {
var $__6 = this;
this.promise = new Promise((function(res, rej) {
$__6.loaderCompiler = loaderCompiler;
$__6.normalizedName = normalizedName;
$__6.type = type;
$__6.name_ = name;
$__6.referrerName_ = referrerName;
$__6.address = address;
$__6.state_ = state || NOT_STARTED;
$__6.error = null;
$__6.result = null;
$__6.metadata_ = {};
$__6.dependencies = [];
$__6.resolve = res;
$__6.reject = rej;
}));
};
($traceurRuntime.createClass)(CodeUnit, {
get state() {
return this.state_;
},
set state(state) {
if (state < this.state_) {
throw new Error('Invalid state change');
}
this.state_ = state;
},
get metadata() {
return this.metadata_;
},
set metadata(value) {
assert(value);
this.metadata_ = value;
},
nameTrace: function() {
var trace = this.specifiedAs();
if (isAbsolute(this.name_)) {
return trace + 'An absolute name.\n';
}
if (this.referrerName_) {
return trace + this.importedBy() + this.normalizesTo();
}
return trace + this.normalizesTo();
},
specifiedAs: function() {
return ("Specified as " + this.name_ + ".\n");
},
importedBy: function() {
return ("Imported by " + this.referrerName_ + ".\n");
},
normalizesTo: function() {
return 'Normalizes to ' + this.normalizedName + '\n';
}
}, {});
var PreCompiledCodeUnit = function PreCompiledCodeUnit(loaderCompiler, normalizedName, name, referrerName, address, module) {
$traceurRuntime.superConstructor($PreCompiledCodeUnit).call(this, loaderCompiler, normalizedName, 'module', COMPLETE, name, referrerName, address);
this.result = module;
this.resolve(this.result);
};
var $PreCompiledCodeUnit = PreCompiledCodeUnit;
($traceurRuntime.createClass)(PreCompiledCodeUnit, {}, {}, CodeUnit);
var BundledCodeUnit = function BundledCodeUnit(loaderCompiler, normalizedName, name, referrerName, address, deps, execute) {
$traceurRuntime.superConstructor($BundledCodeUnit).call(this, loaderCompiler, normalizedName, 'module', TRANSFORMED, name, referrerName, address);
this.deps = deps;
this.execute = execute;
};
var $BundledCodeUnit = BundledCodeUnit;
($traceurRuntime.createClass)(BundledCodeUnit, {
getModuleSpecifiers: function() {
return this.deps;
},
evaluate: function() {
var $__6 = this;
var normalizedNames = this.deps.map((function(name) {
return $__6.loader_.normalize(name);
}));
var module = this.execute.apply(Reflect.global, normalizedNames);
System.set(this.normalizedName, module);
return module;
}
}, {}, CodeUnit);
var HookedCodeUnit = function HookedCodeUnit() {
$traceurRuntime.superConstructor($HookedCodeUnit).apply(this, arguments);
};
var $HookedCodeUnit = HookedCodeUnit;
($traceurRuntime.createClass)(HookedCodeUnit, {
getModuleSpecifiers: function() {
return this.loaderCompiler.getModuleSpecifiers(this);
},
evaluate: function() {
return this.loaderCompiler.evaluateCodeUnit(this);
}
}, {}, CodeUnit);
var LoadCodeUnit = function LoadCodeUnit(loaderCompiler, normalizedName, name, referrerName, address) {
$traceurRuntime.superConstructor($LoadCodeUnit).call(this, loaderCompiler, normalizedName, 'module', NOT_STARTED, name, referrerName, address);
};
var $LoadCodeUnit = LoadCodeUnit;
($traceurRuntime.createClass)(LoadCodeUnit, {}, {}, HookedCodeUnit);
var EvalCodeUnit = function EvalCodeUnit(loaderCompiler, code) {
var type = arguments[2] !== (void 0) ? arguments[2] : 'script';
var normalizedName = arguments[3];
var referrerName = arguments[4];
var address = arguments[5];
$traceurRuntime.superConstructor($EvalCodeUnit).call(this, loaderCompiler, normalizedName, type, LOADED, null, referrerName, address);
this.source = code;
};
var $EvalCodeUnit = EvalCodeUnit;
($traceurRuntime.createClass)(EvalCodeUnit, {}, {}, HookedCodeUnit);
var uniqueNameCount = 0;
var InternalLoader = function InternalLoader(loader, loaderCompiler) {
assert(loaderCompiler);
this.loader_ = loader;
this.loaderCompiler = loaderCompiler;
this.cache = new Map();
this.urlToKey = Object.create(null);
this.sync_ = false;
this.sourceMapsByURL_ = Object.create(null);
};
($traceurRuntime.createClass)(InternalLoader, {
defaultMetadata_: function() {
var metadata = arguments[0] !== (void 0) ? arguments[0] : {};
metadata.traceurOptions = metadata.traceurOptions || new Options();
return metadata;
},
defaultModuleMetadata_: function() {
var metadata = arguments[0] !== (void 0) ? arguments[0] : {};
var metadata = this.defaultMetadata_(metadata);
metadata.traceurOptions.script = false;
return metadata;
},
getSourceMap: function(url) {
return this.sourceMapsByURL_[url];
},
load: function(name) {
var referrerName = arguments[1] !== (void 0) ? arguments[1] : this.loader_.baseURL;
var address = arguments[2];
var metadata = arguments[3] !== (void 0) ? arguments[3] : {};
metadata = this.defaultMetadata_(metadata);
var codeUnit = this.getOrCreateCodeUnit_(name, referrerName, address, metadata);
this.load_(codeUnit);
return codeUnit.promise.then((function() {
return codeUnit;
}));
},
load_: function(codeUnit) {
var $__6 = this;
if (codeUnit.state === ERROR) {
return codeUnit;
}
if (codeUnit.state === TRANSFORMED) {
this.handleCodeUnitLoaded(codeUnit);
} else {
if (codeUnit.state !== NOT_STARTED)
return codeUnit;
codeUnit.state = LOADING;
codeUnit.address = this.loader_.locate(codeUnit);
this.loader_.fetch(codeUnit).then((function(text) {
codeUnit.source = text;
return codeUnit;
})).then((function(load) {
return $__6.loader_.translate(load);
})).then((function(source) {
codeUnit.source = source;
codeUnit.state = LOADED;
$__6.handleCodeUnitLoaded(codeUnit);
return codeUnit;
})).catch((function(err) {
try {
codeUnit.state = ERROR;
codeUnit.error = err;
$__6.handleCodeUnitLoadError(codeUnit);
} catch (ex) {
console.error('Internal Error ' + (ex.stack || ex));
}
}));
}
return codeUnit;
},
module: function(code, referrerName, address, metadata) {
var codeUnit = new EvalCodeUnit(this.loaderCompiler, code, 'module', null, referrerName, address);
codeUnit.metadata = this.defaultMetadata_(metadata);
this.cache.set({}, codeUnit);
this.handleCodeUnitLoaded(codeUnit);
return codeUnit.promise;
},
define: function(normalizedName, code, address, metadata) {
var codeUnit = new EvalCodeUnit(this.loaderCompiler, code, 'module', normalizedName, null, address);
var key = this.getKey(normalizedName, 'module');
codeUnit.metadata = this.defaultMetadata_(metadata);
this.cache.set(key, codeUnit);
this.handleCodeUnitLoaded(codeUnit);
return codeUnit.promise;
},
script: function(code, name, referrerName, address, metadata) {
var normalizedName = System.normalize(name || '', referrerName, address);
var codeUnit = new EvalCodeUnit(this.loaderCompiler, code, 'script', normalizedName, referrerName, address);
var key = {};
if (name)
key = this.getKey(normalizedName, 'script');
codeUnit.metadata = this.defaultMetadata_(metadata);
this.cache.set(key, codeUnit);
this.handleCodeUnitLoaded(codeUnit);
return codeUnit.promise;
},
getKey: function(url, type) {
var combined = type + ':' + url;
if (combined in this.urlToKey) {
return this.urlToKey[combined];
}
return this.urlToKey[combined] = {};
},
getCodeUnit_: function(normalizedName, type) {
var key = this.getKey(normalizedName, type);
var codeUnit = this.cache.get(key);
return {
key: key,
codeUnit: codeUnit
};
},
getOrCreateCodeUnit_: function(name, referrerName, address, metadata) {
var normalizedName = System.normalize(name, referrerName, address);
var type = 'module';
if (metadata && metadata.traceurOptions && metadata.traceurOptions.script)
type = 'script';
var $__8 = this.getCodeUnit_(normalizedName, type),
key = $__8.key,
codeUnit = $__8.codeUnit;
if (!codeUnit) {
assert(metadata && metadata.traceurOptions);
var module = this.loader_.get(normalizedName);
if (module) {
codeUnit = new PreCompiledCodeUnit(this.loaderCompiler, normalizedName, name, referrerName, address, module);
codeUnit.type = 'module';
} else {
var bundledModule = this.loader_.bundledModule(name);
if (bundledModule) {
codeUnit = new BundledCodeUnit(this.loaderCompiler, normalizedName, name, referrerName, address, bundledModule.deps, bundledModule.execute);
} else {
codeUnit = new LoadCodeUnit(this.loaderCompiler, normalizedName, name, referrerName, address);
codeUnit.type = type;
}
}
codeUnit.metadata = {
traceurOptions: metadata.traceurOptions,
outputName: metadata.outputName
};
this.cache.set(key, codeUnit);
}
return codeUnit;
},
areAll: function(state) {
return mapToValues(this.cache).every((function(codeUnit) {
return codeUnit.state >= state;
}));
},
getCodeUnitForModuleSpecifier: function(name, referrerName) {
var normalizedName = this.loader_.normalize(name, referrerName);
return this.getCodeUnit_(normalizedName, 'module').codeUnit;
},
getExportsListForModuleSpecifier: function(name, referrer) {
var codeUnit = this.getCodeUnitForModuleSpecifier(name, referrer);
var exportsList = codeUnit.metadata.moduleSymbol;
if (!exportsList) {
if (codeUnit.result) {
exportsList = new ExportsList(codeUnit.normalizedName);
exportsList.addExportsFromModule(codeUnit.result);
} else {
throw new Error(("InternalError: " + name + " is not a module, required by " + referrer));
}
}
return exportsList;
},
handleCodeUnitLoaded: function(codeUnit) {
var $__6 = this;
var referrerName = codeUnit.normalizedName;
try {
var moduleSpecifiers = codeUnit.getModuleSpecifiers();
if (!moduleSpecifiers) {
this.abortAll(("No module specifiers in " + referrerName));
return;
}
codeUnit.dependencies = moduleSpecifiers.sort().map((function(name) {
return $__6.getOrCreateCodeUnit_(name, referrerName, null, $__6.defaultModuleMetadata_(codeUnit.metadata));
}));
} catch (error) {
this.rejectOneAndAll(codeUnit, error);
return;
}
codeUnit.dependencies.forEach((function(dependency) {
$__6.load_(dependency);
}));
if (this.areAll(PARSED)) {
try {
this.analyze();
this.transform();
this.evaluate();
} catch (error) {
this.rejectOneAndAll(codeUnit, error);
}
}
},
rejectOneAndAll: function(codeUnit, error) {
codeUnit.state.ERROR;
codeUnit.error = error;
codeUnit.reject(error);
this.abortAll(error);
},
handleCodeUnitLoadError: function(codeUnit) {
var message = codeUnit.error ? String(codeUnit.error) + '\n' : ("Failed to load '" + codeUnit.address + "'.\n");
message += codeUnit.nameTrace() + this.loader_.nameTrace(codeUnit);
this.rejectOneAndAll(codeUnit, new Error(message));
},
abortAll: function(errorMessage) {
this.cache.forEach((function(codeUnit) {
if (codeUnit.state !== ERROR)
codeUnit.reject(errorMessage);
}));
},
analyze: function() {
this.loaderCompiler.analyzeDependencies(mapToValues(this.cache), this);
},
transform: function() {
this.transformDependencies_(mapToValues(this.cache));
},
transformDependencies_: function(dependencies, dependentName) {
for (var i = 0; i < dependencies.length; i++) {
var codeUnit = dependencies[i];
if (codeUnit.state >= TRANSFORMED) {
continue;
}
if (codeUnit.state === TRANSFORMING) {
var cir = codeUnit.normalizedName;
var cle = dependentName;
this.rejectOneAndAll(codeUnit, new Error(("Unsupported circular dependency between " + cir + " and " + cle)));
return;
}
codeUnit.state = TRANSFORMING;
try {
this.transformCodeUnit_(codeUnit);
} catch (error) {
this.rejectOneAndAll(codeUnit, error);
return;
}
}
},
transformCodeUnit_: function(codeUnit) {
this.transformDependencies_(codeUnit.dependencies, codeUnit.normalizedName);
if (codeUnit.state === ERROR)
return;
this.loaderCompiler.transform(codeUnit);
codeUnit.state = TRANSFORMED;
this.loaderCompiler.write(codeUnit);
var info = codeUnit.metadata.compiler.sourceMapInfo;
if (info) {
this.sourceMapsByURL_[info.url] = info.map;
}
this.loader_.instantiate(codeUnit);
},
orderDependencies: function() {
var visited = new Map();
var ordered = [];
function orderCodeUnits(codeUnit) {
if (visited.has(codeUnit)) {
return;
}
visited.set(codeUnit, true);
codeUnit.dependencies.forEach(orderCodeUnits);
ordered.push(codeUnit);
}
this.cache.forEach(orderCodeUnits);
return ordered;
},
evaluate: function() {
var dependencies = this.orderDependencies();
for (var i = 0; i < dependencies.length; i++) {
var codeUnit = dependencies[i];
if (codeUnit.state >= COMPLETE) {
continue;
}
var result;
try {
result = codeUnit.evaluate();
} catch (ex) {
this.rejectOneAndAll(codeUnit, ex);
return;
}
codeUnit.result = result;
codeUnit.source = null;
}
for (var i = 0; i < dependencies.length; i++) {
var codeUnit = dependencies[i];
if (codeUnit.state >= COMPLETE) {
continue;
}
codeUnit.state = COMPLETE;
codeUnit.resolve(codeUnit.result);
}
}
}, {});
var internals = {
CodeUnit: CodeUnit,
EvalCodeUnit: EvalCodeUnit,
LoadCodeUnit: LoadCodeUnit,
LoaderCompiler: LoaderCompiler
};
return {
get InternalLoader() {
return InternalLoader;
},
get internals() {
return internals;
}
};
});
System.register("traceur@0.0.74/src/runtime/Loader", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/runtime/Loader";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/runtime/Loader", path);
}
var InternalLoader = System.get("traceur@0.0.74/src/runtime/InternalLoader").InternalLoader;
function throwAbstractMethod() {
throw new Error('Unimplemented Loader function, see extended class');
}
var Loader = function Loader(loaderCompiler) {
this.internalLoader_ = new InternalLoader(this, loaderCompiler);
this.loaderCompiler_ = loaderCompiler;
};
($traceurRuntime.createClass)(Loader, {
import: function(name) {
var $__3 = arguments[1] !== (void 0) ? arguments[1] : {},
referrerName = $__3.referrerName,
address = $__3.address,
metadata = $__3.metadata;
var $__1 = this;
return this.internalLoader_.load(name, referrerName, address, metadata).then((function(codeUnit) {
return $__1.get(codeUnit.normalizedName);
}));
},
module: function(source) {
var $__3 = arguments[1] !== (void 0) ? arguments[1] : {},
referrerName = $__3.referrerName,
address = $__3.address,
metadata = $__3.metadata;
return this.internalLoader_.module(source, referrerName, address, metadata);
},
define: function(normalizedName, source) {
var $__3 = arguments[2] !== (void 0) ? arguments[2] : {},
address = $__3.address,
metadata = $__3.metadata,
metadata = $__3.metadata;
return this.internalLoader_.define(normalizedName, source, address, metadata);
},
get: function(normalizedName) {
throwAbstractMethod();
},
set: function(normalizedName, module) {
throwAbstractMethod();
},
normalize: function(name, referrerName, referrerAddress) {
throwAbstractMethod();
},
locate: function(load) {
throwAbstractMethod();
},
fetch: function(load) {
throwAbstractMethod();
},
translate: function(load) {
throwAbstractMethod();
},
instantiate: function(load) {
throwAbstractMethod();
}
}, {});
;
return {
get Loader() {
return Loader;
},
get LoaderCompiler() {
return LoaderCompiler;
}
};
});
System.register("traceur@0.0.74/src/runtime/TraceurLoader", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/runtime/TraceurLoader";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/runtime/TraceurLoader", path);
}
var $__0 = System.get("traceur@0.0.74/src/util/url"),
isAbsolute = $__0.isAbsolute,
resolveUrl = $__0.resolveUrl;
var Loader = System.get("traceur@0.0.74/src/runtime/Loader").Loader;
var LoaderCompiler = System.get("traceur@0.0.74/src/runtime/LoaderCompiler").LoaderCompiler;
var systemjs = System.get("traceur@0.0.74/src/runtime/system-map").systemjs;
var version = __moduleName.slice(0, __moduleName.indexOf('/'));
var uniqueNameCount = 0;
var TraceurLoader = function TraceurLoader(fileLoader, baseURL) {
var loaderCompiler = arguments[2] !== (void 0) ? arguments[2] : new LoaderCompiler();
$traceurRuntime.superConstructor($TraceurLoader).call(this, loaderCompiler);
this.fileLoader_ = fileLoader;
this.baseURL_ = baseURL && String(baseURL);
this.moduleStore_ = $traceurRuntime.ModuleStore;
};
var $TraceurLoader = TraceurLoader;
($traceurRuntime.createClass)(TraceurLoader, {
get baseURL() {
return this.baseURL_;
},
set baseURL(value) {
this.baseURL_ = String(value);
},
get: function(normalizedName) {
return this.moduleStore_.get(normalizedName);
},
set: function(normalizedName, module) {
this.moduleStore_.set(normalizedName, module);
},
normalize: function(name, referrerName, referrerAddress) {
var normalizedName = this.moduleStore_.normalize(name, referrerName, referrerAddress);
if (typeof systemjs !== 'undefined' && System.map)
return systemjs.applyMap(System.map, normalizedName, referrerName);
return normalizedName;
},
locate: function(load) {
var normalizedModuleName = load.normalizedName;
load.metadata.traceurOptions = load.metadata.traceurOptions || {};
var options = load.metadata.traceurOptions;
var asJS;
if (/\.js$/.test(normalizedModuleName) || options && options.script) {
asJS = normalizedModuleName;
} else {
asJS = normalizedModuleName + '.js';
}
var baseURL = load.metadata && load.metadata.baseURL;
baseURL = baseURL || this.baseURL;
var referrer = options && options.referrer;
if (referrer) {
var minChars = Math.min(referrer.length, baseURL.length);
var commonChars = 0;
for (var i = 0; i < minChars; i++) {
var aChar = referrer[referrer.length - 1 - i];
if (aChar === baseURL[baseURL.length - 1 - i])
commonChars++;
else
break;
}
if (commonChars) {
var packageName = referrer.slice(0, -commonChars);
var rootDirectory = baseURL.slice(0, -commonChars);
if (asJS.indexOf(packageName) === 0) {
asJS = asJS.replace(packageName, rootDirectory);
}
}
}
if (!isAbsolute(asJS)) {
if (baseURL) {
load.metadata.baseURL = baseURL;
asJS = resolveUrl(baseURL, asJS);
}
}
return asJS;
},
sourceName: function(load) {
var options = load.metadata.traceurOptions;
var sourceName = load.address;
if (options.sourceMaps) {
var sourceRoot = this.baseURL;
if (sourceName) {
if (sourceRoot && sourceName.indexOf(sourceRoot) === 0) {
sourceName = sourceName.substring(sourceRoot.length);
}
} else {
sourceName = this.baseURL + String(uniqueNameCount++);
}
}
load.metadata.sourceRoot = this.baseURL;
return sourceName;
},
nameTrace: function(load) {
var trace = '';
if (load.metadata.locateMap) {
trace += this.locateMapTrace(load);
}
var base = load.metadata.baseURL || this.baseURL;
if (base) {
trace += this.baseURLTrace(base);
} else {
trace += 'No baseURL\n';
}
return trace;
},
locateMapTrace: function(load) {
var map = load.metadata.locateMap;
return ("locate found \'" + map.pattern + "\' -> \'" + map.replacement + "\'\n");
},
baseURLTrace: function(base) {
return 'locate resolved against base \'' + base + '\'\n';
},
fetch: function(load) {
var $__4 = this;
return new Promise((function(resolve, reject) {
if (!load)
reject(new TypeError('fetch requires argument object'));
else if (!load.address || typeof load.address !== 'string')
reject(new TypeError('fetch({address}) missing required string.'));
else
$__4.fileLoader_.load(load.address, resolve, reject);
}));
},
translate: function(load) {
return load.source;
},
instantiate: function($__6) {
var $__7 = $__6,
name = $__7.name,
metadata = $__7.metadata,
address = $__7.address,
source = $__7.source,
sourceMap = $__7.sourceMap;
return new Promise((function(resolve, reject) {
resolve(undefined);
}));
},
bundledModule: function(name) {
return this.moduleStore_.bundleStore[name];
},
importAll: function(names) {
var $__6 = arguments[1] !== (void 0) ? arguments[1] : {},
referrerName = $__6.referrerName,
address = $__6.address,
metadata = $__6.metadata;
var $__4 = this;
return Promise.all(names.map((function(name) {
return $__4.import(name, {
referrerName: referrerName,
address: address,
metadata: metadata
});
})));
},
loadAsScript: function(name) {
var $__7;
var $__6 = arguments[1] !== (void 0) ? arguments[1] : {},
referrerName = $__6.referrerName,
address = $__6.address,
metadata = ($__7 = $__6.metadata) === void 0 ? {} : $__7;
metadata.traceurOptions = metadata.traceurOptions || {};
metadata.traceurOptions.script = true;
return this.internalLoader_.load(name, referrerName, address, metadata).then((function(load) {
return load.result;
}));
},
loadAsScriptAll: function(names) {
var $__6 = arguments[1] !== (void 0) ? arguments[1] : {},
referrerName = $__6.referrerName,
address = $__6.address,
metadata = $__6.metadata;
var $__4 = this;
return Promise.all(names.map((function(name) {
return $__4.loadAsScript(name, {
referrerName: referrerName,
address: address,
metadata: metadata
});
})));
},
script: function(source) {
var $__6 = arguments[1] !== (void 0) ? arguments[1] : {},
name = $__6.name,
referrerName = $__6.referrerName,
address = $__6.address,
metadata = $__6.metadata;
return this.internalLoader_.script(source, name, referrerName, address, metadata);
},
semVerRegExp_: function() {
return /^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$/;
},
semverMap: function(normalizedName) {
var slash = normalizedName.indexOf('/');
var version = normalizedName.slice(0, slash);
var at = version.indexOf('@');
if (at !== -1) {
var semver = version.slice(at + 1);
var m = this.semVerRegExp_().exec(semver);
if (m) {
var major = m[1];
var minor = m[2];
var packageName = version.slice(0, at);
var map = Object.create(null);
map[packageName] = version;
map[packageName + '@' + major] = version;
map[packageName + '@' + major + '.' + minor] = version;
}
}
return map;
},
get version() {
return version;
},
getSourceMap: function(filename) {
return this.internalLoader_.getSourceMap(filename);
},
register: function(normalizedName, deps, factoryFunction) {
$traceurRuntime.ModuleStore.register(normalizedName, deps, factoryFunction);
}
}, {}, Loader);
return {get TraceurLoader() {
return TraceurLoader;
}};
});
System.register("traceur@0.0.74/src/runtime/webLoader", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/runtime/webLoader";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/runtime/webLoader", path);
}
var webLoader = {load: function(url, callback, errback) {
var xhr = new XMLHttpRequest();
xhr.onload = (function() {
if (xhr.status == 200 || xhr.status == 0) {
callback(xhr.responseText);
} else {
var err;
if (xhr.status === 404)
err = 'File not found \'' + url + '\'';
else
err = xhr.status + xhr.statusText;
errback(err);
}
xhr = null;
});
xhr.onerror = (function(err) {
errback(err);
});
xhr.open('GET', url, true);
xhr.send();
return (function() {
xhr && xhr.abort();
});
}};
return {get webLoader() {
return webLoader;
}};
});
System.register("traceur@0.0.74/src/WebPageTranscoder", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/WebPageTranscoder";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/WebPageTranscoder", path);
}
var Loader = System.get("traceur@0.0.74/src/runtime/Loader").Loader;
var TraceurLoader = System.get("traceur@0.0.74/src/runtime/TraceurLoader").TraceurLoader;
var ErrorReporter = System.get("traceur@0.0.74/src/util/ErrorReporter").ErrorReporter;
var webLoader = System.get("traceur@0.0.74/src/runtime/webLoader").webLoader;
var WebPageTranscoder = function WebPageTranscoder(url) {
this.url = url;
this.numPending_ = 0;
this.numberInlined_ = 0;
};
($traceurRuntime.createClass)(WebPageTranscoder, {
asyncLoad_: function(url, fncOfContent, onScriptsReady) {
var $__4 = this;
this.numPending_++;
webLoader.load(url, (function(content) {
if (content)
fncOfContent(content);
else
console.warn('Failed to load', url);
if (--$__4.numPending_ <= 0)
onScriptsReady();
}), (function(error) {
console.error('WebPageTranscoder FAILED to load ' + url, error.stack || error);
}));
},
addFileFromScriptElement: function(scriptElement, name, content) {
var options = traceur.options;
var nameInfo = {
address: name,
referrerName: window.location.href,
name: name,
metadata: {traceurOptions: options}
};
var loadingResult;
if (scriptElement.type === 'module')
loadingResult = this.loader.module(content, nameInfo);
else
loadingResult = this.loader.script(content, nameInfo);
loadingResult.catch(function(error) {
console.error(error.stack || error);
});
},
nextInlineScriptName_: function() {
this.numberInlined_ += 1;
if (!this.inlineScriptNameBase_) {
var segments = this.url.split('.');
segments.pop();
this.inlineScriptNameBase_ = segments.join('.');
}
return this.inlineScriptNameBase_ + '_' + this.numberInlined_ + '.js';
},
addFilesFromScriptElements: function(scriptElements, onScriptsReady) {
for (var i = 0,
length = scriptElements.length; i < length; i++) {
var scriptElement = scriptElements[i];
if (!scriptElement.src) {
var name = this.nextInlineScriptName_();
var content = scriptElement.textContent;
this.addFileFromScriptElement(scriptElement, name, content);
} else {
var name = scriptElement.src;
this.asyncLoad_(name, this.addFileFromScriptElement.bind(this, scriptElement, name), onScriptsReady);
}
}
if (this.numPending_ <= 0)
onScriptsReady();
},
get reporter() {
if (!this.reporter_) {
this.reporter_ = new ErrorReporter();
}
return this.reporter_;
},
get loader() {
if (!this.loader_) {
this.loader_ = new TraceurLoader(webLoader, this.url);
}
return this.loader_;
},
putFile: function(file) {
var scriptElement = document.createElement('script');
scriptElement.setAttribute('data-traceur-src-url', file.name);
scriptElement.textContent = file.generatedSource;
var parent = file.scriptElement.parentNode;
parent.insertBefore(scriptElement, file.scriptElement || null);
},
selectAndProcessScripts: function(done) {
var selector = 'script[type="module"],script[type="text/traceur"]';
var scripts = document.querySelectorAll(selector);
if (!scripts.length) {
done();
return;
}
this.addFilesFromScriptElements(scripts, (function() {
done();
}));
},
run: function() {
var done = arguments[0] !== (void 0) ? arguments[0] : (function() {});
var $__4 = this;
var ready = document.readyState;
if (ready === 'complete' || ready === 'loaded') {
this.selectAndProcessScripts(done);
} else {
document.addEventListener('DOMContentLoaded', (function() {
return $__4.selectAndProcessScripts(done);
}), false);
}
}
}, {});
return {get WebPageTranscoder() {
return WebPageTranscoder;
}};
});
System.register("traceur@0.0.74/src/codegeneration/CloneTreeTransformer", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/CloneTreeTransformer";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/CloneTreeTransformer", path);
}
var ParseTreeTransformer = System.get("traceur@0.0.74/src/codegeneration/ParseTreeTransformer").ParseTreeTransformer;
var $__1 = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees"),
BindingIdentifier = $__1.BindingIdentifier,
BreakStatement = $__1.BreakStatement,
ContinueStatement = $__1.ContinueStatement,
DebuggerStatement = $__1.DebuggerStatement,
EmptyStatement = $__1.EmptyStatement,
ExportSpecifier = $__1.ExportSpecifier,
ExportStar = $__1.ExportStar,
IdentifierExpression = $__1.IdentifierExpression,
LiteralExpression = $__1.LiteralExpression,
ModuleSpecifier = $__1.ModuleSpecifier,
PredefinedType = $__1.PredefinedType,
PropertyNameShorthand = $__1.PropertyNameShorthand,
TemplateLiteralPortion = $__1.TemplateLiteralPortion,
SuperExpression = $__1.SuperExpression,
ThisExpression = $__1.ThisExpression;
var CloneTreeTransformer = function CloneTreeTransformer() {
$traceurRuntime.superConstructor($CloneTreeTransformer).apply(this, arguments);
};
var $CloneTreeTransformer = CloneTreeTransformer;
($traceurRuntime.createClass)(CloneTreeTransformer, {
transformBindingIdentifier: function(tree) {
return new BindingIdentifier(tree.location, tree.identifierToken);
},
transformBreakStatement: function(tree) {
return new BreakStatement(tree.location, tree.name);
},
transformContinueStatement: function(tree) {
return new ContinueStatement(tree.location, tree.name);
},
transformDebuggerStatement: function(tree) {
return new DebuggerStatement(tree.location);
},
transformEmptyStatement: function(tree) {
return new EmptyStatement(tree.location);
},
transformExportSpecifier: function(tree) {
return new ExportSpecifier(tree.location, tree.lhs, tree.rhs);
},
transformExportStar: function(tree) {
return new ExportStar(tree.location);
},
transformIdentifierExpression: function(tree) {
return new IdentifierExpression(tree.location, tree.identifierToken);
},
transformList: function(list) {
if (!list) {
return null;
} else if (list.length == 0) {
return [];
} else {
return $traceurRuntime.superGet(this, $CloneTreeTransformer.prototype, "transformList").call(this, list);
}
},
transformLiteralExpression: function(tree) {
return new LiteralExpression(tree.location, tree.literalToken);
},
transformModuleSpecifier: function(tree) {
return new ModuleSpecifier(tree.location, tree.token);
},
transformPredefinedType: function(tree) {
return new PredefinedType(tree.location, tree.typeToken);
},
transformPropertyNameShorthand: function(tree) {
return new PropertyNameShorthand(tree.location, tree.name);
},
transformTemplateLiteralPortion: function(tree) {
return new TemplateLiteralPortion(tree.location, tree.value);
},
transformSuperExpression: function(tree) {
return new SuperExpression(tree.location);
},
transformThisExpression: function(tree) {
return new ThisExpression(tree.location);
}
}, {}, ParseTreeTransformer);
CloneTreeTransformer.cloneTree = function(tree) {
return new CloneTreeTransformer().transformAny(tree);
};
return {get CloneTreeTransformer() {
return CloneTreeTransformer;
}};
});
System.register("traceur@0.0.74/src/codegeneration/module/createModuleEvaluationStatement", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/codegeneration/module/createModuleEvaluationStatement";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/codegeneration/module/createModuleEvaluationStatement", path);
}
var $__0 = Object.freeze(Object.defineProperties(["System.get(", " +'')"], {raw: {value: Object.freeze(["System.get(", " +'')"])}}));
var parseStatement = System.get("traceur@0.0.74/src/codegeneration/PlaceholderParser").parseStatement;
function createModuleEvaluationStatement(normalizedName) {
return parseStatement($__0, normalizedName);
}
return {get createModuleEvaluationStatement() {
return createModuleEvaluationStatement;
}};
});
System.register("traceur@0.0.74/src/runtime/InlineLoaderCompiler", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/runtime/InlineLoaderCompiler";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/runtime/InlineLoaderCompiler", path);
}
var LoaderCompiler = System.get("traceur@0.0.74/src/runtime/LoaderCompiler").LoaderCompiler;
var Script = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees").Script;
var InlineLoaderCompiler = function InlineLoaderCompiler(elements) {
$traceurRuntime.superConstructor($InlineLoaderCompiler).call(this);
this.elements = elements;
};
var $InlineLoaderCompiler = InlineLoaderCompiler;
($traceurRuntime.createClass)(InlineLoaderCompiler, {
evaluateCodeUnit: function(codeUnit) {
var $__3;
var tree = codeUnit.metadata.transformedTree;
($__3 = this.elements).push.apply($__3, $traceurRuntime.spread(tree.scriptItemList));
},
toTree: function() {
return new Script(null, this.elements);
}
}, {}, LoaderCompiler);
return {get InlineLoaderCompiler() {
return InlineLoaderCompiler;
}};
});
System.register("traceur@0.0.74/src/runtime/System", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/runtime/System";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/runtime/System", path);
}
var ErrorReporter = System.get("traceur@0.0.74/src/util/ErrorReporter").ErrorReporter;
var TraceurLoader = System.get("traceur@0.0.74/src/runtime/TraceurLoader").TraceurLoader;
var LoaderCompiler = System.get("traceur@0.0.74/src/runtime/LoaderCompiler").LoaderCompiler;
var webLoader = System.get("traceur@0.0.74/src/runtime/webLoader").webLoader;
var url;
var fileLoader;
if (typeof window !== 'undefined' && window.location) {
url = window.location.href;
fileLoader = webLoader;
}
var traceurLoader = new TraceurLoader(fileLoader, url);
Reflect.global.System = traceurLoader;
;
traceurLoader.map = traceurLoader.semverMap(__moduleName);
return {get System() {
return traceurLoader;
}};
});
System.register("traceur@0.0.74/src/util/MutedErrorReporter", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/util/MutedErrorReporter";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/util/MutedErrorReporter", path);
}
var ErrorReporter = System.get("traceur@0.0.74/src/util/ErrorReporter").ErrorReporter;
var MutedErrorReporter = function MutedErrorReporter() {
$traceurRuntime.superConstructor($MutedErrorReporter).apply(this, arguments);
};
var $MutedErrorReporter = MutedErrorReporter;
($traceurRuntime.createClass)(MutedErrorReporter, {reportMessageInternal: function(location, format, args) {}}, {}, ErrorReporter);
return {get MutedErrorReporter() {
return MutedErrorReporter;
}};
});
System.register("traceur@0.0.74/src/traceur", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/traceur";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/traceur", path);
}
var $__traceur_64_0_46_0_46_74_47_src_47_runtime_47_System__ = System.get("traceur@0.0.74/src/runtime/System");
System.get("traceur@0.0.74/src/util/MutedErrorReporter");
var $___64_traceur_47_src_47_runtime_47_ModuleStore__ = System.get("@traceur/src/runtime/ModuleStore");
var $__traceur_64_0_46_0_46_74_47_src_47_WebPageTranscoder__ = System.get("traceur@0.0.74/src/WebPageTranscoder");
var $__traceur_64_0_46_0_46_74_47_src_47_Options__ = System.get("traceur@0.0.74/src/Options");
var $__0 = System.get("traceur@0.0.74/src/Options"),
addOptions = $__0.addOptions,
CommandOptions = $__0.CommandOptions,
Options = $__0.Options;
var ModuleStore = System.get("@traceur/src/runtime/ModuleStore").ModuleStore;
function get(name) {
return ModuleStore.get(ModuleStore.normalize('./' + name, __moduleName));
}
var $__traceur_64_0_46_0_46_74_47_src_47_Compiler__ = System.get("traceur@0.0.74/src/Compiler");
var ErrorReporter = System.get("traceur@0.0.74/src/util/ErrorReporter").ErrorReporter;
var CollectingErrorReporter = System.get("traceur@0.0.74/src/util/CollectingErrorReporter").CollectingErrorReporter;
var util = {
addOptions: addOptions,
CommandOptions: CommandOptions,
CollectingErrorReporter: CollectingErrorReporter,
ErrorReporter: ErrorReporter,
Options: Options
};
var Parser = System.get("traceur@0.0.74/src/syntax/Parser").Parser;
var Scanner = System.get("traceur@0.0.74/src/syntax/Scanner").Scanner;
var Script = System.get("traceur@0.0.74/src/syntax/trees/ParseTrees").Script;
var SourceFile = System.get("traceur@0.0.74/src/syntax/SourceFile").SourceFile;
var syntax = {
Parser: Parser,
Scanner: Scanner,
SourceFile: SourceFile,
trees: {Script: Script}
};
var ParseTreeMapWriter = System.get("traceur@0.0.74/src/outputgeneration/ParseTreeMapWriter").ParseTreeMapWriter;
var ParseTreeWriter = System.get("traceur@0.0.74/src/outputgeneration/ParseTreeWriter").ParseTreeWriter;
var regexpuRewritePattern = System.get("traceur@0.0.74/src/outputgeneration/regexpuRewritePattern").regexpuRewritePattern;
var SourceMapConsumer = System.get("traceur@0.0.74/src/outputgeneration/SourceMapIntegration").SourceMapConsumer;
var SourceMapGenerator = System.get("traceur@0.0.74/src/outputgeneration/SourceMapIntegration").SourceMapGenerator;
var TreeWriter = System.get("traceur@0.0.74/src/outputgeneration/TreeWriter").TreeWriter;
var outputgeneration = {
ParseTreeMapWriter: ParseTreeMapWriter,
ParseTreeWriter: ParseTreeWriter,
regexpuRewritePattern: regexpuRewritePattern,
SourceMapConsumer: SourceMapConsumer,
SourceMapGenerator: SourceMapGenerator,
TreeWriter: TreeWriter
};
var AttachModuleNameTransformer = System.get("traceur@0.0.74/src/codegeneration/module/AttachModuleNameTransformer").AttachModuleNameTransformer;
var CloneTreeTransformer = System.get("traceur@0.0.74/src/codegeneration/CloneTreeTransformer").CloneTreeTransformer;
var FromOptionsTransformer = System.get("traceur@0.0.74/src/codegeneration/FromOptionsTransformer").FromOptionsTransformer;
var PureES6Transformer = System.get("traceur@0.0.74/src/codegeneration/PureES6Transformer").PureES6Transformer;
var createModuleEvaluationStatement = System.get("traceur@0.0.74/src/codegeneration/module/createModuleEvaluationStatement").createModuleEvaluationStatement;
var $__19 = System.get("traceur@0.0.74/src/codegeneration/PlaceholderParser"),
parseExpression = $__19.parseExpression,
parseModule = $__19.parseModule,
parseScript = $__19.parseScript,
parseStatement = $__19.parseStatement;
var codegeneration = {
CloneTreeTransformer: CloneTreeTransformer,
FromOptionsTransformer: FromOptionsTransformer,
PureES6Transformer: PureES6Transformer,
parseExpression: parseExpression,
parseModule: parseModule,
parseScript: parseScript,
parseStatement: parseStatement,
module: {
AttachModuleNameTransformer: AttachModuleNameTransformer,
createModuleEvaluationStatement: createModuleEvaluationStatement
}
};
var Loader = System.get("traceur@0.0.74/src/runtime/Loader").Loader;
var LoaderCompiler = System.get("traceur@0.0.74/src/runtime/LoaderCompiler").LoaderCompiler;
var InlineLoaderCompiler = System.get("traceur@0.0.74/src/runtime/InlineLoaderCompiler").InlineLoaderCompiler;
var TraceurLoader = System.get("traceur@0.0.74/src/runtime/TraceurLoader").TraceurLoader;
var runtime = {
InlineLoaderCompiler: InlineLoaderCompiler,
Loader: Loader,
LoaderCompiler: LoaderCompiler,
TraceurLoader: TraceurLoader
};
return {
get System() {
return $__traceur_64_0_46_0_46_74_47_src_47_runtime_47_System__.System;
},
get ModuleStore() {
return $___64_traceur_47_src_47_runtime_47_ModuleStore__.ModuleStore;
},
get WebPageTranscoder() {
return $__traceur_64_0_46_0_46_74_47_src_47_WebPageTranscoder__.WebPageTranscoder;
},
get options() {
return $__traceur_64_0_46_0_46_74_47_src_47_Options__.options;
},
get get() {
return get;
},
get Compiler() {
return $__traceur_64_0_46_0_46_74_47_src_47_Compiler__.Compiler;
},
get util() {
return util;
},
get syntax() {
return syntax;
},
get outputgeneration() {
return outputgeneration;
},
get codegeneration() {
return codegeneration;
},
get runtime() {
return runtime;
}
};
});
System.register("traceur@0.0.74/src/traceur-import", [], function() {
"use strict";
var __moduleName = "traceur@0.0.74/src/traceur-import";
function require(path) {
return $traceurRuntime.require("traceur@0.0.74/src/traceur-import", path);
}
var traceur = System.get("traceur@0.0.74/src/traceur");
Reflect.global.traceur = traceur;
$traceurRuntime.ModuleStore.set('traceur@', traceur);
return {};
});
System.get("traceur@0.0.74/src/traceur-import" + '');
================================================
FILE: client/components/traceur-runtime/.bower.json
================================================
{
"name": "traceur-runtime",
"version": "0.0.74",
"main": "./traceur-runtime.js",
"ignore": [
"node_modules",
"Gruntfile.js",
"*.json",
".*"
],
"homepage": "https://github.com/jmcriffey/bower-traceur-runtime",
"_release": "0.0.74",
"_resolution": {
"type": "version",
"tag": "0.0.74",
"commit": "92f0c9d338a1c8e999f5b43b1d37c5da9635e359"
},
"_source": "git://github.com/jmcriffey/bower-traceur-runtime.git",
"_target": "0.0.74",
"_originalSource": "traceur-runtime"
}
================================================
FILE: client/components/traceur-runtime/README.md
================================================
# bower-traceur-runtime
This repo is for distribution on `bower`. The source for this module is in the
[main traceur repo](https://github.com/google/traceur-compiler/).
Please file issues and pull requests against that repo.
## Install
Install with `bower`:
```shell
bower install traceur-runtime
```
Add a `
```
## License
Copyright 2012 Traceur Authors.
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.
================================================
FILE: client/components/traceur-runtime/bower.json
================================================
{
"name": "traceur-runtime",
"version": "0.0.74",
"main": "./traceur-runtime.js",
"ignore": [
"node_modules",
"Gruntfile.js",
"*.json",
".*"
]
}
================================================
FILE: client/components/traceur-runtime/traceur-runtime.js
================================================
(function(global) {
'use strict';
if (global.$traceurRuntime) {
return;
}
var $Object = Object;
var $TypeError = TypeError;
var $create = $Object.create;
var $defineProperties = $Object.defineProperties;
var $defineProperty = $Object.defineProperty;
var $freeze = $Object.freeze;
var $getOwnPropertyDescriptor = $Object.getOwnPropertyDescriptor;
var $getOwnPropertyNames = $Object.getOwnPropertyNames;
var $keys = $Object.keys;
var $hasOwnProperty = $Object.prototype.hasOwnProperty;
var $toString = $Object.prototype.toString;
var $preventExtensions = Object.preventExtensions;
var $seal = Object.seal;
var $isExtensible = Object.isExtensible;
function nonEnum(value) {
return {
configurable: true,
enumerable: false,
value: value,
writable: true
};
}
var method = nonEnum;
var counter = 0;
function newUniqueString() {
return '__$' + Math.floor(Math.random() * 1e9) + '$' + ++counter + '$__';
}
var symbolInternalProperty = newUniqueString();
var symbolDescriptionProperty = newUniqueString();
var symbolDataProperty = newUniqueString();
var symbolValues = $create(null);
var privateNames = $create(null);
function isPrivateName(s) {
return privateNames[s];
}
function createPrivateName() {
var s = newUniqueString();
privateNames[s] = true;
return s;
}
function isShimSymbol(symbol) {
return typeof symbol === 'object' && symbol instanceof SymbolValue;
}
function typeOf(v) {
if (isShimSymbol(v))
return 'symbol';
return typeof v;
}
function Symbol(description) {
var value = new SymbolValue(description);
if (!(this instanceof Symbol))
return value;
throw new TypeError('Symbol cannot be new\'ed');
}
$defineProperty(Symbol.prototype, 'constructor', nonEnum(Symbol));
$defineProperty(Symbol.prototype, 'toString', method(function() {
var symbolValue = this[symbolDataProperty];
if (!getOption('symbols'))
return symbolValue[symbolInternalProperty];
if (!symbolValue)
throw TypeError('Conversion from symbol to string');
var desc = symbolValue[symbolDescriptionProperty];
if (desc === undefined)
desc = '';
return 'Symbol(' + desc + ')';
}));
$defineProperty(Symbol.prototype, 'valueOf', method(function() {
var symbolValue = this[symbolDataProperty];
if (!symbolValue)
throw TypeError('Conversion from symbol to string');
if (!getOption('symbols'))
return symbolValue[symbolInternalProperty];
return symbolValue;
}));
function SymbolValue(description) {
var key = newUniqueString();
$defineProperty(this, symbolDataProperty, {value: this});
$defineProperty(this, symbolInternalProperty, {value: key});
$defineProperty(this, symbolDescriptionProperty, {value: description});
freeze(this);
symbolValues[key] = this;
}
$defineProperty(SymbolValue.prototype, 'constructor', nonEnum(Symbol));
$defineProperty(SymbolValue.prototype, 'toString', {
value: Symbol.prototype.toString,
enumerable: false
});
$defineProperty(SymbolValue.prototype, 'valueOf', {
value: Symbol.prototype.valueOf,
enumerable: false
});
var hashProperty = createPrivateName();
var hashPropertyDescriptor = {value: undefined};
var hashObjectProperties = {
hash: {value: undefined},
self: {value: undefined}
};
var hashCounter = 0;
function getOwnHashObject(object) {
var hashObject = object[hashProperty];
if (hashObject && hashObject.self === object)
return hashObject;
if ($isExtensible(object)) {
hashObjectProperties.hash.value = hashCounter++;
hashObjectProperties.self.value = object;
hashPropertyDescriptor.value = $create(null, hashObjectProperties);
$defineProperty(object, hashProperty, hashPropertyDescriptor);
return hashPropertyDescriptor.value;
}
return undefined;
}
function freeze(object) {
getOwnHashObject(object);
return $freeze.apply(this, arguments);
}
function preventExtensions(object) {
getOwnHashObject(object);
return $preventExtensions.apply(this, arguments);
}
function seal(object) {
getOwnHashObject(object);
return $seal.apply(this, arguments);
}
freeze(SymbolValue.prototype);
function isSymbolString(s) {
return symbolValues[s] || privateNames[s];
}
function toProperty(name) {
if (isShimSymbol(name))
return name[symbolInternalProperty];
return name;
}
function removeSymbolKeys(array) {
var rv = [];
for (var i = 0; i < array.length; i++) {
if (!isSymbolString(array[i])) {
rv.push(array[i]);
}
}
return rv;
}
function getOwnPropertyNames(object) {
return removeSymbolKeys($getOwnPropertyNames(object));
}
function keys(object) {
return removeSymbolKeys($keys(object));
}
function getOwnPropertySymbols(object) {
var rv = [];
var names = $getOwnPropertyNames(object);
for (var i = 0; i < names.length; i++) {
var symbol = symbolValues[names[i]];
if (symbol) {
rv.push(symbol);
}
}
return rv;
}
function getOwnPropertyDescriptor(object, name) {
return $getOwnPropertyDescriptor(object, toProperty(name));
}
function hasOwnProperty(name) {
return $hasOwnProperty.call(this, toProperty(name));
}
function getOption(name) {
return global.traceur && global.traceur.options[name];
}
function defineProperty(object, name, descriptor) {
if (isShimSymbol(name)) {
name = name[symbolInternalProperty];
}
$defineProperty(object, name, descriptor);
return object;
}
function polyfillObject(Object) {
$defineProperty(Object, 'defineProperty', {value: defineProperty});
$defineProperty(Object, 'getOwnPropertyNames', {value: getOwnPropertyNames});
$defineProperty(Object, 'getOwnPropertyDescriptor', {value: getOwnPropertyDescriptor});
$defineProperty(Object.prototype, 'hasOwnProperty', {value: hasOwnProperty});
$defineProperty(Object, 'freeze', {value: freeze});
$defineProperty(Object, 'preventExtensions', {value: preventExtensions});
$defineProperty(Object, 'seal', {value: seal});
$defineProperty(Object, 'keys', {value: keys});
}
function exportStar(object) {
for (var i = 1; i < arguments.length; i++) {
var names = $getOwnPropertyNames(arguments[i]);
for (var j = 0; j < names.length; j++) {
var name = names[j];
if (isSymbolString(name))
continue;
(function(mod, name) {
$defineProperty(object, name, {
get: function() {
return mod[name];
},
enumerable: true
});
})(arguments[i], names[j]);
}
}
return object;
}
function isObject(x) {
return x != null && (typeof x === 'object' || typeof x === 'function');
}
function toObject(x) {
if (x == null)
throw $TypeError();
return $Object(x);
}
function checkObjectCoercible(argument) {
if (argument == null) {
throw new TypeError('Value cannot be converted to an Object');
}
return argument;
}
var path = typeof require !== 'undefined' && require('path');
function relativeRequire(callerPath, requiredPath) {
function isDirectory(path) {
return (path.slice(-1) === '/');
}
function isAbsolute(path) {
return (path.charAt(0) === '/');
}
function isRelative(path) {
return (path.charAt(0) === '.');
}
if (isDirectory(requiredPath) || isAbsolute(requiredPath))
return;
return isRelative(requiredPath) ? require(path.resolve(path.dirname(callerPath), requiredPath)) : require(requiredPath);
}
function polyfillSymbol(global, Symbol) {
if (!global.Symbol) {
global.Symbol = Symbol;
Object.getOwnPropertySymbols = getOwnPropertySymbols;
}
if (!global.Symbol.iterator) {
global.Symbol.iterator = Symbol('Symbol.iterator');
}
}
function setupGlobals(global) {
polyfillSymbol(global, Symbol);
global.Reflect = global.Reflect || {};
global.Reflect.global = global.Reflect.global || global;
polyfillObject(global.Object);
}
setupGlobals(global);
global.$traceurRuntime = {
checkObjectCoercible: checkObjectCoercible,
createPrivateName: createPrivateName,
defineProperties: $defineProperties,
defineProperty: $defineProperty,
exportStar: exportStar,
getOwnHashObject: getOwnHashObject,
getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
getOwnPropertyNames: $getOwnPropertyNames,
isObject: isObject,
isPrivateName: isPrivateName,
isSymbolString: isSymbolString,
keys: $keys,
setupGlobals: setupGlobals,
require: relativeRequire,
toObject: toObject,
toProperty: toProperty,
typeof: typeOf
};
})(typeof global !== 'undefined' ? global : this);
(function() {
'use strict';
var path = typeof require !== 'undefined' && require('path');
function relativeRequire(callerPath, requiredPath) {
function isDirectory(path) {
return path.slice(-1) === '/';
}
function isAbsolute(path) {
return path[0] === '/';
}
function isRelative(path) {
return path[0] === '.';
}
if (isDirectory(requiredPath) || isAbsolute(requiredPath))
return;
return isRelative(requiredPath) ? require(path.resolve(path.dirname(callerPath), requiredPath)) : require(requiredPath);
}
$traceurRuntime.require = relativeRequire;
})();
(function() {
'use strict';
function spread() {
var rv = [],
j = 0,
iterResult;
for (var i = 0; i < arguments.length; i++) {
var valueToSpread = $traceurRuntime.checkObjectCoercible(arguments[i]);
if (typeof valueToSpread[$traceurRuntime.toProperty(Symbol.iterator)] !== 'function') {
throw new TypeError('Cannot spread non-iterable object.');
}
var iter = valueToSpread[$traceurRuntime.toProperty(Symbol.iterator)]();
while (!(iterResult = iter.next()).done) {
rv[j++] = iterResult.value;
}
}
return rv;
}
$traceurRuntime.spread = spread;
})();
(function() {
'use strict';
var $Object = Object;
var $TypeError = TypeError;
var $create = $Object.create;
var $defineProperties = $traceurRuntime.defineProperties;
var $defineProperty = $traceurRuntime.defineProperty;
var $getOwnPropertyDescriptor = $traceurRuntime.getOwnPropertyDescriptor;
var $getOwnPropertyNames = $traceurRuntime.getOwnPropertyNames;
var $getPrototypeOf = Object.getPrototypeOf;
var $__0 = Object,
getOwnPropertyNames = $__0.getOwnPropertyNames,
getOwnPropertySymbols = $__0.getOwnPropertySymbols;
function superDescriptor(homeObject, name) {
var proto = $getPrototypeOf(homeObject);
do {
var result = $getOwnPropertyDescriptor(proto, name);
if (result)
return result;
proto = $getPrototypeOf(proto);
} while (proto);
return undefined;
}
function superConstructor(ctor) {
return ctor.__proto__;
}
function superCall(self, homeObject, name, args) {
return superGet(self, homeObject, name).apply(self, args);
}
function superGet(self, homeObject, name) {
var descriptor = superDescriptor(homeObject, name);
if (descriptor) {
if (!descriptor.get)
return descriptor.value;
return descriptor.get.call(self);
}
return undefined;
}
function superSet(self, homeObject, name, value) {
var descriptor = superDescriptor(homeObject, name);
if (descriptor && descriptor.set) {
descriptor.set.call(self, value);
return value;
}
throw $TypeError(("super has no setter '" + name + "'."));
}
function getDescriptors(object) {
var descriptors = {};
var names = getOwnPropertyNames(object);
for (var i = 0; i < names.length; i++) {
var name = names[i];
descriptors[name] = $getOwnPropertyDescriptor(object, name);
}
var symbols = getOwnPropertySymbols(object);
for (var i = 0; i < symbols.length; i++) {
var symbol = symbols[i];
descriptors[$traceurRuntime.toProperty(symbol)] = $getOwnPropertyDescriptor(object, $traceurRuntime.toProperty(symbol));
}
return descriptors;
}
function createClass(ctor, object, staticObject, superClass) {
$defineProperty(object, 'constructor', {
value: ctor,
configurable: true,
enumerable: false,
writable: true
});
if (arguments.length > 3) {
if (typeof superClass === 'function')
ctor.__proto__ = superClass;
ctor.prototype = $create(getProtoParent(superClass), getDescriptors(object));
} else {
ctor.prototype = object;
}
$defineProperty(ctor, 'prototype', {
configurable: false,
writable: false
});
return $defineProperties(ctor, getDescriptors(staticObject));
}
function getProtoParent(superClass) {
if (typeof superClass === 'function') {
var prototype = superClass.prototype;
if ($Object(prototype) === prototype || prototype === null)
return superClass.prototype;
throw new $TypeError('super prototype must be an Object or null');
}
if (superClass === null)
return null;
throw new $TypeError(("Super expression must either be null or a function, not " + typeof superClass + "."));
}
function defaultSuperCall(self, homeObject, args) {
if ($getPrototypeOf(homeObject) !== null)
superCall(self, homeObject, 'constructor', args);
}
$traceurRuntime.createClass = createClass;
$traceurRuntime.defaultSuperCall = defaultSuperCall;
$traceurRuntime.superCall = superCall;
$traceurRuntime.superConstructor = superConstructor;
$traceurRuntime.superGet = superGet;
$traceurRuntime.superSet = superSet;
})();
(function() {
'use strict';
var createPrivateName = $traceurRuntime.createPrivateName;
var $defineProperties = $traceurRuntime.defineProperties;
var $defineProperty = $traceurRuntime.defineProperty;
var $create = Object.create;
var $TypeError = TypeError;
function nonEnum(value) {
return {
configurable: true,
enumerable: false,
value: value,
writable: true
};
}
var ST_NEWBORN = 0;
var ST_EXECUTING = 1;
var ST_SUSPENDED = 2;
var ST_CLOSED = 3;
var END_STATE = -2;
var RETHROW_STATE = -3;
function getInternalError(state) {
return new Error('Traceur compiler bug: invalid state in state machine: ' + state);
}
function GeneratorContext() {
this.state = 0;
this.GState = ST_NEWBORN;
this.storedException = undefined;
this.finallyFallThrough = undefined;
this.sent_ = undefined;
this.returnValue = undefined;
this.tryStack_ = [];
}
GeneratorContext.prototype = {
pushTry: function(catchState, finallyState) {
if (finallyState !== null) {
var finallyFallThrough = null;
for (var i = this.tryStack_.length - 1; i >= 0; i--) {
if (this.tryStack_[i].catch !== undefined) {
finallyFallThrough = this.tryStack_[i].catch;
break;
}
}
if (finallyFallThrough === null)
finallyFallThrough = RETHROW_STATE;
this.tryStack_.push({
finally: finallyState,
finallyFallThrough: finallyFallThrough
});
}
if (catchState !== null) {
this.tryStack_.push({catch: catchState});
}
},
popTry: function() {
this.tryStack_.pop();
},
get sent() {
this.maybeThrow();
return this.sent_;
},
set sent(v) {
this.sent_ = v;
},
get sentIgnoreThrow() {
return this.sent_;
},
maybeThrow: function() {
if (this.action === 'throw') {
this.action = 'next';
throw this.sent_;
}
},
end: function() {
switch (this.state) {
case END_STATE:
return this;
case RETHROW_STATE:
throw this.storedException;
default:
throw getInternalError(this.state);
}
},
handleException: function(ex) {
this.GState = ST_CLOSED;
this.state = END_STATE;
throw ex;
}
};
function nextOrThrow(ctx, moveNext, action, x) {
switch (ctx.GState) {
case ST_EXECUTING:
throw new Error(("\"" + action + "\" on executing generator"));
case ST_CLOSED:
if (action == 'next') {
return {
value: undefined,
done: true
};
}
throw x;
case ST_NEWBORN:
if (action === 'throw') {
ctx.GState = ST_CLOSED;
throw x;
}
if (x !== undefined)
throw $TypeError('Sent value to newborn generator');
case ST_SUSPENDED:
ctx.GState = ST_EXECUTING;
ctx.action = action;
ctx.sent = x;
var value = moveNext(ctx);
var done = value === ctx;
if (done)
value = ctx.returnValue;
ctx.GState = done ? ST_CLOSED : ST_SUSPENDED;
return {
value: value,
done: done
};
}
}
var ctxName = createPrivateName();
var moveNextName = createPrivateName();
function GeneratorFunction() {}
function GeneratorFunctionPrototype() {}
GeneratorFunction.prototype = GeneratorFunctionPrototype;
$defineProperty(GeneratorFunctionPrototype, 'constructor', nonEnum(GeneratorFunction));
GeneratorFunctionPrototype.prototype = {
constructor: GeneratorFunctionPrototype,
next: function(v) {
return nextOrThrow(this[ctxName], this[moveNextName], 'next', v);
},
throw: function(v) {
return nextOrThrow(this[ctxName], this[moveNextName], 'throw', v);
}
};
$defineProperties(GeneratorFunctionPrototype.prototype, {
constructor: {enumerable: false},
next: {enumerable: false},
throw: {enumerable: false}
});
Object.defineProperty(GeneratorFunctionPrototype.prototype, Symbol.iterator, nonEnum(function() {
return this;
}));
function createGeneratorInstance(innerFunction, functionObject, self) {
var moveNext = getMoveNext(innerFunction, self);
var ctx = new GeneratorContext();
var object = $create(functionObject.prototype);
object[ctxName] = ctx;
object[moveNextName] = moveNext;
return object;
}
function initGeneratorFunction(functionObject) {
functionObject.prototype = $create(GeneratorFunctionPrototype.prototype);
functionObject.__proto__ = GeneratorFunctionPrototype;
return functionObject;
}
function AsyncFunctionContext() {
GeneratorContext.call(this);
this.err = undefined;
var ctx = this;
ctx.result = new Promise(function(resolve, reject) {
ctx.resolve = resolve;
ctx.reject = reject;
});
}
AsyncFunctionContext.prototype = $create(GeneratorContext.prototype);
AsyncFunctionContext.prototype.end = function() {
switch (this.state) {
case END_STATE:
this.resolve(this.returnValue);
break;
case RETHROW_STATE:
this.reject(this.storedException);
break;
default:
this.reject(getInternalError(this.state));
}
};
AsyncFunctionContext.prototype.handleException = function() {
this.state = RETHROW_STATE;
};
function asyncWrap(innerFunction, self) {
var moveNext = getMoveNext(innerFunction, self);
var ctx = new AsyncFunctionContext();
ctx.createCallback = function(newState) {
return function(value) {
ctx.state = newState;
ctx.value = value;
moveNext(ctx);
};
};
ctx.errback = function(err) {
handleCatch(ctx, err);
moveNext(ctx);
};
moveNext(ctx);
return ctx.result;
}
function getMoveNext(innerFunction, self) {
return function(ctx) {
while (true) {
try {
return innerFunction.call(self, ctx);
} catch (ex) {
handleCatch(ctx, ex);
}
}
};
}
function handleCatch(ctx, ex) {
ctx.storedException = ex;
var last = ctx.tryStack_[ctx.tryStack_.length - 1];
if (!last) {
ctx.handleException(ex);
return;
}
ctx.state = last.catch !== undefined ? last.catch : last.finally;
if (last.finallyFallThrough !== undefined)
ctx.finallyFallThrough = last.finallyFallThrough;
}
$traceurRuntime.asyncWrap = asyncWrap;
$traceurRuntime.initGeneratorFunction = initGeneratorFunction;
$traceurRuntime.createGeneratorInstance = createGeneratorInstance;
})();
(function() {
function buildFromEncodedParts(opt_scheme, opt_userInfo, opt_domain, opt_port, opt_path, opt_queryData, opt_fragment) {
var out = [];
if (opt_scheme) {
out.push(opt_scheme, ':');
}
if (opt_domain) {
out.push('//');
if (opt_userInfo) {
out.push(opt_userInfo, '@');
}
out.push(opt_domain);
if (opt_port) {
out.push(':', opt_port);
}
}
if (opt_path) {
out.push(opt_path);
}
if (opt_queryData) {
out.push('?', opt_queryData);
}
if (opt_fragment) {
out.push('#', opt_fragment);
}
return out.join('');
}
;
var splitRe = new RegExp('^' + '(?:' + '([^:/?#.]+)' + ':)?' + '(?://' + '(?:([^/?#]*)@)?' + '([\\w\\d\\-\\u0100-\\uffff.%]*)' + '(?::([0-9]+))?' + ')?' + '([^?#]+)?' + '(?:\\?([^#]*))?' + '(?:#(.*))?' + '$');
var ComponentIndex = {
SCHEME: 1,
USER_INFO: 2,
DOMAIN: 3,
PORT: 4,
PATH: 5,
QUERY_DATA: 6,
FRAGMENT: 7
};
function split(uri) {
return (uri.match(splitRe));
}
function removeDotSegments(path) {
if (path === '/')
return '/';
var leadingSlash = path[0] === '/' ? '/' : '';
var trailingSlash = path.slice(-1) === '/' ? '/' : '';
var segments = path.split('/');
var out = [];
var up = 0;
for (var pos = 0; pos < segments.length; pos++) {
var segment = segments[pos];
switch (segment) {
case '':
case '.':
break;
case '..':
if (out.length)
out.pop();
else
up++;
break;
default:
out.push(segment);
}
}
if (!leadingSlash) {
while (up-- > 0) {
out.unshift('..');
}
if (out.length === 0)
out.push('.');
}
return leadingSlash + out.join('/') + trailingSlash;
}
function joinAndCanonicalizePath(parts) {
var path = parts[ComponentIndex.PATH] || '';
path = removeDotSegments(path);
parts[ComponentIndex.PATH] = path;
return buildFromEncodedParts(parts[ComponentIndex.SCHEME], parts[ComponentIndex.USER_INFO], parts[ComponentIndex.DOMAIN], parts[ComponentIndex.PORT], parts[ComponentIndex.PATH], parts[ComponentIndex.QUERY_DATA], parts[ComponentIndex.FRAGMENT]);
}
function canonicalizeUrl(url) {
var parts = split(url);
return joinAndCanonicalizePath(parts);
}
function resolveUrl(base, url) {
var parts = split(url);
var baseParts = split(base);
if (parts[ComponentIndex.SCHEME]) {
return joinAndCanonicalizePath(parts);
} else {
parts[ComponentIndex.SCHEME] = baseParts[ComponentIndex.SCHEME];
}
for (var i = ComponentIndex.SCHEME; i <= ComponentIndex.PORT; i++) {
if (!parts[i]) {
parts[i] = baseParts[i];
}
}
if (parts[ComponentIndex.PATH][0] == '/') {
return joinAndCanonicalizePath(parts);
}
var path = baseParts[ComponentIndex.PATH];
var index = path.lastIndexOf('/');
path = path.slice(0, index + 1) + parts[ComponentIndex.PATH];
parts[ComponentIndex.PATH] = path;
return joinAndCanonicalizePath(parts);
}
function isAbsolute(name) {
if (!name)
return false;
if (name[0] === '/')
return true;
var parts = split(name);
if (parts[ComponentIndex.SCHEME])
return true;
return false;
}
$traceurRuntime.canonicalizeUrl = canonicalizeUrl;
$traceurRuntime.isAbsolute = isAbsolute;
$traceurRuntime.removeDotSegments = removeDotSegments;
$traceurRuntime.resolveUrl = resolveUrl;
})();
(function() {
'use strict';
var types = {
any: {name: 'any'},
boolean: {name: 'boolean'},
number: {name: 'number'},
string: {name: 'string'},
symbol: {name: 'symbol'},
void: {name: 'void'}
};
var GenericType = function GenericType(type, argumentTypes) {
this.type = type;
this.argumentTypes = argumentTypes;
};
($traceurRuntime.createClass)(GenericType, {}, {});
function genericType(type) {
for (var argumentTypes = [],
$__1 = 1; $__1 < arguments.length; $__1++)
argumentTypes[$__1 - 1] = arguments[$__1];
return new GenericType(type, argumentTypes);
}
$traceurRuntime.GenericType = GenericType;
$traceurRuntime.genericType = genericType;
$traceurRuntime.type = types;
})();
(function(global) {
'use strict';
var $__2 = $traceurRuntime,
canonicalizeUrl = $__2.canonicalizeUrl,
resolveUrl = $__2.resolveUrl,
isAbsolute = $__2.isAbsolute;
var moduleInstantiators = Object.create(null);
var baseURL;
if (global.location && global.location.href)
baseURL = resolveUrl(global.location.href, './');
else
baseURL = '';
var UncoatedModuleEntry = function UncoatedModuleEntry(url, uncoatedModule) {
this.url = url;
this.value_ = uncoatedModule;
};
($traceurRuntime.createClass)(UncoatedModuleEntry, {}, {});
var ModuleEvaluationError = function ModuleEvaluationError(erroneousModuleName, cause) {
this.message = this.constructor.name + ': ' + this.stripCause(cause) + ' in ' + erroneousModuleName;
if (!(cause instanceof $ModuleEvaluationError) && cause.stack)
this.stack = this.stripStack(cause.stack);
else
this.stack = '';
};
var $ModuleEvaluationError = ModuleEvaluationError;
($traceurRuntime.createClass)(ModuleEvaluationError, {
stripError: function(message) {
return message.replace(/.*Error:/, this.constructor.name + ':');
},
stripCause: function(cause) {
if (!cause)
return '';
if (!cause.message)
return cause + '';
return this.stripError(cause.message);
},
loadedBy: function(moduleName) {
this.stack += '\n loaded by ' + moduleName;
},
stripStack: function(causeStack) {
var stack = [];
causeStack.split('\n').some((function(frame) {
if (/UncoatedModuleInstantiator/.test(frame))
return true;
stack.push(frame);
}));
stack[0] = this.stripError(stack[0]);
return stack.join('\n');
}
}, {}, Error);
var UncoatedModuleInstantiator = function UncoatedModuleInstantiator(url, func) {
$traceurRuntime.superConstructor($UncoatedModuleInstantiator).call(this, url, null);
this.func = func;
};
var $UncoatedModuleInstantiator = UncoatedModuleInstantiator;
($traceurRuntime.createClass)(UncoatedModuleInstantiator, {getUncoatedModule: function() {
if (this.value_)
return this.value_;
try {
return this.value_ = this.func.call(global);
} catch (ex) {
if (ex instanceof ModuleEvaluationError) {
ex.loadedBy(this.url);
throw ex;
}
throw new ModuleEvaluationError(this.url, ex);
}
}}, {}, UncoatedModuleEntry);
function getUncoatedModuleInstantiator(name) {
if (!name)
return;
var url = ModuleStore.normalize(name);
return moduleInstantiators[url];
}
;
var moduleInstances = Object.create(null);
var liveModuleSentinel = {};
function Module(uncoatedModule) {
var isLive = arguments[1];
var coatedModule = Object.create(null);
Object.getOwnPropertyNames(uncoatedModule).forEach((function(name) {
var getter,
value;
if (isLive === liveModuleSentinel) {
var descr = Object.getOwnPropertyDescriptor(uncoatedModule, name);
if (descr.get)
getter = descr.get;
}
if (!getter) {
value = uncoatedModule[name];
getter = function() {
return value;
};
}
Object.defineProperty(coatedModule, name, {
get: getter,
enumerable: true
});
}));
Object.preventExtensions(coatedModule);
return coatedModule;
}
var ModuleStore = {
normalize: function(name, refererName, refererAddress) {
if (typeof name !== "string")
throw new TypeError("module name must be a string, not " + typeof name);
if (isAbsolute(name))
return canonicalizeUrl(name);
if (/[^\.]\/\.\.\//.test(name)) {
throw new Error('module name embeds /../: ' + name);
}
if (name[0] === '.' && refererName)
return resolveUrl(refererName, name);
return canonicalizeUrl(name);
},
get: function(normalizedName) {
var m = getUncoatedModuleInstantiator(normalizedName);
if (!m)
return undefined;
var moduleInstance = moduleInstances[m.url];
if (moduleInstance)
return moduleInstance;
moduleInstance = Module(m.getUncoatedModule(), liveModuleSentinel);
return moduleInstances[m.url] = moduleInstance;
},
set: function(normalizedName, module) {
normalizedName = String(normalizedName);
moduleInstantiators[normalizedName] = new UncoatedModuleInstantiator(normalizedName, (function() {
return module;
}));
moduleInstances[normalizedName] = module;
},
get baseURL() {
return baseURL;
},
set baseURL(v) {
baseURL = String(v);
},
registerModule: function(name, func) {
var normalizedName = ModuleStore.normalize(name);
if (moduleInstantiators[normalizedName])
throw new Error('duplicate module named ' + normalizedName);
moduleInstantiators[normalizedName] = new UncoatedModuleInstantiator(normalizedName, func);
},
bundleStore: Object.create(null),
register: function(name, deps, func) {
if (!deps || !deps.length && !func.length) {
this.registerModule(name, func);
} else {
this.bundleStore[name] = {
deps: deps,
execute: function() {
var $__0 = arguments;
var depMap = {};
deps.forEach((function(dep, index) {
return depMap[dep] = $__0[index];
}));
var registryEntry = func.call(this, depMap);
registryEntry.execute.call(this);
return registryEntry.exports;
}
};
}
},
getAnonymousModule: function(func) {
return new Module(func.call(global), liveModuleSentinel);
},
getForTesting: function(name) {
var $__0 = this;
if (!this.testingPrefix_) {
Object.keys(moduleInstances).some((function(key) {
var m = /(traceur@[^\/]*\/)/.exec(key);
if (m) {
$__0.testingPrefix_ = m[1];
return true;
}
}));
}
return this.get(this.testingPrefix_ + name);
}
};
ModuleStore.set('@traceur/src/runtime/ModuleStore', new Module({ModuleStore: ModuleStore}));
var setupGlobals = $traceurRuntime.setupGlobals;
$traceurRuntime.setupGlobals = function(global) {
setupGlobals(global);
};
$traceurRuntime.ModuleStore = ModuleStore;
global.System = {
register: ModuleStore.register.bind(ModuleStore),
get: ModuleStore.get,
set: ModuleStore.set,
normalize: ModuleStore.normalize
};
$traceurRuntime.getModuleImpl = function(name) {
var instantiator = getUncoatedModuleInstantiator(name);
return instantiator && instantiator.getUncoatedModule();
};
})(typeof global !== 'undefined' ? global : this);
System.register("traceur-runtime@0.0.74/src/runtime/polyfills/utils", [], function() {
"use strict";
var __moduleName = "traceur-runtime@0.0.74/src/runtime/polyfills/utils";
function require(path) {
return $traceurRuntime.require("traceur-runtime@0.0.74/src/runtime/polyfills/utils", path);
}
var $ceil = Math.ceil;
var $floor = Math.floor;
var $isFinite = isFinite;
var $isNaN = isNaN;
var $pow = Math.pow;
var $min = Math.min;
var toObject = $traceurRuntime.toObject;
function toUint32(x) {
return x >>> 0;
}
function isObject(x) {
return x && (typeof x === 'object' || typeof x === 'function');
}
function isCallable(x) {
return typeof x === 'function';
}
function isNumber(x) {
return typeof x === 'number';
}
function toInteger(x) {
x = +x;
if ($isNaN(x))
return 0;
if (x === 0 || !$isFinite(x))
return x;
return x > 0 ? $floor(x) : $ceil(x);
}
var MAX_SAFE_LENGTH = $pow(2, 53) - 1;
function toLength(x) {
var len = toInteger(x);
return len < 0 ? 0 : $min(len, MAX_SAFE_LENGTH);
}
function checkIterable(x) {
return !isObject(x) ? undefined : x[Symbol.iterator];
}
function isConstructor(x) {
return isCallable(x);
}
function createIteratorResultObject(value, done) {
return {
value: value,
done: done
};
}
function maybeDefine(object, name, descr) {
if (!(name in object)) {
Object.defineProperty(object, name, descr);
}
}
function maybeDefineMethod(object, name, value) {
maybeDefine(object, name, {
value: value,
configurable: true,
enumerable: false,
writable: true
});
}
function maybeDefineConst(object, name, value) {
maybeDefine(object, name, {
value: value,
configurable: false,
enumerable: false,
writable: false
});
}
function maybeAddFunctions(object, functions) {
for (var i = 0; i < functions.length; i += 2) {
var name = functions[i];
var value = functions[i + 1];
maybeDefineMethod(object, name, value);
}
}
function maybeAddConsts(object, consts) {
for (var i = 0; i < consts.length; i += 2) {
var name = consts[i];
var value = consts[i + 1];
maybeDefineConst(object, name, value);
}
}
function maybeAddIterator(object, func, Symbol) {
if (!Symbol || !Symbol.iterator || object[Symbol.iterator])
return;
if (object['@@iterator'])
func = object['@@iterator'];
Object.defineProperty(object, Symbol.iterator, {
value: func,
configurable: true,
enumerable: false,
writable: true
});
}
var polyfills = [];
function registerPolyfill(func) {
polyfills.push(func);
}
function polyfillAll(global) {
polyfills.forEach((function(f) {
return f(global);
}));
}
return {
get toObject() {
return toObject;
},
get toUint32() {
return toUint32;
},
get isObject() {
return isObject;
},
get isCallable() {
return isCallable;
},
get isNumber() {
return isNumber;
},
get toInteger() {
return toInteger;
},
get toLength() {
return toLength;
},
get checkIterable() {
return checkIterable;
},
get isConstructor() {
return isConstructor;
},
get createIteratorResultObject() {
return createIteratorResultObject;
},
get maybeDefine() {
return maybeDefine;
},
get maybeDefineMethod() {
return maybeDefineMethod;
},
get maybeDefineConst() {
return maybeDefineConst;
},
get maybeAddFunctions() {
return maybeAddFunctions;
},
get maybeAddConsts() {
return maybeAddConsts;
},
get maybeAddIterator() {
return maybeAddIterator;
},
get registerPolyfill() {
return registerPolyfill;
},
get polyfillAll() {
return polyfillAll;
}
};
});
System.register("traceur-runtime@0.0.74/src/runtime/polyfills/Map", [], function() {
"use strict";
var __moduleName = "traceur-runtime@0.0.74/src/runtime/polyfills/Map";
function require(path) {
return $traceurRuntime.require("traceur-runtime@0.0.74/src/runtime/polyfills/Map", path);
}
var $__0 = System.get("traceur-runtime@0.0.74/src/runtime/polyfills/utils"),
isObject = $__0.isObject,
maybeAddIterator = $__0.maybeAddIterator,
registerPolyfill = $__0.registerPolyfill;
var getOwnHashObject = $traceurRuntime.getOwnHashObject;
var $hasOwnProperty = Object.prototype.hasOwnProperty;
var deletedSentinel = {};
function lookupIndex(map, key) {
if (isObject(key)) {
var hashObject = getOwnHashObject(key);
return hashObject && map.objectIndex_[hashObject.hash];
}
if (typeof key === 'string')
return map.stringIndex_[key];
return map.primitiveIndex_[key];
}
function initMap(map) {
map.entries_ = [];
map.objectIndex_ = Object.create(null);
map.stringIndex_ = Object.create(null);
map.primitiveIndex_ = Object.create(null);
map.deletedCount_ = 0;
}
var Map = function Map() {
var iterable = arguments[0];
if (!isObject(this))
throw new TypeError('Map called on incompatible type');
if ($hasOwnProperty.call(this, 'entries_')) {
throw new TypeError('Map can not be reentrantly initialised');
}
initMap(this);
if (iterable !== null && iterable !== undefined) {
for (var $__2 = iterable[$traceurRuntime.toProperty(Symbol.iterator)](),
$__3; !($__3 = $__2.next()).done; ) {
var $__4 = $__3.value,
key = $__4[0],
value = $__4[1];
{
this.set(key, value);
}
}
}
};
($traceurRuntime.createClass)(Map, {
get size() {
return this.entries_.length / 2 - this.deletedCount_;
},
get: function(key) {
var index = lookupIndex(this, key);
if (index !== undefined)
return this.entries_[index + 1];
},
set: function(key, value) {
var objectMode = isObject(key);
var stringMode = typeof key === 'string';
var index = lookupIndex(this, key);
if (index !== undefined) {
this.entries_[index + 1] = value;
} else {
index = this.entries_.length;
this.entries_[index] = key;
this.entries_[index + 1] = value;
if (objectMode) {
var hashObject = getOwnHashObject(key);
var hash = hashObject.hash;
this.objectIndex_[hash] = index;
} else if (stringMode) {
this.stringIndex_[key] = index;
} else {
this.primitiveIndex_[key] = index;
}
}
return this;
},
has: function(key) {
return lookupIndex(this, key) !== undefined;
},
delete: function(key) {
var objectMode = isObject(key);
var stringMode = typeof key === 'string';
var index;
var hash;
if (objectMode) {
var hashObject = getOwnHashObject(key);
if (hashObject) {
index = this.objectIndex_[hash = hashObject.hash];
delete this.objectIndex_[hash];
}
} else if (stringMode) {
index = this.stringIndex_[key];
delete this.stringIndex_[key];
} else {
index = this.primitiveIndex_[key];
delete this.primitiveIndex_[key];
}
if (index !== undefined) {
this.entries_[index] = deletedSentinel;
this.entries_[index + 1] = undefined;
this.deletedCount_++;
return true;
}
return false;
},
clear: function() {
initMap(this);
},
forEach: function(callbackFn) {
var thisArg = arguments[1];
for (var i = 0; i < this.entries_.length; i += 2) {
var key = this.entries_[i];
var value = this.entries_[i + 1];
if (key === deletedSentinel)
continue;
callbackFn.call(thisArg, value, key, this);
}
},
entries: $traceurRuntime.initGeneratorFunction(function $__5() {
var i,
key,
value;
return $traceurRuntime.createGeneratorInstance(function($ctx) {
while (true)
switch ($ctx.state) {
case 0:
i = 0;
$ctx.state = 12;
break;
case 12:
$ctx.state = (i < this.entries_.length) ? 8 : -2;
break;
case 4:
i += 2;
$ctx.state = 12;
break;
case 8:
key = this.entries_[i];
value = this.entries_[i + 1];
$ctx.state = 9;
break;
case 9:
$ctx.state = (key === deletedSentinel) ? 4 : 6;
break;
case 6:
$ctx.state = 2;
return [key, value];
case 2:
$ctx.maybeThrow();
$ctx.state = 4;
break;
default:
return $ctx.end();
}
}, $__5, this);
}),
keys: $traceurRuntime.initGeneratorFunction(function $__6() {
var i,
key,
value;
return $traceurRuntime.createGeneratorInstance(function($ctx) {
while (true)
switch ($ctx.state) {
case 0:
i = 0;
$ctx.state = 12;
break;
case 12:
$ctx.state = (i < this.entries_.length) ? 8 : -2;
break;
case 4:
i += 2;
$ctx.state = 12;
break;
case 8:
key = this.entries_[i];
value = this.entries_[i + 1];
$ctx.state = 9;
break;
case 9:
$ctx.state = (key === deletedSentinel) ? 4 : 6;
break;
case 6:
$ctx.state = 2;
return key;
case 2:
$ctx.maybeThrow();
$ctx.state = 4;
break;
default:
return $ctx.end();
}
}, $__6, this);
}),
values: $traceurRuntime.initGeneratorFunction(function $__7() {
var i,
key,
value;
return $traceurRuntime.createGeneratorInstance(function($ctx) {
while (true)
switch ($ctx.state) {
case 0:
i = 0;
$ctx.state = 12;
break;
case 12:
$ctx.state = (i < this.entries_.length) ? 8 : -2;
break;
case 4:
i += 2;
$ctx.state = 12;
break;
case 8:
key = this.entries_[i];
value = this.entries_[i + 1];
$ctx.state = 9;
break;
case 9:
$ctx.state = (key === deletedSentinel) ? 4 : 6;
break;
case 6:
$ctx.state = 2;
return value;
case 2:
$ctx.maybeThrow();
$ctx.state = 4;
break;
default:
return $ctx.end();
}
}, $__7, this);
})
}, {});
Object.defineProperty(Map.prototype, Symbol.iterator, {
configurable: true,
writable: true,
value: Map.prototype.entries
});
function polyfillMap(global) {
var $__4 = global,
Object = $__4.Object,
Symbol = $__4.Symbol;
if (!global.Map)
global.Map = Map;
var mapPrototype = global.Map.prototype;
if (mapPrototype.entries === undefined)
global.Map = Map;
if (mapPrototype.entries) {
maybeAddIterator(mapPrototype, mapPrototype.entries, Symbol);
maybeAddIterator(Object.getPrototypeOf(new global.Map().entries()), function() {
return this;
}, Symbol);
}
}
registerPolyfill(polyfillMap);
return {
get Map() {
return Map;
},
get polyfillMap() {
return polyfillMap;
}
};
});
System.get("traceur-runtime@0.0.74/src/runtime/polyfills/Map" + '');
System.register("traceur-runtime@0.0.74/src/runtime/polyfills/Set", [], function() {
"use strict";
var __moduleName = "traceur-runtime@0.0.74/src/runtime/polyfills/Set";
function require(path) {
return $traceurRuntime.require("traceur-runtime@0.0.74/src/runtime/polyfills/Set", path);
}
var $__0 = System.get("traceur-runtime@0.0.74/src/runtime/polyfills/utils"),
isObject = $__0.isObject,
maybeAddIterator = $__0.maybeAddIterator,
registerPolyfill = $__0.registerPolyfill;
var Map = System.get("traceur-runtime@0.0.74/src/runtime/polyfills/Map").Map;
var getOwnHashObject = $traceurRuntime.getOwnHashObject;
var $hasOwnProperty = Object.prototype.hasOwnProperty;
function initSet(set) {
set.map_ = new Map();
}
var Set = function Set() {
var iterable = arguments[0];
if (!isObject(this))
throw new TypeError('Set called on incompatible type');
if ($hasOwnProperty.call(this, 'map_')) {
throw new TypeError('Set can not be reentrantly initialised');
}
initSet(this);
if (iterable !== null && iterable !== undefined) {
for (var $__4 = iterable[$traceurRuntime.toProperty(Symbol.iterator)](),
$__5; !($__5 = $__4.next()).done; ) {
var item = $__5.value;
{
this.add(item);
}
}
}
};
($traceurRuntime.createClass)(Set, {
get size() {
return this.map_.size;
},
has: function(key) {
return this.map_.has(key);
},
add: function(key) {
this.map_.set(key, key);
return this;
},
delete: function(key) {
return this.map_.delete(key);
},
clear: function() {
return this.map_.clear();
},
forEach: function(callbackFn) {
var thisArg = arguments[1];
var $__2 = this;
return this.map_.forEach((function(value, key) {
callbackFn.call(thisArg, key, key, $__2);
}));
},
values: $traceurRuntime.initGeneratorFunction(function $__7() {
var $__8,
$__9;
return $traceurRuntime.createGeneratorInstance(function($ctx) {
while (true)
switch ($ctx.state) {
case 0:
$__8 = this.map_.keys()[Symbol.iterator]();
$ctx.sent = void 0;
$ctx.action = 'next';
$ctx.state = 12;
break;
case 12:
$__9 = $__8[$ctx.action]($ctx.sentIgnoreThrow);
$ctx.state = 9;
break;
case 9:
$ctx.state = ($__9.done) ? 3 : 2;
break;
case 3:
$ctx.sent = $__9.value;
$ctx.state = -2;
break;
case 2:
$ctx.state = 12;
return $__9.value;
default:
return $ctx.end();
}
}, $__7, this);
}),
entries: $traceurRuntime.initGeneratorFunction(function $__10() {
var $__11,
$__12;
return $traceurRuntime.createGeneratorInstance(function($ctx) {
while (true)
switch ($ctx.state) {
case 0:
$__11 = this.map_.entries()[Symbol.iterator]();
$ctx.sent = void 0;
$ctx.action = 'next';
$ctx.state = 12;
break;
case 12:
$__12 = $__11[$ctx.action]($ctx.sentIgnoreThrow);
$ctx.state = 9;
break;
case 9:
$ctx.state = ($__12.done) ? 3 : 2;
break;
case 3:
$ctx.sent = $__12.value;
$ctx.state = -2;
break;
case 2:
$ctx.state = 12;
return $__12.value;
default:
return $ctx.end();
}
}, $__10, this);
})
}, {});
Object.defineProperty(Set.prototype, Symbol.iterator, {
configurable: true,
writable: true,
value: Set.prototype.values
});
Object.defineProperty(Set.prototype, 'keys', {
configurable: true,
writable: true,
value: Set.prototype.values
});
function polyfillSet(global) {
var $__6 = global,
Object = $__6.Object,
Symbol = $__6.Symbol;
if (!global.Set)
global.Set = Set;
var setPrototype = global.Set.prototype;
if (setPrototype.values) {
maybeAddIterator(setPrototype, setPrototype.values, Symbol);
maybeAddIterator(Object.getPrototypeOf(new global.Set().values()), function() {
return this;
}, Symbol);
}
}
registerPolyfill(polyfillSet);
return {
get Set() {
return Set;
},
get polyfillSet() {
return polyfillSet;
}
};
});
System.get("traceur-runtime@0.0.74/src/runtime/polyfills/Set" + '');
System.register("traceur-runtime@0.0.74/node_modules/rsvp/lib/rsvp/asap", [], function() {
"use strict";
var __moduleName = "traceur-runtime@0.0.74/node_modules/rsvp/lib/rsvp/asap";
function require(path) {
return $traceurRuntime.require("traceur-runtime@0.0.74/node_modules/rsvp/lib/rsvp/asap", path);
}
var len = 0;
function asap(callback, arg) {
queue[len] = callback;
queue[len + 1] = arg;
len += 2;
if (len === 2) {
scheduleFlush();
}
}
var $__default = asap;
var browserGlobal = (typeof window !== 'undefined') ? window : {};
var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined';
function useNextTick() {
return function() {
process.nextTick(flush);
};
}
function useMutationObserver() {
var iterations = 0;
var observer = new BrowserMutationObserver(flush);
var node = document.createTextNode('');
observer.observe(node, {characterData: true});
return function() {
node.data = (iterations = ++iterations % 2);
};
}
function useMessageChannel() {
var channel = new MessageChannel();
channel.port1.onmessage = flush;
return function() {
channel.port2.postMessage(0);
};
}
function useSetTimeout() {
return function() {
setTimeout(flush, 1);
};
}
var queue = new Array(1000);
function flush() {
for (var i = 0; i < len; i += 2) {
var callback = queue[i];
var arg = queue[i + 1];
callback(arg);
queue[i] = undefined;
queue[i + 1] = undefined;
}
len = 0;
}
var scheduleFlush;
if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') {
scheduleFlush = useNextTick();
} else if (BrowserMutationObserver) {
scheduleFlush = useMutationObserver();
} else if (isWorker) {
scheduleFlush = useMessageChannel();
} else {
scheduleFlush = useSetTimeout();
}
return {get default() {
return $__default;
}};
});
System.register("traceur-runtime@0.0.74/src/runtime/polyfills/Promise", [], function() {
"use strict";
var __moduleName = "traceur-runtime@0.0.74/src/runtime/polyfills/Promise";
function require(path) {
return $traceurRuntime.require("traceur-runtime@0.0.74/src/runtime/polyfills/Promise", path);
}
var async = System.get("traceur-runtime@0.0.74/node_modules/rsvp/lib/rsvp/asap").default;
var registerPolyfill = System.get("traceur-runtime@0.0.74/src/runtime/polyfills/utils").registerPolyfill;
var promiseRaw = {};
function isPromise(x) {
return x && typeof x === 'object' && x.status_ !== undefined;
}
function idResolveHandler(x) {
return x;
}
function idRejectHandler(x) {
throw x;
}
function chain(promise) {
var onResolve = arguments[1] !== (void 0) ? arguments[1] : idResolveHandler;
var onReject = arguments[2] !== (void 0) ? arguments[2] : idRejectHandler;
var deferred = getDeferred(promise.constructor);
switch (promise.status_) {
case undefined:
throw TypeError;
case 0:
promise.onResolve_.push(onResolve, deferred);
promise.onReject_.push(onReject, deferred);
break;
case +1:
promiseEnqueue(promise.value_, [onResolve, deferred]);
break;
case -1:
promiseEnqueue(promise.value_, [onReject, deferred]);
break;
}
return deferred.promise;
}
function getDeferred(C) {
if (this === $Promise) {
var promise = promiseInit(new $Promise(promiseRaw));
return {
promise: promise,
resolve: (function(x) {
promiseResolve(promise, x);
}),
reject: (function(r) {
promiseReject(promise, r);
})
};
} else {
var result = {};
result.promise = new C((function(resolve, reject) {
result.resolve = resolve;
result.reject = reject;
}));
return result;
}
}
function promiseSet(promise, status, value, onResolve, onReject) {
promise.status_ = status;
promise.value_ = value;
promise.onResolve_ = onResolve;
promise.onReject_ = onReject;
return promise;
}
function promiseInit(promise) {
return promiseSet(promise, 0, undefined, [], []);
}
var Promise = function Promise(resolver) {
if (resolver === promiseRaw)
return;
if (typeof resolver !== 'function')
throw new TypeError;
var promise = promiseInit(this);
try {
resolver((function(x) {
promiseResolve(promise, x);
}), (function(r) {
promiseReject(promise, r);
}));
} catch (e) {
promiseReject(promise, e);
}
};
($traceurRuntime.createClass)(Promise, {
catch: function(onReject) {
return this.then(undefined, onReject);
},
then: function(onResolve, onReject) {
if (typeof onResolve !== 'function')
onResolve = idResolveHandler;
if (typeof onReject !== 'function')
onReject = idRejectHandler;
var that = this;
var constructor = this.constructor;
return chain(this, function(x) {
x = promiseCoerce(constructor, x);
return x === that ? onReject(new TypeError) : isPromise(x) ? x.then(onResolve, onReject) : onResolve(x);
}, onReject);
}
}, {
resolve: function(x) {
if (this === $Promise) {
if (isPromise(x)) {
return x;
}
return promiseSet(new $Promise(promiseRaw), +1, x);
} else {
return new this(function(resolve, reject) {
resolve(x);
});
}
},
reject: function(r) {
if (this === $Promise) {
return promiseSet(new $Promise(promiseRaw), -1, r);
} else {
return new this((function(resolve, reject) {
reject(r);
}));
}
},
all: function(values) {
var deferred = getDeferred(this);
var resolutions = [];
try {
var count = values.length;
if (count === 0) {
deferred.resolve(resolutions);
} else {
for (var i = 0; i < values.length; i++) {
this.resolve(values[i]).then(function(i, x) {
resolutions[i] = x;
if (--count === 0)
deferred.resolve(resolutions);
}.bind(undefined, i), (function(r) {
deferred.reject(r);
}));
}
}
} catch (e) {
deferred.reject(e);
}
return deferred.promise;
},
race: function(values) {
var deferred = getDeferred(this);
try {
for (var i = 0; i < values.length; i++) {
this.resolve(values[i]).then((function(x) {
deferred.resolve(x);
}), (function(r) {
deferred.reject(r);
}));
}
} catch (e) {
deferred.reject(e);
}
return deferred.promise;
}
});
var $Promise = Promise;
var $PromiseReject = $Promise.reject;
function promiseResolve(promise, x) {
promiseDone(promise, +1, x, promise.onResolve_);
}
function promiseReject(promise, r) {
promiseDone(promise, -1, r, promise.onReject_);
}
function promiseDone(promise, status, value, reactions) {
if (promise.status_ !== 0)
return;
promiseEnqueue(value, reactions);
promiseSet(promise, status, value);
}
function promiseEnqueue(value, tasks) {
async((function() {
for (var i = 0; i < tasks.length; i += 2) {
promiseHandle(value, tasks[i], tasks[i + 1]);
}
}));
}
function promiseHandle(value, handler, deferred) {
try {
var result = handler(value);
if (result === deferred.promise)
throw new TypeError;
else if (isPromise(result))
chain(result, deferred.resolve, deferred.reject);
else
deferred.resolve(result);
} catch (e) {
try {
deferred.reject(e);
} catch (e) {}
}
}
var thenableSymbol = '@@thenable';
function isObject(x) {
return x && (typeof x === 'object' || typeof x === 'function');
}
function promiseCoerce(constructor, x) {
if (!isPromise(x) && isObject(x)) {
var then;
try {
then = x.then;
} catch (r) {
var promise = $PromiseReject.call(constructor, r);
x[thenableSymbol] = promise;
return promise;
}
if (typeof then === 'function') {
var p = x[thenableSymbol];
if (p) {
return p;
} else {
var deferred = getDeferred(constructor);
x[thenableSymbol] = deferred.promise;
try {
then.call(x, deferred.resolve, deferred.reject);
} catch (r) {
deferred.reject(r);
}
return deferred.promise;
}
}
}
return x;
}
function polyfillPromise(global) {
if (!global.Promise)
global.Promise = Promise;
}
registerPolyfill(polyfillPromise);
return {
get Promise() {
return Promise;
},
get polyfillPromise() {
return polyfillPromise;
}
};
});
System.get("traceur-runtime@0.0.74/src/runtime/polyfills/Promise" + '');
System.register("traceur-runtime@0.0.74/src/runtime/polyfills/StringIterator", [], function() {
"use strict";
var $__2;
var __moduleName = "traceur-runtime@0.0.74/src/runtime/polyfills/StringIterator";
function require(path) {
return $traceurRuntime.require("traceur-runtime@0.0.74/src/runtime/polyfills/StringIterator", path);
}
var $__0 = System.get("traceur-runtime@0.0.74/src/runtime/polyfills/utils"),
createIteratorResultObject = $__0.createIteratorResultObject,
isObject = $__0.isObject;
var toProperty = $traceurRuntime.toProperty;
var hasOwnProperty = Object.prototype.hasOwnProperty;
var iteratedString = Symbol('iteratedString');
var stringIteratorNextIndex = Symbol('stringIteratorNextIndex');
var StringIterator = function StringIterator() {};
($traceurRuntime.createClass)(StringIterator, ($__2 = {}, Object.defineProperty($__2, "next", {
value: function() {
var o = this;
if (!isObject(o) || !hasOwnProperty.call(o, iteratedString)) {
throw new TypeError('this must be a StringIterator object');
}
var s = o[toProperty(iteratedString)];
if (s === undefined) {
return createIteratorResultObject(undefined, true);
}
var position = o[toProperty(stringIteratorNextIndex)];
var len = s.length;
if (position >= len) {
o[toProperty(iteratedString)] = undefined;
return createIteratorResultObject(undefined, true);
}
var first = s.charCodeAt(position);
var resultString;
if (first < 0xD800 || first > 0xDBFF || position + 1 === len) {
resultString = String.fromCharCode(first);
} else {
var second = s.charCodeAt(position + 1);
if (second < 0xDC00 || second > 0xDFFF) {
resultString = String.fromCharCode(first);
} else {
resultString = String.fromCharCode(first) + String.fromCharCode(second);
}
}
o[toProperty(stringIteratorNextIndex)] = position + resultString.length;
return createIteratorResultObject(resultString, false);
},
configurable: true,
enumerable: true,
writable: true
}), Object.defineProperty($__2, Symbol.iterator, {
value: function() {
return this;
},
configurable: true,
enumerable: true,
writable: true
}), $__2), {});
function createStringIterator(string) {
var s = String(string);
var iterator = Object.create(StringIterator.prototype);
iterator[toProperty(iteratedString)] = s;
iterator[toProperty(stringIteratorNextIndex)] = 0;
return iterator;
}
return {get createStringIterator() {
return createStringIterator;
}};
});
System.register("traceur-runtime@0.0.74/src/runtime/polyfills/String", [], function() {
"use strict";
var __moduleName = "traceur-runtime@0.0.74/src/runtime/polyfills/String";
function require(path) {
return $traceurRuntime.require("traceur-runtime@0.0.74/src/runtime/polyfills/String", path);
}
var createStringIterator = System.get("traceur-runtime@0.0.74/src/runtime/polyfills/StringIterator").createStringIterator;
var $__1 = System.get("traceur-runtime@0.0.74/src/runtime/polyfills/utils"),
maybeAddFunctions = $__1.maybeAddFunctions,
maybeAddIterator = $__1.maybeAddIterator,
registerPolyfill = $__1.registerPolyfill;
var $toString = Object.prototype.toString;
var $indexOf = String.prototype.indexOf;
var $lastIndexOf = String.prototype.lastIndexOf;
function startsWith(search) {
var string = String(this);
if (this == null || $toString.call(search) == '[object RegExp]') {
throw TypeError();
}
var stringLength = string.length;
var searchString = String(search);
var searchLength = searchString.length;
var position = arguments.length > 1 ? arguments[1] : undefined;
var pos = position ? Number(position) : 0;
if (isNaN(pos)) {
pos = 0;
}
var start = Math.min(Math.max(pos, 0), stringLength);
return $indexOf.call(string, searchString, pos) == start;
}
function endsWith(search) {
var string = String(this);
if (this == null || $toString.call(search) == '[object RegExp]') {
throw TypeError();
}
var stringLength = string.length;
var searchString = String(search);
var searchLength = searchString.length;
var pos = stringLength;
if (arguments.length > 1) {
var position = arguments[1];
if (position !== undefined) {
pos = position ? Number(position) : 0;
if (isNaN(pos)) {
pos = 0;
}
}
}
var end = Math.min(Math.max(pos, 0), stringLength);
var start = end - searchLength;
if (start < 0) {
return false;
}
return $lastIndexOf.call(string, searchString, start) == start;
}
function contains(search) {
if (this == null) {
throw TypeError();
}
var string = String(this);
var stringLength = string.length;
var searchString = String(search);
var searchLength = searchString.length;
var position = arguments.length > 1 ? arguments[1] : undefined;
var pos = position ? Number(position) : 0;
if (isNaN(pos)) {
pos = 0;
}
var start = Math.min(Math.max(pos, 0), stringLength);
return $indexOf.call(string, searchString, pos) != -1;
}
function repeat(count) {
if (this == null) {
throw TypeError();
}
var string = String(this);
var n = count ? Number(count) : 0;
if (isNaN(n)) {
n = 0;
}
if (n < 0 || n == Infinity) {
throw RangeError();
}
if (n == 0) {
return '';
}
var result = '';
while (n--) {
result += string;
}
return result;
}
function codePointAt(position) {
if (this == null) {
throw TypeError();
}
var string = String(this);
var size = string.length;
var index = position ? Number(position) : 0;
if (isNaN(index)) {
index = 0;
}
if (index < 0 || index >= size) {
return undefined;
}
var first = string.charCodeAt(index);
var second;
if (first >= 0xD800 && first <= 0xDBFF && size > index + 1) {
second = string.charCodeAt(index + 1);
if (second >= 0xDC00 && second <= 0xDFFF) {
return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
}
}
return first;
}
function raw(callsite) {
var raw = callsite.raw;
var len = raw.length >>> 0;
if (len === 0)
return '';
var s = '';
var i = 0;
while (true) {
s += raw[i];
if (i + 1 === len)
return s;
s += arguments[++i];
}
}
function fromCodePoint() {
var codeUnits = [];
var floor = Math.floor;
var highSurrogate;
var lowSurrogate;
var index = -1;
var length = arguments.length;
if (!length) {
return '';
}
while (++index < length) {
var codePoint = Number(arguments[index]);
if (!isFinite(codePoint) || codePoint < 0 || codePoint > 0x10FFFF || floor(codePoint) != codePoint) {
throw RangeError('Invalid code point: ' + codePoint);
}
if (codePoint <= 0xFFFF) {
codeUnits.push(codePoint);
} else {
codePoint -= 0x10000;
highSurrogate = (codePoint >> 10) + 0xD800;
lowSurrogate = (codePoint % 0x400) + 0xDC00;
codeUnits.push(highSurrogate, lowSurrogate);
}
}
return String.fromCharCode.apply(null, codeUnits);
}
function stringPrototypeIterator() {
var o = $traceurRuntime.checkObjectCoercible(this);
var s = String(o);
return createStringIterator(s);
}
function polyfillString(global) {
var String = global.String;
maybeAddFunctions(String.prototype, ['codePointAt', codePointAt, 'contains', contains, 'endsWith', endsWith, 'startsWith', startsWith, 'repeat', repeat]);
maybeAddFunctions(String, ['fromCodePoint', fromCodePoint, 'raw', raw]);
maybeAddIterator(String.prototype, stringPrototypeIterator, Symbol);
}
registerPolyfill(polyfillString);
return {
get startsWith() {
return startsWith;
},
get endsWith() {
return endsWith;
},
get contains() {
return contains;
},
get repeat() {
return repeat;
},
get codePointAt() {
return codePointAt;
},
get raw() {
return raw;
},
get fromCodePoint() {
return fromCodePoint;
},
get stringPrototypeIterator() {
return stringPrototypeIterator;
},
get polyfillString() {
return polyfillString;
}
};
});
System.get("traceur-runtime@0.0.74/src/runtime/polyfills/String" + '');
System.register("traceur-runtime@0.0.74/src/runtime/polyfills/ArrayIterator", [], function() {
"use strict";
var $__2;
var __moduleName = "traceur-runtime@0.0.74/src/runtime/polyfills/ArrayIterator";
function require(path) {
return $traceurRuntime.require("traceur-runtime@0.0.74/src/runtime/polyfills/ArrayIterator", path);
}
var $__0 = System.get("traceur-runtime@0.0.74/src/runtime/polyfills/utils"),
toObject = $__0.toObject,
toUint32 = $__0.toUint32,
createIteratorResultObject = $__0.createIteratorResultObject;
var ARRAY_ITERATOR_KIND_KEYS = 1;
var ARRAY_ITERATOR_KIND_VALUES = 2;
var ARRAY_ITERATOR_KIND_ENTRIES = 3;
var ArrayIterator = function ArrayIterator() {};
($traceurRuntime.createClass)(ArrayIterator, ($__2 = {}, Object.defineProperty($__2, "next", {
value: function() {
var iterator = toObject(this);
var array = iterator.iteratorObject_;
if (!array) {
throw new TypeError('Object is not an ArrayIterator');
}
var index = iterator.arrayIteratorNextIndex_;
var itemKind = iterator.arrayIterationKind_;
var length = toUint32(array.length);
if (index >= length) {
iterator.arrayIteratorNextIndex_ = Infinity;
return createIteratorResultObject(undefined, true);
}
iterator.arrayIteratorNextIndex_ = index + 1;
if (itemKind == ARRAY_ITERATOR_KIND_VALUES)
return createIteratorResultObject(array[index], false);
if (itemKind == ARRAY_ITERATOR_KIND_ENTRIES)
return createIteratorResultObject([index, array[index]], false);
return createIteratorResultObject(index, false);
},
configurable: true,
enumerable: true,
writable: true
}), Object.defineProperty($__2, Symbol.iterator, {
value: function() {
return this;
},
configurable: true,
enumerable: true,
writable: true
}), $__2), {});
function createArrayIterator(array, kind) {
var object = toObject(array);
var iterator = new ArrayIterator;
iterator.iteratorObject_ = object;
iterator.arrayIteratorNextIndex_ = 0;
iterator.arrayIterationKind_ = kind;
return iterator;
}
function entries() {
return createArrayIterator(this, ARRAY_ITERATOR_KIND_ENTRIES);
}
function keys() {
return createArrayIterator(this, ARRAY_ITERATOR_KIND_KEYS);
}
function values() {
return createArrayIterator(this, ARRAY_ITERATOR_KIND_VALUES);
}
return {
get entries() {
return entries;
},
get keys() {
return keys;
},
get values() {
return values;
}
};
});
System.register("traceur-runtime@0.0.74/src/runtime/polyfills/Array", [], function() {
"use strict";
var __moduleName = "traceur-runtime@0.0.74/src/runtime/polyfills/Array";
function require(path) {
return $traceurRuntime.require("traceur-runtime@0.0.74/src/runtime/polyfills/Array", path);
}
var $__0 = System.get("traceur-runtime@0.0.74/src/runtime/polyfills/ArrayIterator"),
entries = $__0.entries,
keys = $__0.keys,
values = $__0.values;
var $__1 = System.get("traceur-runtime@0.0.74/src/runtime/polyfills/utils"),
checkIterable = $__1.checkIterable,
isCallable = $__1.isCallable,
isConstructor = $__1.isConstructor,
maybeAddFunctions = $__1.maybeAddFunctions,
maybeAddIterator = $__1.maybeAddIterator,
registerPolyfill = $__1.registerPolyfill,
toInteger = $__1.toInteger,
toLength = $__1.toLength,
toObject = $__1.toObject;
function from(arrLike) {
var mapFn = arguments[1];
var thisArg = arguments[2];
var C = this;
var items = toObject(arrLike);
var mapping = mapFn !== undefined;
var k = 0;
var arr,
len;
if (mapping && !isCallable(mapFn)) {
throw TypeError();
}
if (checkIterable(items)) {
arr = isConstructor(C) ? new C() : [];
for (var $__2 = items[$traceurRuntime.toProperty(Symbol.iterator)](),
$__3; !($__3 = $__2.next()).done; ) {
var item = $__3.value;
{
if (mapping) {
arr[k] = mapFn.call(thisArg, item, k);
} else {
arr[k] = item;
}
k++;
}
}
arr.length = k;
return arr;
}
len = toLength(items.length);
arr = isConstructor(C) ? new C(len) : new Array(len);
for (; k < len; k++) {
if (mapping) {
arr[k] = typeof thisArg === 'undefined' ? mapFn(items[k], k) : mapFn.call(thisArg, items[k], k);
} else {
arr[k] = items[k];
}
}
arr.length = len;
return arr;
}
function of() {
for (var items = [],
$__4 = 0; $__4 < arguments.length; $__4++)
items[$__4] = arguments[$__4];
var C = this;
var len = items.length;
var arr = isConstructor(C) ? new C(len) : new Array(len);
for (var k = 0; k < len; k++) {
arr[k] = items[k];
}
arr.length = len;
return arr;
}
function fill(value) {
var start = arguments[1] !== (void 0) ? arguments[1] : 0;
var end = arguments[2];
var object = toObject(this);
var len = toLength(object.length);
var fillStart = toInteger(start);
var fillEnd = end !== undefined ? toInteger(end) : len;
fillStart = fillStart < 0 ? Math.max(len + fillStart, 0) : Math.min(fillStart, len);
fillEnd = fillEnd < 0 ? Math.max(len + fillEnd, 0) : Math.min(fillEnd, len);
while (fillStart < fillEnd) {
object[fillStart] = value;
fillStart++;
}
return object;
}
function find(predicate) {
var thisArg = arguments[1];
return findHelper(this, predicate, thisArg);
}
function findIndex(predicate) {
var thisArg = arguments[1];
return findHelper(this, predicate, thisArg, true);
}
function findHelper(self, predicate) {
var thisArg = arguments[2];
var returnIndex = arguments[3] !== (void 0) ? arguments[3] : false;
var object = toObject(self);
var len = toLength(object.length);
if (!isCallable(predicate)) {
throw TypeError();
}
for (var i = 0; i < len; i++) {
var value = object[i];
if (predicate.call(thisArg, value, i, object)) {
return returnIndex ? i : value;
}
}
return returnIndex ? -1 : undefined;
}
function polyfillArray(global) {
var $__5 = global,
Array = $__5.Array,
Object = $__5.Object,
Symbol = $__5.Symbol;
maybeAddFunctions(Array.prototype, ['entries', entries, 'keys', keys, 'values', values, 'fill', fill, 'find', find, 'findIndex', findIndex]);
maybeAddFunctions(Array, ['from', from, 'of', of]);
maybeAddIterator(Array.prototype, values, Symbol);
maybeAddIterator(Object.getPrototypeOf([].values()), function() {
return this;
}, Symbol);
}
registerPolyfill(polyfillArray);
return {
get from() {
return from;
},
get of() {
return of;
},
get fill() {
return fill;
},
get find() {
return find;
},
get findIndex() {
return findIndex;
},
get polyfillArray() {
return polyfillArray;
}
};
});
System.get("traceur-runtime@0.0.74/src/runtime/polyfills/Array" + '');
System.register("traceur-runtime@0.0.74/src/runtime/polyfills/Object", [], function() {
"use strict";
var __moduleName = "traceur-runtime@0.0.74/src/runtime/polyfills/Object";
function require(path) {
return $traceurRuntime.require("traceur-runtime@0.0.74/src/runtime/polyfills/Object", path);
}
var $__0 = System.get("traceur-runtime@0.0.74/src/runtime/polyfills/utils"),
maybeAddFunctions = $__0.maybeAddFunctions,
registerPolyfill = $__0.registerPolyfill;
var $__1 = $traceurRuntime,
defineProperty = $__1.defineProperty,
getOwnPropertyDescriptor = $__1.getOwnPropertyDescriptor,
getOwnPropertyNames = $__1.getOwnPropertyNames,
isPrivateName = $__1.isPrivateName,
keys = $__1.keys;
function is(left, right) {
if (left === right)
return left !== 0 || 1 / left === 1 / right;
return left !== left && right !== right;
}
function assign(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
var props = source == null ? [] : keys(source);
var p,
length = props.length;
for (p = 0; p < length; p++) {
var name = props[p];
if (isPrivateName(name))
continue;
target[name] = source[name];
}
}
return target;
}
function mixin(target, source) {
var props = getOwnPropertyNames(source);
var p,
descriptor,
length = props.length;
for (p = 0; p < length; p++) {
var name = props[p];
if (isPrivateName(name))
continue;
descriptor = getOwnPropertyDescriptor(source, props[p]);
defineProperty(target, props[p], descriptor);
}
return target;
}
function polyfillObject(global) {
var Object = global.Object;
maybeAddFunctions(Object, ['assign', assign, 'is', is, 'mixin', mixin]);
}
registerPolyfill(polyfillObject);
return {
get is() {
return is;
},
get assign() {
return assign;
},
get mixin() {
return mixin;
},
get polyfillObject() {
return polyfillObject;
}
};
});
System.get("traceur-runtime@0.0.74/src/runtime/polyfills/Object" + '');
System.register("traceur-runtime@0.0.74/src/runtime/polyfills/Number", [], function() {
"use strict";
var __moduleName = "traceur-runtime@0.0.74/src/runtime/polyfills/Number";
function require(path) {
return $traceurRuntime.require("traceur-runtime@0.0.74/src/runtime/polyfills/Number", path);
}
var $__0 = System.get("traceur-runtime@0.0.74/src/runtime/polyfills/utils"),
isNumber = $__0.isNumber,
maybeAddConsts = $__0.maybeAddConsts,
maybeAddFunctions = $__0.maybeAddFunctions,
registerPolyfill = $__0.registerPolyfill,
toInteger = $__0.toInteger;
var $abs = Math.abs;
var $isFinite = isFinite;
var $isNaN = isNaN;
var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1;
var MIN_SAFE_INTEGER = -Math.pow(2, 53) + 1;
var EPSILON = Math.pow(2, -52);
function NumberIsFinite(number) {
return isNumber(number) && $isFinite(number);
}
;
function isInteger(number) {
return NumberIsFinite(number) && toInteger(number) === number;
}
function NumberIsNaN(number) {
return isNumber(number) && $isNaN(number);
}
;
function isSafeInteger(number) {
if (NumberIsFinite(number)) {
var integral = toInteger(number);
if (integral === number)
return $abs(integral) <= MAX_SAFE_INTEGER;
}
return false;
}
function polyfillNumber(global) {
var Number = global.Number;
maybeAddConsts(Number, ['MAX_SAFE_INTEGER', MAX_SAFE_INTEGER, 'MIN_SAFE_INTEGER', MIN_SAFE_INTEGER, 'EPSILON', EPSILON]);
maybeAddFunctions(Number, ['isFinite', NumberIsFinite, 'isInteger', isInteger, 'isNaN', NumberIsNaN, 'isSafeInteger', isSafeInteger]);
}
registerPolyfill(polyfillNumber);
return {
get MAX_SAFE_INTEGER() {
return MAX_SAFE_INTEGER;
},
get MIN_SAFE_INTEGER() {
return MIN_SAFE_INTEGER;
},
get EPSILON() {
return EPSILON;
},
get isFinite() {
return NumberIsFinite;
},
get isInteger() {
return isInteger;
},
get isNaN() {
return NumberIsNaN;
},
get isSafeInteger() {
return isSafeInteger;
},
get polyfillNumber() {
return polyfillNumber;
}
};
});
System.get("traceur-runtime@0.0.74/src/runtime/polyfills/Number" + '');
System.register("traceur-runtime@0.0.74/src/runtime/polyfills/polyfills", [], function() {
"use strict";
var __moduleName = "traceur-runtime@0.0.74/src/runtime/polyfills/polyfills";
function require(path) {
return $traceurRuntime.require("traceur-runtime@0.0.74/src/runtime/polyfills/polyfills", path);
}
var polyfillAll = System.get("traceur-runtime@0.0.74/src/runtime/polyfills/utils").polyfillAll;
polyfillAll(this);
var setupGlobals = $traceurRuntime.setupGlobals;
$traceurRuntime.setupGlobals = function(global) {
setupGlobals(global);
polyfillAll(global);
};
return {};
});
System.get("traceur-runtime@0.0.74/src/runtime/polyfills/polyfills" + '');
================================================
FILE: client/index.html
================================================
ES6 + AngularJS
================================================
FILE: client/loader.config.js
================================================
System.config({
meta: {
'components/angular/angular': { format: 'global', exports: 'angular' },
'components/angular-mocks/angular-mocks': { deps: ['angular'] },
'components/angular-touch/angular-touch': { deps: ['angular'] },
'components/angular-animate/angular-animate': { deps: ['angular'] },
'components/angular-aria/angular-aria/angular-aria': { deps: ['angular'] },
'components/angular-messages/angular-messages': { deps: ['angular'] },
'components/angular-i18n-en-gb/angular-i18n/angular-locale_en-gb': { deps: ['angular'] },
'components/angular-ui-router/angular-ui-router/release/angular-ui-router': { deps: ['angular'] },
},
map: {
'app': 'app-compiled',
'text': 'components/plugin-text/text',
'json': 'components/plugin-json/json',
'lodash': 'components/lodash/dist/lodash',
'angular': 'components/angular/angular',
'angular-mock': 'components/angular-mocks/angular-mocks',
'angular-touch': 'components/angular-touch/angular-touch',
'angular-animate': 'components/angular-animate/angular-animate',
'angular-aria': 'components/angular-aria/angular-aria',
'angular-messages': 'components/angular-messages/angular-messages',
'angular-i18n-en-gb': 'components/angular-i18n/angular-locale_en-gb',
'angular-ui-router': 'components/angular-ui-router/release/angular-ui-router',
'rtts-assert': 'components/assert/src/assert',
}
});
================================================
FILE: config/file-name-to-module-name.js
================================================
function fileNameToModuleName(filePath) {
return filePath.replace(/\\/g, '/')
// module name should be relative to `client` folder
.replace(/.*\/base\//, '')
.replace(/.*\/client\//, '')
.replace(/.*\/tools\//, '')
// module name should not include `src`, `test`, `lib`
.replace(/\/src\//, '/')
.replace(/\/lib\//, '/')
// module name should not have a suffix
.replace(/\.\w*$/, '');
}
if (typeof module !== 'undefined') {
module.exports = fileNameToModuleName;
}
================================================
FILE: config/karma-spec-loader.config.js
================================================
'use strict';
// make it async
window.__karma__.loaded = function noop() {};
// Karma serves files here
System.baseURL = '/base/';
System.map.app = 'app';
// use "app" not "app-compiled"
delete System.map.app;
var TEST_REGEXP = /[\._]spec\.js$/;
var IGNORE_PATH_REGEXP = /^components\/|app-compiled\//;
Promise.all(
Object.keys(window.__karma__.files) // All files served by Karma.
.filter(function onlySpecFiles(path) {
return TEST_REGEXP.test(path);
})
.map(window.fileNameToModuleName) // Normalize paths to module names.
.filter(function excludeComponentSpecFiles(path) {
return !IGNORE_PATH_REGEXP.test(path);
})
.map(function(path) {
return System.import(path);
})
).then(function() {
window.__karma__.start();
}, function(error) {
console.error(error.stack || error);
window.__karma__.start();
});
================================================
FILE: config/karma.config.js
================================================
'use strict';
var traceurOptions = require('./traceur.config');
traceurOptions.sourceMaps = true;
traceurOptions.modules = 'instantiate';
traceurOptions.moduleName = null;
module.exports = function(config) {
config.set({
basePath: './client',
frameworks: ['jasmine', 'traceur'],
browsers: ['Chrome'],
reporters: ['progress'],
files: [
'components/es6-module-loader/dist/es6-module-loader.src.js',
'components/system.js/dist/system.src.js',
'loader.config.js',
// Serve but don't create script tags for any files being `import`ed
{ pattern: '**/*.js', included: false },
{ pattern: '**/*.html', included: false },
{ pattern: '**/*.json', included: false },
'../config/traceur-runtime-patch.js',
'../config/file-name-to-module-name.js',
// Load and initialize all spec files using SystemJS
'../config/karma-spec-loader.config.js',
],
exclude: [
'*-compiled/**',
'assets/**',
],
preprocessors: {
'app/**/*.js': ['traceur'],
},
traceurPreprocessor: {
options: traceurOptions
},
});
};
================================================
FILE: config/protractor.config.js
================================================
'use strict';
var options = {
port: process.env.HTTP_PORT || '8000'
};
function disableNgAnimate() {
angular.module('disableNgAnimate', []).run([
'$animate',
function($animate) {
$animate.enabled(false);
}
]);
}
exports.config = {
onPrepare: function onPrepare() {
browser.addMockModule('disableNgAnimate', disableNgAnimate);
},
directConnect: true,
suites: {
full: 'client/app/**/*.e2e.js'
},
capabilities: {
browserName: 'chrome',
shardTestFiles: true,
maxInstances: 2,
version: 'ANY'
},
baseUrl: 'http://localhost:' + options.port,
rootElement: '[data-main-app]',
framework: 'jasmine',
jasmineNodeOpts: {
onComplete: null,
realtimeFailure: true,
showTiming: true,
isVerbose: true,
showColors: true,
includeStackTrace: true,
defaultTimeoutInterval: 30000
}
};
================================================
FILE: config/traceur-runtime-patch.js
================================================
(function(type) {
Object.keys(type).forEach(function(name) {
type[name].__assertName = name;
});
})(window.$traceurRuntime.type);
================================================
FILE: config/traceur.config.js
================================================
module.exports = {
strict: false,
types: true,
typeAssersions: true,
typeAssertionModule: 'rtts-assert',
annotations: true,
memberVariables: true,
// freeVariableChecker: true,
debug: true
};
================================================
FILE: npm-shrinkwrap.json
================================================
{
"name": "es6-angular",
"version": "0.0.1-pre",
"dependencies": {
"assetgraph": {
"version": "1.13.1",
"from": "assetgraph@>=1.12.1 <2.0.0",
"resolved": "https://registry.npmjs.org/assetgraph/-/assetgraph-1.13.1.tgz",
"dependencies": {
"accord": {
"version": "0.11.0",
"from": "accord@0.11.0",
"resolved": "https://registry.npmjs.org/accord/-/accord-0.11.0.tgz",
"dependencies": {
"fobject": {
"version": "0.0.0",
"from": "fobject@0.0.0",
"resolved": "https://registry.npmjs.org/fobject/-/fobject-0.0.0.tgz"
},
"indx": {
"version": "0.1.2",
"from": "indx@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/indx/-/indx-0.1.2.tgz",
"dependencies": {
"coffee-script": {
"version": "1.7.1",
"from": "coffee-script@>=1.7.0 <1.8.0",
"resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.7.1.tgz"
},
"colors": {
"version": "0.6.2",
"from": "colors@>=0.6.0 <0.7.0",
"resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz"
}
}
},
"lodash": {
"version": "2.4.1",
"from": "lodash@>=2.4.1 <2.5.0",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.1.tgz"
},
"resolve": {
"version": "0.7.4",
"from": "resolve@>=0.7.0 <0.8.0",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-0.7.4.tgz"
},
"uglify-js": {
"version": "2.4.15",
"from": "uglify-js@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.4.15.tgz",
"dependencies": {
"source-map": {
"version": "0.1.34",
"from": "source-map@0.1.34",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.34.tgz",
"dependencies": {
"amdefine": {
"version": "0.1.0",
"from": "amdefine@>=0.0.4",
"resolved": "https://registry.npmjs.org/amdefine/-/amdefine-0.1.0.tgz"
}
}
},
"optimist": {
"version": "0.3.7",
"from": "optimist@>=0.3.5 <0.4.0",
"resolved": "https://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz",
"dependencies": {
"wordwrap": {
"version": "0.0.2",
"from": "wordwrap@>=0.0.2 <0.1.0",
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz"
}
}
},
"uglify-to-browserify": {
"version": "1.0.2",
"from": "uglify-to-browserify@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz"
}
}
},
"when": {
"version": "3.6.3",
"from": "when@>=3.0.0 <4.0.0",
"resolved": "https://registry.npmjs.org/when/-/when-3.6.3.tgz"
}
}
},
"async": {
"version": "0.2.9",
"from": "async@0.2.9",
"resolved": "https://registry.npmjs.org/async/-/async-0.2.9.tgz"
},
"chalk": {
"version": "0.4.0",
"from": "chalk@0.4.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-0.4.0.tgz",
"dependencies": {
"has-color": {
"version": "0.1.7",
"from": "has-color@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz"
},
"ansi-styles": {
"version": "1.0.0",
"from": "ansi-styles@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.0.0.tgz"
},
"strip-ansi": {
"version": "0.1.1",
"from": "strip-ansi@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz"
}
}
},
"createerror": {
"version": "0.4.1",
"from": "createerror@0.4.1",
"resolved": "https://registry.npmjs.org/createerror/-/createerror-0.4.1.tgz"
},
"cssmin": {
"version": "0.3.1",
"from": "cssmin@0.3.1",
"resolved": "https://registry.npmjs.org/cssmin/-/cssmin-0.3.1.tgz"
},
"cssom-papandreou": {
"version": "0.2.4-patch6",
"from": "cssom-papandreou@0.2.4-patch6",
"resolved": "https://registry.npmjs.org/cssom-papandreou/-/cssom-papandreou-0.2.4-patch6.tgz"
},
"deep-extend": {
"version": "0.2.11",
"from": "deep-extend@0.2.11",
"resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.2.11.tgz"
},
"glob": {
"version": "4.2.1",
"from": "glob@4.2.1",
"resolved": "https://registry.npmjs.org/glob/-/glob-4.2.1.tgz",
"dependencies": {
"inflight": {
"version": "1.0.4",
"from": "inflight@>=1.0.4 <2.0.0",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz",
"dependencies": {
"wrappy": {
"version": "1.0.1",
"from": "wrappy@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz"
}
}
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
},
"minimatch": {
"version": "1.0.0",
"from": "minimatch@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-1.0.0.tgz",
"dependencies": {
"lru-cache": {
"version": "2.5.0",
"from": "lru-cache@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz"
},
"sigmund": {
"version": "1.0.0",
"from": "sigmund@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz"
}
}
},
"once": {
"version": "1.3.1",
"from": "once@>=1.3.0 <2.0.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.3.1.tgz",
"dependencies": {
"wrappy": {
"version": "1.0.1",
"from": "wrappy@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz"
}
}
}
}
},
"html-minifier": {
"version": "0.6.8",
"from": "html-minifier@0.6.8",
"resolved": "https://registry.npmjs.org/html-minifier/-/html-minifier-0.6.8.tgz",
"dependencies": {
"change-case": {
"version": "2.1.5",
"from": "change-case@>=2.1.0 <2.2.0",
"resolved": "https://registry.npmjs.org/change-case/-/change-case-2.1.5.tgz",
"dependencies": {
"camel-case": {
"version": "1.0.2",
"from": "camel-case@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/camel-case/-/camel-case-1.0.2.tgz"
},
"constant-case": {
"version": "1.0.0",
"from": "constant-case@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/constant-case/-/constant-case-1.0.0.tgz"
},
"dot-case": {
"version": "1.0.1",
"from": "dot-case@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/dot-case/-/dot-case-1.0.1.tgz"
},
"is-lower-case": {
"version": "1.0.0",
"from": "is-lower-case@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/is-lower-case/-/is-lower-case-1.0.0.tgz"
},
"is-upper-case": {
"version": "1.0.1",
"from": "is-upper-case@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/is-upper-case/-/is-upper-case-1.0.1.tgz"
},
"lower-case": {
"version": "1.0.2",
"from": "lower-case@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/lower-case/-/lower-case-1.0.2.tgz"
},
"param-case": {
"version": "1.0.1",
"from": "param-case@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/param-case/-/param-case-1.0.1.tgz"
},
"pascal-case": {
"version": "1.0.0",
"from": "pascal-case@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-1.0.0.tgz"
},
"path-case": {
"version": "1.0.1",
"from": "path-case@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/path-case/-/path-case-1.0.1.tgz"
},
"sentence-case": {
"version": "1.1.0",
"from": "sentence-case@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/sentence-case/-/sentence-case-1.1.0.tgz"
},
"snake-case": {
"version": "1.0.1",
"from": "snake-case@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/snake-case/-/snake-case-1.0.1.tgz"
},
"swap-case": {
"version": "1.0.2",
"from": "swap-case@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/swap-case/-/swap-case-1.0.2.tgz"
},
"title-case": {
"version": "1.0.1",
"from": "title-case@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/title-case/-/title-case-1.0.1.tgz"
},
"upper-case": {
"version": "1.0.3",
"from": "upper-case@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/upper-case/-/upper-case-1.0.3.tgz"
},
"upper-case-first": {
"version": "1.0.1",
"from": "upper-case-first@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/upper-case-first/-/upper-case-first-1.0.1.tgz"
}
}
},
"clean-css": {
"version": "2.2.20",
"from": "clean-css@>=2.2.0 <2.3.0",
"resolved": "https://registry.npmjs.org/clean-css/-/clean-css-2.2.20.tgz",
"dependencies": {
"commander": {
"version": "2.2.0",
"from": "commander@>=2.2.0 <2.3.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.2.0.tgz"
}
}
},
"cli": {
"version": "0.6.5",
"from": "cli@>=0.6.0 <0.7.0",
"resolved": "https://registry.npmjs.org/cli/-/cli-0.6.5.tgz",
"dependencies": {
"glob": {
"version": "3.2.11",
"from": "glob@>=3.2.1 <3.3.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-3.2.11.tgz",
"dependencies": {
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
},
"minimatch": {
"version": "0.3.0",
"from": "minimatch@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz",
"dependencies": {
"lru-cache": {
"version": "2.5.0",
"from": "lru-cache@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz"
},
"sigmund": {
"version": "1.0.0",
"from": "sigmund@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz"
}
}
}
}
},
"exit": {
"version": "0.1.2",
"from": "exit@0.1.2",
"resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz"
}
}
},
"uglify-js": {
"version": "2.4.15",
"from": "uglify-js@>=2.4.0 <2.5.0",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.4.15.tgz",
"dependencies": {
"source-map": {
"version": "0.1.34",
"from": "source-map@0.1.34",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.34.tgz",
"dependencies": {
"amdefine": {
"version": "0.1.0",
"from": "amdefine@>=0.0.4",
"resolved": "https://registry.npmjs.org/amdefine/-/amdefine-0.1.0.tgz"
}
}
},
"optimist": {
"version": "0.3.7",
"from": "optimist@>=0.3.5 <0.4.0",
"resolved": "https://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz",
"dependencies": {
"wordwrap": {
"version": "0.0.2",
"from": "wordwrap@>=0.0.2 <0.1.0",
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz"
}
}
},
"uglify-to-browserify": {
"version": "1.0.2",
"from": "uglify-to-browserify@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz"
}
}
},
"relateurl": {
"version": "0.2.5",
"from": "relateurl@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.5.tgz"
}
}
},
"httperrors": {
"version": "0.2.0",
"from": "httperrors@0.2.0",
"resolved": "https://registry.npmjs.org/httperrors/-/httperrors-0.2.0.tgz",
"dependencies": {
"createerror": {
"version": "0.0.1",
"from": "createerror@0.0.1",
"resolved": "https://registry.npmjs.org/createerror/-/createerror-0.0.1.tgz",
"dependencies": {
"xtend": {
"version": "1.0.3",
"from": "xtend@1.0.3",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-1.0.3.tgz"
}
}
}
}
},
"imageinfo": {
"version": "1.0.4",
"from": "imageinfo@1.0.4",
"resolved": "https://registry.npmjs.org/imageinfo/-/imageinfo-1.0.4.tgz"
},
"jsdom": {
"version": "0.11.0",
"from": "jsdom@0.11.0",
"resolved": "https://registry.npmjs.org/jsdom/-/jsdom-0.11.0.tgz",
"dependencies": {
"htmlparser2": {
"version": "3.8.2",
"from": "htmlparser2@>=3.1.5 <4.0.0",
"resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.2.tgz",
"dependencies": {
"domhandler": {
"version": "2.3.0",
"from": "domhandler@>=2.3.0 <2.4.0",
"resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.3.0.tgz"
},
"domutils": {
"version": "1.5.0",
"from": "domutils@>=1.5.0 <1.6.0",
"resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.0.tgz"
},
"domelementtype": {
"version": "1.1.3",
"from": "domelementtype@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz"
},
"readable-stream": {
"version": "1.1.13",
"from": "readable-stream@>=1.1.0 <1.2.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.13.tgz",
"dependencies": {
"core-util-is": {
"version": "1.0.1",
"from": "core-util-is@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
},
"isarray": {
"version": "0.0.1",
"from": "isarray@0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
},
"string_decoder": {
"version": "0.10.31",
"from": "string_decoder@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
}
}
},
"entities": {
"version": "1.0.0",
"from": "entities@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz"
}
}
},
"nwmatcher": {
"version": "1.3.3",
"from": "nwmatcher@>=1.3.2 <1.4.0",
"resolved": "https://registry.npmjs.org/nwmatcher/-/nwmatcher-1.3.3.tgz"
},
"xmlhttprequest": {
"version": "1.6.0",
"from": "xmlhttprequest@>=1.5.0",
"resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.6.0.tgz"
},
"cssom": {
"version": "0.3.0",
"from": "cssom@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.0.tgz"
},
"cssstyle": {
"version": "0.2.22",
"from": "cssstyle@>=0.2.9 <0.3.0",
"resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-0.2.22.tgz"
},
"contextify": {
"version": "0.1.9",
"from": "contextify@>=0.1.5 <0.2.0",
"resolved": "https://registry.npmjs.org/contextify/-/contextify-0.1.9.tgz",
"dependencies": {
"bindings": {
"version": "1.2.1",
"from": "bindings@*",
"resolved": "https://registry.npmjs.org/bindings/-/bindings-1.2.1.tgz"
},
"nan": {
"version": "1.3.0",
"from": "nan@>=1.3.0 <1.4.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-1.3.0.tgz"
}
}
}
}
},
"minimize": {
"version": "0.7.6",
"from": "minimize@0.7.6",
"resolved": "https://registry.npmjs.org/minimize/-/minimize-0.7.6.tgz",
"dependencies": {
"htmlparser2": {
"version": "3.7.3",
"from": "htmlparser2@>=3.7.0 <3.8.0",
"resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.7.3.tgz",
"dependencies": {
"domhandler": {
"version": "2.2.1",
"from": "domhandler@>=2.2.0 <2.3.0",
"resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.2.1.tgz"
},
"domutils": {
"version": "1.5.0",
"from": "domutils@>=1.5.0 <1.6.0",
"resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.0.tgz"
},
"domelementtype": {
"version": "1.1.3",
"from": "domelementtype@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz"
},
"readable-stream": {
"version": "1.1.13",
"from": "readable-stream@>=1.1.9 <1.2.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.13.tgz",
"dependencies": {
"core-util-is": {
"version": "1.0.1",
"from": "core-util-is@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
},
"isarray": {
"version": "0.0.1",
"from": "isarray@0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
},
"string_decoder": {
"version": "0.10.31",
"from": "string_decoder@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
}
}
},
"entities": {
"version": "1.0.0",
"from": "entities@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz"
}
}
},
"utile": {
"version": "0.2.1",
"from": "utile@>=0.2.1 <0.3.0",
"resolved": "https://registry.npmjs.org/utile/-/utile-0.2.1.tgz",
"dependencies": {
"deep-equal": {
"version": "0.2.1",
"from": "deep-equal@*",
"resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-0.2.1.tgz"
},
"i": {
"version": "0.3.2",
"from": "i@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/i/-/i-0.3.2.tgz"
},
"ncp": {
"version": "0.4.2",
"from": "ncp@>=0.4.0 <0.5.0",
"resolved": "https://registry.npmjs.org/ncp/-/ncp-0.4.2.tgz"
},
"rimraf": {
"version": "2.2.8",
"from": "rimraf@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz"
}
}
}
}
},
"mkdirp": {
"version": "0.3.5",
"from": "mkdirp@0.3.5",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz"
},
"normalizeurl": {
"version": "0.1.3",
"from": "normalizeurl@0.1.3",
"resolved": "https://registry.npmjs.org/normalizeurl/-/normalizeurl-0.1.3.tgz"
},
"optimist": {
"version": "0.6.1",
"from": "optimist@0.6.1",
"resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz",
"dependencies": {
"wordwrap": {
"version": "0.0.2",
"from": "wordwrap@>=0.0.2 <0.1.0",
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz"
},
"minimist": {
"version": "0.0.10",
"from": "minimist@0.0.10",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz"
}
}
},
"passerror": {
"version": "1.0.1",
"from": "passerror@1.0.1",
"resolved": "https://registry.npmjs.org/passerror/-/passerror-1.0.1.tgz"
},
"request": {
"version": "2.9.153",
"from": "request@2.9.153",
"resolved": "https://registry.npmjs.org/request/-/request-2.9.153.tgz"
},
"seq": {
"version": "0.3.5",
"from": "seq@0.3.5",
"resolved": "https://registry.npmjs.org/seq/-/seq-0.3.5.tgz",
"dependencies": {
"chainsaw": {
"version": "0.0.9",
"from": "chainsaw@0.0.9",
"resolved": "https://registry.npmjs.org/chainsaw/-/chainsaw-0.0.9.tgz",
"dependencies": {
"traverse": {
"version": "0.3.9",
"from": "traverse@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/traverse/-/traverse-0.3.9.tgz"
}
}
},
"hashish": {
"version": "0.0.4",
"from": "hashish@>=0.0.2 <0.1.0",
"resolved": "https://registry.npmjs.org/hashish/-/hashish-0.0.4.tgz",
"dependencies": {
"traverse": {
"version": "0.6.6",
"from": "traverse@>=0.2.4",
"resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz"
}
}
}
}
},
"setimmediate": {
"version": "1.0.2",
"from": "setimmediate@1.0.2",
"resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.2.tgz"
},
"source-map": {
"version": "0.1.33",
"from": "source-map@0.1.33",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.33.tgz",
"dependencies": {
"amdefine": {
"version": "0.1.0",
"from": "amdefine@>=0.0.4",
"resolved": "https://registry.npmjs.org/amdefine/-/amdefine-0.1.0.tgz"
}
}
},
"uglify-js-papandreou": {
"version": "2.4.13-patch1",
"from": "uglify-js-papandreou@2.4.13-patch1",
"resolved": "https://registry.npmjs.org/uglify-js-papandreou/-/uglify-js-papandreou-2.4.13-patch1.tgz",
"dependencies": {
"async": {
"version": "0.2.10",
"from": "async@0.2.10",
"resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz"
},
"source-map": {
"version": "0.1.40",
"from": "source-map@0.1.40",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.40.tgz",
"dependencies": {
"amdefine": {
"version": "0.1.0",
"from": "amdefine@>=0.0.4",
"resolved": "https://registry.npmjs.org/amdefine/-/amdefine-0.1.0.tgz"
}
}
},
"optimist": {
"version": "0.3.7",
"from": "optimist@0.3.7",
"resolved": "https://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz",
"dependencies": {
"wordwrap": {
"version": "0.0.2",
"from": "wordwrap@>=0.0.1 <0.1.0",
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz"
}
}
},
"uglify-to-browserify": {
"version": "1.0.2",
"from": "uglify-to-browserify@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz"
}
}
},
"uglifyast": {
"version": "0.3.1",
"from": "uglifyast@0.3.1",
"resolved": "https://registry.npmjs.org/uglifyast/-/uglifyast-0.3.1.tgz"
},
"urltools": {
"version": "0.2.0",
"from": "urltools@0.2.0",
"resolved": "https://registry.npmjs.org/urltools/-/urltools-0.2.0.tgz",
"dependencies": {
"underscore": {
"version": "1.5.2",
"from": "underscore@1.5.2",
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.5.2.tgz"
},
"glob": {
"version": "3.2.11",
"from": "glob@3.2.11",
"resolved": "https://registry.npmjs.org/glob/-/glob-3.2.11.tgz",
"dependencies": {
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
},
"minimatch": {
"version": "0.3.0",
"from": "minimatch@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz",
"dependencies": {
"lru-cache": {
"version": "2.5.0",
"from": "lru-cache@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz"
},
"sigmund": {
"version": "1.0.0",
"from": "sigmund@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz"
}
}
}
}
}
}
},
"xmldom": {
"version": "0.1.19",
"from": "xmldom@0.1.19",
"resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.19.tgz"
}
}
},
"assetgraph-builder": {
"version": "2.7.0",
"from": "assetgraph-builder@>=2.5.1 <3.0.0",
"resolved": "https://registry.npmjs.org/assetgraph-builder/-/assetgraph-builder-2.7.0.tgz",
"dependencies": {
"async": {
"version": "0.2.9",
"from": "async@0.2.9",
"resolved": "https://registry.npmjs.org/async/-/async-0.2.9.tgz"
},
"chalk": {
"version": "0.4.0",
"from": "chalk@0.4.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-0.4.0.tgz",
"dependencies": {
"has-color": {
"version": "0.1.7",
"from": "has-color@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz"
},
"ansi-styles": {
"version": "1.0.0",
"from": "ansi-styles@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.0.0.tgz"
},
"strip-ansi": {
"version": "0.1.1",
"from": "strip-ansi@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz"
}
}
},
"express-processimage": {
"version": "1.3.1",
"from": "express-processimage@1.3.1",
"resolved": "https://registry.npmjs.org/express-processimage/-/express-processimage-1.3.1.tgz",
"dependencies": {
"express-hijackresponse": {
"version": "0.0.7",
"from": "express-hijackresponse@0.0.7",
"resolved": "https://registry.npmjs.org/express-hijackresponse/-/express-hijackresponse-0.0.7.tgz"
},
"gm": {
"version": "1.6.1",
"from": "gm@1.6.1",
"resolved": "https://registry.npmjs.org/gm/-/gm-1.6.1.tgz",
"dependencies": {
"debug": {
"version": "0.7.0",
"from": "debug@0.7.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-0.7.0.tgz"
}
}
},
"inkscape": {
"version": "0.0.5",
"from": "inkscape@0.0.5",
"resolved": "https://registry.npmjs.org/inkscape/-/inkscape-0.0.5.tgz",
"dependencies": {
"gettemporaryfilepath": {
"version": "0.0.1",
"from": "gettemporaryfilepath@0.0.1",
"resolved": "https://registry.npmjs.org/gettemporaryfilepath/-/gettemporaryfilepath-0.0.1.tgz"
}
}
},
"optimist": {
"version": "0.6.1",
"from": "optimist@0.6.1",
"resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz",
"dependencies": {
"wordwrap": {
"version": "0.0.2",
"from": "wordwrap@>=0.0.2 <0.1.0",
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz"
},
"minimist": {
"version": "0.0.10",
"from": "minimist@>=0.0.1 <0.1.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz"
}
}
},
"optipng": {
"version": "0.1.1",
"from": "optipng@0.1.1",
"resolved": "https://registry.npmjs.org/optipng/-/optipng-0.1.1.tgz",
"dependencies": {
"gettemporaryfilepath": {
"version": "0.0.1",
"from": "gettemporaryfilepath@0.0.1",
"resolved": "https://registry.npmjs.org/gettemporaryfilepath/-/gettemporaryfilepath-0.0.1.tgz"
},
"memoizeasync": {
"version": "0.0.1",
"from": "memoizeasync@0.0.1",
"resolved": "https://registry.npmjs.org/memoizeasync/-/memoizeasync-0.0.1.tgz"
},
"optipng-bin": {
"version": "0.1.0",
"from": "optipng-bin@0.1.0",
"resolved": "https://registry.npmjs.org/optipng-bin/-/optipng-bin-0.1.0.tgz"
},
"which": {
"version": "1.0.5",
"from": "which@1.0.5",
"resolved": "https://registry.npmjs.org/which/-/which-1.0.5.tgz"
}
}
},
"passerror": {
"version": "0.0.1",
"from": "passerror@0.0.1",
"resolved": "https://registry.npmjs.org/passerror/-/passerror-0.0.1.tgz"
},
"pngcrush": {
"version": "0.1.0",
"from": "pngcrush@0.1.0",
"resolved": "https://registry.npmjs.org/pngcrush/-/pngcrush-0.1.0.tgz",
"dependencies": {
"gettemporaryfilepath": {
"version": "0.0.1",
"from": "gettemporaryfilepath@0.0.1",
"resolved": "https://registry.npmjs.org/gettemporaryfilepath/-/gettemporaryfilepath-0.0.1.tgz"
}
}
},
"pngquant": {
"version": "0.3.0",
"from": "pngquant@0.3.0",
"resolved": "https://registry.npmjs.org/pngquant/-/pngquant-0.3.0.tgz",
"dependencies": {
"pngquant-bin": {
"version": "2.0.0",
"from": "pngquant-bin@2.0.0",
"resolved": "https://registry.npmjs.org/pngquant-bin/-/pngquant-bin-2.0.0.tgz",
"dependencies": {
"bin-build": {
"version": "2.1.0",
"from": "bin-build@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/bin-build/-/bin-build-2.1.0.tgz",
"dependencies": {
"download": {
"version": "3.1.2",
"from": "download@>=3.0.1 <4.0.0",
"resolved": "https://registry.npmjs.org/download/-/download-3.1.2.tgz",
"dependencies": {
"concat-stream": {
"version": "1.4.7",
"from": "concat-stream@>=1.4.6 <2.0.0",
"resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.4.7.tgz",
"dependencies": {
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
},
"typedarray": {
"version": "0.0.6",
"from": "typedarray@>=0.0.5 <0.1.0",
"resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz"
},
"readable-stream": {
"version": "1.1.13",
"from": "readable-stream@>=1.1.9 <1.2.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.13.tgz",
"dependencies": {
"core-util-is": {
"version": "1.0.1",
"from": "core-util-is@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
},
"isarray": {
"version": "0.0.1",
"from": "isarray@0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
},
"string_decoder": {
"version": "0.10.31",
"from": "string_decoder@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
}
}
}
}
},
"decompress-tar": {
"version": "2.0.2",
"from": "decompress-tar@>=2.0.1 <3.0.0",
"resolved": "https://registry.npmjs.org/decompress-tar/-/decompress-tar-2.0.2.tgz",
"dependencies": {
"is-tar": {
"version": "1.0.0",
"from": "is-tar@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/is-tar/-/is-tar-1.0.0.tgz"
},
"strip-dirs": {
"version": "0.1.1",
"from": "strip-dirs@>=0.1.1 <0.2.0",
"resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-0.1.1.tgz",
"dependencies": {
"chalk": {
"version": "0.5.1",
"from": "chalk@>=0.5.1 <0.6.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-0.5.1.tgz",
"dependencies": {
"ansi-styles": {
"version": "1.1.0",
"from": "ansi-styles@>=1.1.0 <2.0.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.1.0.tgz"
},
"escape-string-regexp": {
"version": "1.0.2",
"from": "escape-string-regexp@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz"
},
"has-ansi": {
"version": "0.1.0",
"from": "has-ansi@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-0.1.0.tgz",
"dependencies": {
"ansi-regex": {
"version": "0.2.1",
"from": "ansi-regex@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz"
}
}
},
"strip-ansi": {
"version": "0.3.0",
"from": "strip-ansi@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.3.0.tgz",
"dependencies": {
"ansi-regex": {
"version": "0.2.1",
"from": "ansi-regex@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz"
}
}
},
"supports-color": {
"version": "0.2.0",
"from": "supports-color@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-0.2.0.tgz"
}
}
},
"is-absolute": {
"version": "0.1.5",
"from": "is-absolute@>=0.1.4 <0.2.0",
"resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-0.1.5.tgz",
"dependencies": {
"is-relative": {
"version": "0.1.3",
"from": "is-relative@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/is-relative/-/is-relative-0.1.3.tgz"
}
}
},
"is-integer": {
"version": "1.0.3",
"from": "is-integer@>=1.0.3 <2.0.0",
"resolved": "https://registry.npmjs.org/is-integer/-/is-integer-1.0.3.tgz"
},
"minimist": {
"version": "1.1.0",
"from": "minimist@>=1.1.0 <2.0.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.1.0.tgz"
}
}
},
"tar-stream": {
"version": "0.4.7",
"from": "tar-stream@>=0.4.5 <0.5.0",
"resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-0.4.7.tgz",
"dependencies": {
"bl": {
"version": "0.9.3",
"from": "bl@>=0.9.0 <0.10.0",
"resolved": "https://registry.npmjs.org/bl/-/bl-0.9.3.tgz"
},
"end-of-stream": {
"version": "1.1.0",
"from": "end-of-stream@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.1.0.tgz",
"dependencies": {
"once": {
"version": "1.3.1",
"from": "once@>=1.3.0 <1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.3.1.tgz",
"dependencies": {
"wrappy": {
"version": "1.0.1",
"from": "wrappy@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz"
}
}
}
}
},
"readable-stream": {
"version": "1.0.33",
"from": "readable-stream@>=1.0.27-1 <2.0.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz",
"dependencies": {
"core-util-is": {
"version": "1.0.1",
"from": "core-util-is@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
},
"isarray": {
"version": "0.0.1",
"from": "isarray@0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
},
"string_decoder": {
"version": "0.10.31",
"from": "string_decoder@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
}
}
},
"xtend": {
"version": "4.0.0",
"from": "xtend@>=4.0.0 <5.0.0",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.0.tgz"
}
}
}
}
},
"decompress-tarbz2": {
"version": "2.0.2",
"from": "decompress-tarbz2@>=2.0.1 <3.0.0",
"resolved": "https://registry.npmjs.org/decompress-tarbz2/-/decompress-tarbz2-2.0.2.tgz",
"dependencies": {
"is-bzip2": {
"version": "1.0.0",
"from": "is-bzip2@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/is-bzip2/-/is-bzip2-1.0.0.tgz"
},
"seek-bzip": {
"version": "1.0.4",
"from": "seek-bzip@>=1.0.3 <2.0.0",
"resolved": "https://registry.npmjs.org/seek-bzip/-/seek-bzip-1.0.4.tgz",
"dependencies": {
"commander": {
"version": "2.4.0",
"from": "commander@>=2.4.0 <2.5.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.4.0.tgz"
}
}
},
"strip-dirs": {
"version": "0.1.1",
"from": "strip-dirs@>=0.1.1 <0.2.0",
"resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-0.1.1.tgz",
"dependencies": {
"chalk": {
"version": "0.5.1",
"from": "chalk@>=0.5.1 <0.6.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-0.5.1.tgz",
"dependencies": {
"ansi-styles": {
"version": "1.1.0",
"from": "ansi-styles@>=1.1.0 <2.0.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.1.0.tgz"
},
"escape-string-regexp": {
"version": "1.0.2",
"from": "escape-string-regexp@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz"
},
"has-ansi": {
"version": "0.1.0",
"from": "has-ansi@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-0.1.0.tgz",
"dependencies": {
"ansi-regex": {
"version": "0.2.1",
"from": "ansi-regex@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz"
}
}
},
"strip-ansi": {
"version": "0.3.0",
"from": "strip-ansi@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.3.0.tgz",
"dependencies": {
"ansi-regex": {
"version": "0.2.1",
"from": "ansi-regex@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz"
}
}
},
"supports-color": {
"version": "0.2.0",
"from": "supports-color@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-0.2.0.tgz"
}
}
},
"is-absolute": {
"version": "0.1.5",
"from": "is-absolute@>=0.1.4 <0.2.0",
"resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-0.1.5.tgz",
"dependencies": {
"is-relative": {
"version": "0.1.3",
"from": "is-relative@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/is-relative/-/is-relative-0.1.3.tgz"
}
}
},
"is-integer": {
"version": "1.0.3",
"from": "is-integer@>=1.0.3 <2.0.0",
"resolved": "https://registry.npmjs.org/is-integer/-/is-integer-1.0.3.tgz"
},
"minimist": {
"version": "1.1.0",
"from": "minimist@>=1.1.0 <2.0.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.1.0.tgz"
}
}
},
"tar-stream": {
"version": "0.4.7",
"from": "tar-stream@>=0.4.5 <0.5.0",
"resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-0.4.7.tgz",
"dependencies": {
"bl": {
"version": "0.9.3",
"from": "bl@>=0.9.0 <0.10.0",
"resolved": "https://registry.npmjs.org/bl/-/bl-0.9.3.tgz"
},
"end-of-stream": {
"version": "1.1.0",
"from": "end-of-stream@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.1.0.tgz",
"dependencies": {
"once": {
"version": "1.3.1",
"from": "once@>=1.3.0 <1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.3.1.tgz",
"dependencies": {
"wrappy": {
"version": "1.0.1",
"from": "wrappy@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz"
}
}
}
}
},
"readable-stream": {
"version": "1.0.33",
"from": "readable-stream@>=1.0.27-1 <2.0.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz",
"dependencies": {
"core-util-is": {
"version": "1.0.1",
"from": "core-util-is@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
},
"isarray": {
"version": "0.0.1",
"from": "isarray@0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
},
"string_decoder": {
"version": "0.10.31",
"from": "string_decoder@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
}
}
},
"xtend": {
"version": "4.0.0",
"from": "xtend@>=4.0.0 <5.0.0",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.0.tgz"
}
}
}
}
},
"decompress-targz": {
"version": "2.0.2",
"from": "decompress-targz@>=2.0.1 <3.0.0",
"resolved": "https://registry.npmjs.org/decompress-targz/-/decompress-targz-2.0.2.tgz",
"dependencies": {
"is-gzip": {
"version": "1.0.0",
"from": "is-gzip@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/is-gzip/-/is-gzip-1.0.0.tgz"
},
"strip-dirs": {
"version": "0.1.1",
"from": "strip-dirs@>=0.1.1 <0.2.0",
"resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-0.1.1.tgz",
"dependencies": {
"chalk": {
"version": "0.5.1",
"from": "chalk@>=0.5.1 <0.6.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-0.5.1.tgz",
"dependencies": {
"ansi-styles": {
"version": "1.1.0",
"from": "ansi-styles@>=1.1.0 <2.0.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.1.0.tgz"
},
"escape-string-regexp": {
"version": "1.0.2",
"from": "escape-string-regexp@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz"
},
"has-ansi": {
"version": "0.1.0",
"from": "has-ansi@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-0.1.0.tgz",
"dependencies": {
"ansi-regex": {
"version": "0.2.1",
"from": "ansi-regex@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz"
}
}
},
"strip-ansi": {
"version": "0.3.0",
"from": "strip-ansi@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.3.0.tgz",
"dependencies": {
"ansi-regex": {
"version": "0.2.1",
"from": "ansi-regex@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz"
}
}
},
"supports-color": {
"version": "0.2.0",
"from": "supports-color@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-0.2.0.tgz"
}
}
},
"is-absolute": {
"version": "0.1.5",
"from": "is-absolute@>=0.1.4 <0.2.0",
"resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-0.1.5.tgz",
"dependencies": {
"is-relative": {
"version": "0.1.3",
"from": "is-relative@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/is-relative/-/is-relative-0.1.3.tgz"
}
}
},
"is-integer": {
"version": "1.0.3",
"from": "is-integer@>=1.0.3 <2.0.0",
"resolved": "https://registry.npmjs.org/is-integer/-/is-integer-1.0.3.tgz"
},
"minimist": {
"version": "1.1.0",
"from": "minimist@>=1.1.0 <2.0.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.1.0.tgz"
}
}
},
"tar-stream": {
"version": "0.4.7",
"from": "tar-stream@>=0.4.5 <0.5.0",
"resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-0.4.7.tgz",
"dependencies": {
"bl": {
"version": "0.9.3",
"from": "bl@>=0.9.0 <0.10.0",
"resolved": "https://registry.npmjs.org/bl/-/bl-0.9.3.tgz"
},
"end-of-stream": {
"version": "1.1.0",
"from": "end-of-stream@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.1.0.tgz",
"dependencies": {
"once": {
"version": "1.3.1",
"from": "once@>=1.3.0 <1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.3.1.tgz",
"dependencies": {
"wrappy": {
"version": "1.0.1",
"from": "wrappy@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz"
}
}
}
}
},
"readable-stream": {
"version": "1.0.33",
"from": "readable-stream@>=1.0.27-1 <2.0.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz",
"dependencies": {
"core-util-is": {
"version": "1.0.1",
"from": "core-util-is@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
},
"isarray": {
"version": "0.0.1",
"from": "isarray@0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
},
"string_decoder": {
"version": "0.10.31",
"from": "string_decoder@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
}
}
},
"xtend": {
"version": "4.0.0",
"from": "xtend@>=4.0.0 <5.0.0",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.0.tgz"
}
}
}
}
},
"decompress-unzip": {
"version": "2.0.1",
"from": "decompress-unzip@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/decompress-unzip/-/decompress-unzip-2.0.1.tgz",
"dependencies": {
"adm-zip": {
"version": "0.4.4",
"from": "adm-zip@>=0.4.4 <0.5.0",
"resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.4.tgz"
},
"is-zip": {
"version": "1.0.0",
"from": "is-zip@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/is-zip/-/is-zip-1.0.0.tgz"
},
"strip-dirs": {
"version": "0.1.1",
"from": "strip-dirs@>=0.1.1 <0.2.0",
"resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-0.1.1.tgz",
"dependencies": {
"chalk": {
"version": "0.5.1",
"from": "chalk@>=0.5.1 <0.6.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-0.5.1.tgz",
"dependencies": {
"ansi-styles": {
"version": "1.1.0",
"from": "ansi-styles@>=1.1.0 <2.0.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.1.0.tgz"
},
"escape-string-regexp": {
"version": "1.0.2",
"from": "escape-string-regexp@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz"
},
"has-ansi": {
"version": "0.1.0",
"from": "has-ansi@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-0.1.0.tgz",
"dependencies": {
"ansi-regex": {
"version": "0.2.1",
"from": "ansi-regex@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz"
}
}
},
"strip-ansi": {
"version": "0.3.0",
"from": "strip-ansi@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.3.0.tgz",
"dependencies": {
"ansi-regex": {
"version": "0.2.1",
"from": "ansi-regex@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz"
}
}
},
"supports-color": {
"version": "0.2.0",
"from": "supports-color@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-0.2.0.tgz"
}
}
},
"is-absolute": {
"version": "0.1.5",
"from": "is-absolute@>=0.1.4 <0.2.0",
"resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-0.1.5.tgz",
"dependencies": {
"is-relative": {
"version": "0.1.3",
"from": "is-relative@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/is-relative/-/is-relative-0.1.3.tgz"
}
}
},
"is-integer": {
"version": "1.0.3",
"from": "is-integer@>=1.0.3 <2.0.0",
"resolved": "https://registry.npmjs.org/is-integer/-/is-integer-1.0.3.tgz"
},
"minimist": {
"version": "1.1.0",
"from": "minimist@>=1.1.0 <2.0.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.1.0.tgz"
}
}
},
"temp-write": {
"version": "1.1.0",
"from": "temp-write@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/temp-write/-/temp-write-1.1.0.tgz",
"dependencies": {
"graceful-fs": {
"version": "3.0.5",
"from": "graceful-fs@>=3.0.2 <4.0.0",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.5.tgz"
},
"mkdirp": {
"version": "0.5.0",
"from": "mkdirp@>=0.5.0 <0.6.0",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz",
"dependencies": {
"minimist": {
"version": "0.0.8",
"from": "minimist@0.0.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz"
}
}
},
"uuid": {
"version": "2.0.1",
"from": "uuid@>=2.0.1 <3.0.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz"
}
}
}
}
},
"download-status": {
"version": "2.1.0",
"from": "download-status@>=2.0.1 <3.0.0",
"resolved": "https://registry.npmjs.org/download-status/-/download-status-2.1.0.tgz",
"dependencies": {
"chalk": {
"version": "0.5.1",
"from": "chalk@>=0.5.1 <0.6.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-0.5.1.tgz",
"dependencies": {
"ansi-styles": {
"version": "1.1.0",
"from": "ansi-styles@>=1.1.0 <2.0.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.1.0.tgz"
},
"escape-string-regexp": {
"version": "1.0.2",
"from": "escape-string-regexp@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz"
},
"has-ansi": {
"version": "0.1.0",
"from": "has-ansi@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-0.1.0.tgz",
"dependencies": {
"ansi-regex": {
"version": "0.2.1",
"from": "ansi-regex@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz"
}
}
},
"strip-ansi": {
"version": "0.3.0",
"from": "strip-ansi@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.3.0.tgz",
"dependencies": {
"ansi-regex": {
"version": "0.2.1",
"from": "ansi-regex@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz"
}
}
},
"supports-color": {
"version": "0.2.0",
"from": "supports-color@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-0.2.0.tgz"
}
}
},
"lpad-align": {
"version": "1.0.2",
"from": "lpad-align@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/lpad-align/-/lpad-align-1.0.2.tgz",
"dependencies": {
"longest": {
"version": "0.2.1",
"from": "longest@>=0.2.1 <0.3.0",
"resolved": "https://registry.npmjs.org/longest/-/longest-0.2.1.tgz"
},
"lpad": {
"version": "1.0.0",
"from": "lpad@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/lpad/-/lpad-1.0.0.tgz"
}
}
},
"object-assign": {
"version": "1.0.0",
"from": "object-assign@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-1.0.0.tgz"
},
"progress": {
"version": "1.1.8",
"from": "progress@>=1.1.8 <2.0.0",
"resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz"
}
}
},
"each-async": {
"version": "1.1.0",
"from": "each-async@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/each-async/-/each-async-1.1.0.tgz",
"dependencies": {
"onetime": {
"version": "1.0.0",
"from": "onetime@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/onetime/-/onetime-1.0.0.tgz"
},
"setimmediate": {
"version": "1.0.2",
"from": "setimmediate@>=1.0.2 <2.0.0",
"resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.2.tgz"
}
}
},
"get-stdin": {
"version": "3.0.2",
"from": "get-stdin@>=3.0.0 <4.0.0",
"resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-3.0.2.tgz"
},
"gulp-rename": {
"version": "1.2.0",
"from": "gulp-rename@>=1.2.0 <2.0.0",
"resolved": "https://registry.npmjs.org/gulp-rename/-/gulp-rename-1.2.0.tgz"
},
"meow": {
"version": "1.0.0",
"from": "meow@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/meow/-/meow-1.0.0.tgz",
"dependencies": {
"camelcase-keys": {
"version": "1.0.0",
"from": "camelcase-keys@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-1.0.0.tgz",
"dependencies": {
"camelcase": {
"version": "1.0.2",
"from": "camelcase@>=1.0.1 <2.0.0",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.0.2.tgz"
},
"map-obj": {
"version": "1.0.0",
"from": "map-obj@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.0.tgz"
}
}
},
"indent-string": {
"version": "1.2.0",
"from": "indent-string@>=1.1.0 <2.0.0",
"resolved": "https://registry.npmjs.org/indent-string/-/indent-string-1.2.0.tgz",
"dependencies": {
"repeating": {
"version": "1.1.0",
"from": "repeating@>=1.1.0 <2.0.0",
"resolved": "https://registry.npmjs.org/repeating/-/repeating-1.1.0.tgz",
"dependencies": {
"is-finite": {
"version": "1.0.0",
"from": "is-finite@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.0.tgz"
}
}
}
}
},
"minimist": {
"version": "1.1.0",
"from": "minimist@>=1.1.0 <2.0.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.1.0.tgz"
},
"object-assign": {
"version": "1.0.0",
"from": "object-assign@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-1.0.0.tgz"
}
}
},
"rc": {
"version": "0.5.4",
"from": "rc@>=0.5.1 <0.6.0",
"resolved": "https://registry.npmjs.org/rc/-/rc-0.5.4.tgz",
"dependencies": {
"minimist": {
"version": "0.0.10",
"from": "minimist@>=0.0.7 <0.1.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz"
},
"deep-extend": {
"version": "0.2.11",
"from": "deep-extend@>=0.2.5 <0.3.0",
"resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.2.11.tgz"
},
"strip-json-comments": {
"version": "0.1.3",
"from": "strip-json-comments@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-0.1.3.tgz"
},
"ini": {
"version": "1.1.0",
"from": "ini@>=1.1.0 <1.2.0",
"resolved": "https://registry.npmjs.org/ini/-/ini-1.1.0.tgz"
}
}
},
"request": {
"version": "2.49.0",
"from": "request@>=2.34.0 <3.0.0",
"resolved": "https://registry.npmjs.org/request/-/request-2.49.0.tgz",
"dependencies": {
"bl": {
"version": "0.9.3",
"from": "bl@>=0.9.0 <0.10.0",
"resolved": "https://registry.npmjs.org/bl/-/bl-0.9.3.tgz",
"dependencies": {
"readable-stream": {
"version": "1.0.33",
"from": "readable-stream@>=1.0.26 <1.1.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz",
"dependencies": {
"core-util-is": {
"version": "1.0.1",
"from": "core-util-is@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
},
"isarray": {
"version": "0.0.1",
"from": "isarray@0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
},
"string_decoder": {
"version": "0.10.31",
"from": "string_decoder@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
}
}
}
}
},
"caseless": {
"version": "0.8.0",
"from": "caseless@>=0.8.0 <0.9.0",
"resolved": "https://registry.npmjs.org/caseless/-/caseless-0.8.0.tgz"
},
"forever-agent": {
"version": "0.5.2",
"from": "forever-agent@>=0.5.0 <0.6.0",
"resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.5.2.tgz"
},
"form-data": {
"version": "0.1.4",
"from": "form-data@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-0.1.4.tgz",
"dependencies": {
"mime": {
"version": "1.2.11",
"from": "mime@>=1.2.11 <1.3.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz"
},
"async": {
"version": "0.9.0",
"from": "async@>=0.9.0 <0.10.0",
"resolved": "https://registry.npmjs.org/async/-/async-0.9.0.tgz"
}
}
},
"json-stringify-safe": {
"version": "5.0.0",
"from": "json-stringify-safe@>=5.0.0 <5.1.0",
"resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.0.tgz"
},
"mime-types": {
"version": "1.0.2",
"from": "mime-types@>=1.0.1 <1.1.0",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-1.0.2.tgz"
},
"node-uuid": {
"version": "1.4.2",
"from": "node-uuid@>=1.4.0 <1.5.0",
"resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.2.tgz"
},
"qs": {
"version": "2.3.3",
"from": "qs@>=2.3.1 <2.4.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-2.3.3.tgz"
},
"tunnel-agent": {
"version": "0.4.0",
"from": "tunnel-agent@>=0.4.0 <0.5.0",
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.0.tgz"
},
"tough-cookie": {
"version": "0.12.1",
"from": "tough-cookie@>=0.12.0",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-0.12.1.tgz",
"dependencies": {
"punycode": {
"version": "1.3.2",
"from": "punycode@>=0.2.0",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz"
}
}
},
"http-signature": {
"version": "0.10.0",
"from": "http-signature@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/http-signature/-/http-signature-0.10.0.tgz",
"dependencies": {
"assert-plus": {
"version": "0.1.2",
"from": "assert-plus@0.1.2",
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.2.tgz"
},
"asn1": {
"version": "0.1.11",
"from": "asn1@0.1.11",
"resolved": "https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz"
},
"ctype": {
"version": "0.5.2",
"from": "ctype@0.5.2",
"resolved": "https://registry.npmjs.org/ctype/-/ctype-0.5.2.tgz"
}
}
},
"oauth-sign": {
"version": "0.5.0",
"from": "oauth-sign@>=0.5.0 <0.6.0",
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.5.0.tgz"
},
"hawk": {
"version": "1.1.1",
"from": "hawk@1.1.1",
"resolved": "https://registry.npmjs.org/hawk/-/hawk-1.1.1.tgz",
"dependencies": {
"hoek": {
"version": "0.9.1",
"from": "hoek@>=0.9.0 <0.10.0",
"resolved": "https://registry.npmjs.org/hoek/-/hoek-0.9.1.tgz"
},
"boom": {
"version": "0.4.2",
"from": "boom@>=0.4.0 <0.5.0",
"resolved": "https://registry.npmjs.org/boom/-/boom-0.4.2.tgz"
},
"cryptiles": {
"version": "0.2.2",
"from": "cryptiles@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-0.2.2.tgz"
},
"sntp": {
"version": "0.2.4",
"from": "sntp@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/sntp/-/sntp-0.2.4.tgz"
}
}
},
"aws-sign2": {
"version": "0.5.0",
"from": "aws-sign2@>=0.5.0 <0.6.0",
"resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz"
},
"stringstream": {
"version": "0.0.4",
"from": "stringstream@>=0.0.4 <0.1.0",
"resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.4.tgz"
},
"combined-stream": {
"version": "0.0.7",
"from": "combined-stream@>=0.0.5 <0.1.0",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz",
"dependencies": {
"delayed-stream": {
"version": "0.0.5",
"from": "delayed-stream@0.0.5",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz"
}
}
}
}
},
"stream-combiner": {
"version": "0.2.1",
"from": "stream-combiner@>=0.2.1 <0.3.0",
"resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.2.1.tgz",
"dependencies": {
"duplexer": {
"version": "0.1.1",
"from": "duplexer@>=0.1.1 <0.2.0",
"resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz"
},
"through": {
"version": "2.3.6",
"from": "through@>=2.3.4 <2.4.0",
"resolved": "https://registry.npmjs.org/through/-/through-2.3.6.tgz"
}
}
},
"through2": {
"version": "0.6.3",
"from": "through2@>=0.6.1 <0.7.0",
"resolved": "https://registry.npmjs.org/through2/-/through2-0.6.3.tgz",
"dependencies": {
"readable-stream": {
"version": "1.0.33",
"from": "readable-stream@>=1.0.33-1 <1.1.0-0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz",
"dependencies": {
"core-util-is": {
"version": "1.0.1",
"from": "core-util-is@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
},
"isarray": {
"version": "0.0.1",
"from": "isarray@0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
},
"string_decoder": {
"version": "0.10.31",
"from": "string_decoder@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
}
}
},
"xtend": {
"version": "4.0.0",
"from": "xtend@>=4.0.0 <4.1.0-0",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.0.tgz"
}
}
},
"url-regex": {
"version": "1.0.4",
"from": "url-regex@>=1.0.3 <2.0.0",
"resolved": "https://registry.npmjs.org/url-regex/-/url-regex-1.0.4.tgz"
},
"vinyl": {
"version": "0.4.6",
"from": "vinyl@>=0.4.3 <0.5.0",
"resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.4.6.tgz",
"dependencies": {
"clone": {
"version": "0.2.0",
"from": "clone@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/clone/-/clone-0.2.0.tgz"
},
"clone-stats": {
"version": "0.0.1",
"from": "clone-stats@>=0.0.1 <0.0.2",
"resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-0.0.1.tgz"
}
}
},
"vinyl-fs": {
"version": "0.3.13",
"from": "vinyl-fs@>=0.3.7 <0.4.0",
"resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-0.3.13.tgz",
"dependencies": {
"defaults": {
"version": "1.0.0",
"from": "defaults@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.0.tgz",
"dependencies": {
"clone": {
"version": "0.1.19",
"from": "clone@>=0.1.5 <0.2.0",
"resolved": "https://registry.npmjs.org/clone/-/clone-0.1.19.tgz"
}
}
},
"glob-stream": {
"version": "3.1.18",
"from": "glob-stream@>=3.1.5 <4.0.0",
"resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-3.1.18.tgz",
"dependencies": {
"glob": {
"version": "4.3.1",
"from": "glob@>=4.3.1 <5.0.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-4.3.1.tgz",
"dependencies": {
"inflight": {
"version": "1.0.4",
"from": "inflight@>=1.0.4 <2.0.0",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz",
"dependencies": {
"wrappy": {
"version": "1.0.1",
"from": "wrappy@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz"
}
}
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
},
"once": {
"version": "1.3.1",
"from": "once@>=1.3.0 <2.0.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.3.1.tgz",
"dependencies": {
"wrappy": {
"version": "1.0.1",
"from": "wrappy@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz"
}
}
}
}
},
"minimatch": {
"version": "2.0.1",
"from": "minimatch@>=2.0.1 <3.0.0",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.1.tgz",
"dependencies": {
"brace-expansion": {
"version": "1.0.1",
"from": "brace-expansion@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.0.1.tgz",
"dependencies": {
"balanced-match": {
"version": "0.2.0",
"from": "balanced-match@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.2.0.tgz"
},
"concat-map": {
"version": "0.0.0",
"from": "concat-map@0.0.0",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.0.tgz"
}
}
}
}
},
"ordered-read-streams": {
"version": "0.1.0",
"from": "ordered-read-streams@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-0.1.0.tgz"
},
"glob2base": {
"version": "0.0.12",
"from": "glob2base@>=0.0.12 <0.0.13",
"resolved": "https://registry.npmjs.org/glob2base/-/glob2base-0.0.12.tgz",
"dependencies": {
"find-index": {
"version": "0.1.1",
"from": "find-index@>=0.1.1 <0.2.0",
"resolved": "https://registry.npmjs.org/find-index/-/find-index-0.1.1.tgz"
}
}
},
"unique-stream": {
"version": "1.0.0",
"from": "unique-stream@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-1.0.0.tgz"
}
}
},
"glob-watcher": {
"version": "0.0.6",
"from": "glob-watcher@>=0.0.6 <0.0.7",
"resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-0.0.6.tgz",
"dependencies": {
"gaze": {
"version": "0.5.1",
"from": "gaze@>=0.5.1 <0.6.0",
"resolved": "https://registry.npmjs.org/gaze/-/gaze-0.5.1.tgz",
"dependencies": {
"globule": {
"version": "0.1.0",
"from": "globule@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/globule/-/globule-0.1.0.tgz",
"dependencies": {
"lodash": {
"version": "1.0.1",
"from": "lodash@>=1.0.1 <1.1.0",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-1.0.1.tgz"
},
"glob": {
"version": "3.1.21",
"from": "glob@>=3.1.21 <3.2.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-3.1.21.tgz",
"dependencies": {
"graceful-fs": {
"version": "1.2.3",
"from": "graceful-fs@>=1.2.0 <1.3.0",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz"
},
"inherits": {
"version": "1.0.0",
"from": "inherits@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-1.0.0.tgz"
}
}
},
"minimatch": {
"version": "0.2.14",
"from": "minimatch@>=0.2.11 <0.3.0",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz",
"dependencies": {
"lru-cache": {
"version": "2.5.0",
"from": "lru-cache@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz"
},
"sigmund": {
"version": "1.0.0",
"from": "sigmund@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz"
}
}
}
}
}
}
}
}
},
"graceful-fs": {
"version": "3.0.5",
"from": "graceful-fs@>=3.0.0 <4.0.0",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.5.tgz"
},
"mkdirp": {
"version": "0.5.0",
"from": "mkdirp@>=0.0.0 <1.0.0",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz",
"dependencies": {
"minimist": {
"version": "0.0.8",
"from": "minimist@0.0.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz"
}
}
},
"strip-bom": {
"version": "1.0.0",
"from": "strip-bom@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-1.0.0.tgz",
"dependencies": {
"first-chunk-stream": {
"version": "1.0.0",
"from": "first-chunk-stream@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/first-chunk-stream/-/first-chunk-stream-1.0.0.tgz"
},
"is-utf8": {
"version": "0.2.0",
"from": "is-utf8@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.0.tgz"
}
}
}
}
},
"ware": {
"version": "1.2.0",
"from": "ware@>=1.0.1 <2.0.0",
"resolved": "https://registry.npmjs.org/ware/-/ware-1.2.0.tgz",
"dependencies": {
"wrap-fn": {
"version": "0.1.1",
"from": "wrap-fn@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/wrap-fn/-/wrap-fn-0.1.1.tgz",
"dependencies": {
"co": {
"version": "3.1.0",
"from": "co@3.1.0",
"resolved": "https://registry.npmjs.org/co/-/co-3.1.0.tgz"
}
}
}
}
}
}
},
"exec-series": {
"version": "1.0.1",
"from": "exec-series@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/exec-series/-/exec-series-1.0.1.tgz",
"dependencies": {
"async-each-series": {
"version": "0.1.1",
"from": "async-each-series@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/async-each-series/-/async-each-series-0.1.1.tgz"
}
}
},
"rimraf": {
"version": "2.2.8",
"from": "rimraf@>=2.2.6 <3.0.0",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz"
},
"tempfile": {
"version": "1.1.0",
"from": "tempfile@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/tempfile/-/tempfile-1.1.0.tgz",
"dependencies": {
"uuid": {
"version": "2.0.1",
"from": "uuid@>=2.0.1 <3.0.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz"
}
}
}
}
},
"bin-wrapper": {
"version": "2.1.1",
"from": "bin-wrapper@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/bin-wrapper/-/bin-wrapper-2.1.1.tgz",
"dependencies": {
"bin-check": {
"version": "1.0.0",
"from": "bin-check@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/bin-check/-/bin-check-1.0.0.tgz",
"dependencies": {
"executable": {
"version": "1.0.3",
"from": "executable@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/executable/-/executable-1.0.3.tgz",
"dependencies": {
"meow": {
"version": "2.0.0",
"from": "meow@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/meow/-/meow-2.0.0.tgz",
"dependencies": {
"camelcase-keys": {
"version": "1.0.0",
"from": "camelcase-keys@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-1.0.0.tgz",
"dependencies": {
"camelcase": {
"version": "1.0.2",
"from": "camelcase@>=1.0.1 <2.0.0",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.0.2.tgz"
},
"map-obj": {
"version": "1.0.0",
"from": "map-obj@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.0.tgz"
}
}
},
"indent-string": {
"version": "1.2.0",
"from": "indent-string@>=1.1.0 <2.0.0",
"resolved": "https://registry.npmjs.org/indent-string/-/indent-string-1.2.0.tgz",
"dependencies": {
"get-stdin": {
"version": "3.0.2",
"from": "get-stdin@>=3.0.0 <4.0.0",
"resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-3.0.2.tgz"
},
"repeating": {
"version": "1.1.0",
"from": "repeating@>=1.1.0 <2.0.0",
"resolved": "https://registry.npmjs.org/repeating/-/repeating-1.1.0.tgz",
"dependencies": {
"is-finite": {
"version": "1.0.0",
"from": "is-finite@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.0.tgz"
},
"meow": {
"version": "1.0.0",
"from": "meow@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/meow/-/meow-1.0.0.tgz"
}
}
}
}
},
"minimist": {
"version": "1.1.0",
"from": "minimist@>=1.1.0 <2.0.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.1.0.tgz"
},
"object-assign": {
"version": "1.0.0",
"from": "object-assign@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-1.0.0.tgz"
}
}
}
}
}
}
},
"bin-version-check": {
"version": "1.0.0",
"from": "bin-version-check@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/bin-version-check/-/bin-version-check-1.0.0.tgz",
"dependencies": {
"bin-version": {
"version": "1.0.0",
"from": "bin-version@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/bin-version/-/bin-version-1.0.0.tgz",
"dependencies": {
"find-versions": {
"version": "1.1.1",
"from": "find-versions@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/find-versions/-/find-versions-1.1.1.tgz",
"dependencies": {
"array-uniq": {
"version": "1.0.1",
"from": "array-uniq@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.1.tgz"
},
"get-stdin": {
"version": "3.0.2",
"from": "get-stdin@>=3.0.0 <4.0.0",
"resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-3.0.2.tgz"
},
"semver-regex": {
"version": "1.0.0",
"from": "semver-regex@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-1.0.0.tgz"
}
}
}
}
},
"minimist": {
"version": "1.1.0",
"from": "minimist@>=1.1.0 <2.0.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.1.0.tgz"
}
}
},
"download": {
"version": "3.1.2",
"from": "download@>=3.0.1 <4.0.0",
"resolved": "https://registry.npmjs.org/download/-/download-3.1.2.tgz",
"dependencies": {
"concat-stream": {
"version": "1.4.7",
"from": "concat-stream@>=1.4.6 <2.0.0",
"resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.4.7.tgz",
"dependencies": {
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
},
"typedarray": {
"version": "0.0.6",
"from": "typedarray@>=0.0.5 <0.1.0",
"resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz"
},
"readable-stream": {
"version": "1.1.13",
"from": "readable-stream@>=1.1.9 <1.2.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.13.tgz",
"dependencies": {
"core-util-is": {
"version": "1.0.1",
"from": "core-util-is@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
},
"isarray": {
"version": "0.0.1",
"from": "isarray@0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
},
"string_decoder": {
"version": "0.10.31",
"from": "string_decoder@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
}
}
}
}
},
"decompress-tar": {
"version": "2.0.2",
"from": "decompress-tar@>=2.0.1 <3.0.0",
"resolved": "https://registry.npmjs.org/decompress-tar/-/decompress-tar-2.0.2.tgz",
"dependencies": {
"is-tar": {
"version": "1.0.0",
"from": "is-tar@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/is-tar/-/is-tar-1.0.0.tgz"
},
"strip-dirs": {
"version": "0.1.1",
"from": "strip-dirs@>=0.1.1 <0.2.0",
"resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-0.1.1.tgz",
"dependencies": {
"chalk": {
"version": "0.5.1",
"from": "chalk@>=0.5.1 <0.6.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-0.5.1.tgz",
"dependencies": {
"ansi-styles": {
"version": "1.1.0",
"from": "ansi-styles@>=1.1.0 <2.0.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.1.0.tgz"
},
"escape-string-regexp": {
"version": "1.0.2",
"from": "escape-string-regexp@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz"
},
"has-ansi": {
"version": "0.1.0",
"from": "has-ansi@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-0.1.0.tgz",
"dependencies": {
"ansi-regex": {
"version": "0.2.1",
"from": "ansi-regex@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz"
}
}
},
"strip-ansi": {
"version": "0.3.0",
"from": "strip-ansi@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.3.0.tgz",
"dependencies": {
"ansi-regex": {
"version": "0.2.1",
"from": "ansi-regex@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz"
}
}
},
"supports-color": {
"version": "0.2.0",
"from": "supports-color@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-0.2.0.tgz"
}
}
},
"is-absolute": {
"version": "0.1.5",
"from": "is-absolute@>=0.1.4 <0.2.0",
"resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-0.1.5.tgz",
"dependencies": {
"is-relative": {
"version": "0.1.3",
"from": "is-relative@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/is-relative/-/is-relative-0.1.3.tgz"
}
}
},
"is-integer": {
"version": "1.0.3",
"from": "is-integer@>=1.0.3 <2.0.0",
"resolved": "https://registry.npmjs.org/is-integer/-/is-integer-1.0.3.tgz"
},
"minimist": {
"version": "1.1.0",
"from": "minimist@>=1.1.0 <2.0.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.1.0.tgz"
}
}
},
"tar-stream": {
"version": "0.4.7",
"from": "tar-stream@>=0.4.5 <0.5.0",
"resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-0.4.7.tgz",
"dependencies": {
"bl": {
"version": "0.9.3",
"from": "bl@>=0.9.0 <0.10.0",
"resolved": "https://registry.npmjs.org/bl/-/bl-0.9.3.tgz"
},
"end-of-stream": {
"version": "1.1.0",
"from": "end-of-stream@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.1.0.tgz",
"dependencies": {
"once": {
"version": "1.3.1",
"from": "once@>=1.3.0 <1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.3.1.tgz",
"dependencies": {
"wrappy": {
"version": "1.0.1",
"from": "wrappy@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz"
}
}
}
}
},
"readable-stream": {
"version": "1.0.33",
"from": "readable-stream@>=1.0.27-1 <2.0.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz",
"dependencies": {
"core-util-is": {
"version": "1.0.1",
"from": "core-util-is@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
},
"isarray": {
"version": "0.0.1",
"from": "isarray@0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
},
"string_decoder": {
"version": "0.10.31",
"from": "string_decoder@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
}
}
},
"xtend": {
"version": "4.0.0",
"from": "xtend@>=4.0.0 <5.0.0",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.0.tgz"
}
}
}
}
},
"decompress-tarbz2": {
"version": "2.0.2",
"from": "decompress-tarbz2@>=2.0.1 <3.0.0",
"resolved": "https://registry.npmjs.org/decompress-tarbz2/-/decompress-tarbz2-2.0.2.tgz",
"dependencies": {
"is-bzip2": {
"version": "1.0.0",
"from": "is-bzip2@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/is-bzip2/-/is-bzip2-1.0.0.tgz"
},
"seek-bzip": {
"version": "1.0.4",
"from": "seek-bzip@>=1.0.3 <2.0.0",
"resolved": "https://registry.npmjs.org/seek-bzip/-/seek-bzip-1.0.4.tgz",
"dependencies": {
"commander": {
"version": "2.4.0",
"from": "commander@>=2.4.0 <2.5.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.4.0.tgz"
}
}
},
"strip-dirs": {
"version": "0.1.1",
"from": "strip-dirs@>=0.1.1 <0.2.0",
"resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-0.1.1.tgz",
"dependencies": {
"chalk": {
"version": "0.5.1",
"from": "chalk@>=0.5.1 <0.6.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-0.5.1.tgz",
"dependencies": {
"ansi-styles": {
"version": "1.1.0",
"from": "ansi-styles@>=1.1.0 <2.0.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.1.0.tgz"
},
"escape-string-regexp": {
"version": "1.0.2",
"from": "escape-string-regexp@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz"
},
"has-ansi": {
"version": "0.1.0",
"from": "has-ansi@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-0.1.0.tgz",
"dependencies": {
"ansi-regex": {
"version": "0.2.1",
"from": "ansi-regex@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz"
}
}
},
"strip-ansi": {
"version": "0.3.0",
"from": "strip-ansi@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.3.0.tgz",
"dependencies": {
"ansi-regex": {
"version": "0.2.1",
"from": "ansi-regex@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz"
}
}
},
"supports-color": {
"version": "0.2.0",
"from": "supports-color@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-0.2.0.tgz"
}
}
},
"is-absolute": {
"version": "0.1.5",
"from": "is-absolute@>=0.1.4 <0.2.0",
"resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-0.1.5.tgz",
"dependencies": {
"is-relative": {
"version": "0.1.3",
"from": "is-relative@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/is-relative/-/is-relative-0.1.3.tgz"
}
}
},
"is-integer": {
"version": "1.0.3",
"from": "is-integer@>=1.0.3 <2.0.0",
"resolved": "https://registry.npmjs.org/is-integer/-/is-integer-1.0.3.tgz"
},
"minimist": {
"version": "1.1.0",
"from": "minimist@>=1.1.0 <2.0.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.1.0.tgz"
}
}
},
"tar-stream": {
"version": "0.4.7",
"from": "tar-stream@>=0.4.5 <0.5.0",
"resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-0.4.7.tgz",
"dependencies": {
"bl": {
"version": "0.9.3",
"from": "bl@>=0.9.0 <0.10.0",
"resolved": "https://registry.npmjs.org/bl/-/bl-0.9.3.tgz"
},
"end-of-stream": {
"version": "1.1.0",
"from": "end-of-stream@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.1.0.tgz",
"dependencies": {
"once": {
"version": "1.3.1",
"from": "once@>=1.3.0 <1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.3.1.tgz",
"dependencies": {
"wrappy": {
"version": "1.0.1",
"from": "wrappy@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz"
}
}
}
}
},
"readable-stream": {
"version": "1.0.33",
"from": "readable-stream@>=1.0.27-1 <2.0.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz",
"dependencies": {
"core-util-is": {
"version": "1.0.1",
"from": "core-util-is@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
},
"isarray": {
"version": "0.0.1",
"from": "isarray@0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
},
"string_decoder": {
"version": "0.10.31",
"from": "string_decoder@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
}
}
},
"xtend": {
"version": "4.0.0",
"from": "xtend@>=4.0.0 <5.0.0",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.0.tgz"
}
}
}
}
},
"decompress-targz": {
"version": "2.0.2",
"from": "decompress-targz@>=2.0.1 <3.0.0",
"resolved": "https://registry.npmjs.org/decompress-targz/-/decompress-targz-2.0.2.tgz",
"dependencies": {
"is-gzip": {
"version": "1.0.0",
"from": "is-gzip@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/is-gzip/-/is-gzip-1.0.0.tgz"
},
"strip-dirs": {
"version": "0.1.1",
"from": "strip-dirs@>=0.1.1 <0.2.0",
"resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-0.1.1.tgz",
"dependencies": {
"chalk": {
"version": "0.5.1",
"from": "chalk@>=0.5.1 <0.6.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-0.5.1.tgz",
"dependencies": {
"ansi-styles": {
"version": "1.1.0",
"from": "ansi-styles@>=1.1.0 <2.0.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.1.0.tgz"
},
"escape-string-regexp": {
"version": "1.0.2",
"from": "escape-string-regexp@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz"
},
"has-ansi": {
"version": "0.1.0",
"from": "has-ansi@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-0.1.0.tgz",
"dependencies": {
"ansi-regex": {
"version": "0.2.1",
"from": "ansi-regex@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz"
}
}
},
"strip-ansi": {
"version": "0.3.0",
"from": "strip-ansi@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.3.0.tgz",
"dependencies": {
"ansi-regex": {
"version": "0.2.1",
"from": "ansi-regex@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz"
}
}
},
"supports-color": {
"version": "0.2.0",
"from": "supports-color@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-0.2.0.tgz"
}
}
},
"is-absolute": {
"version": "0.1.5",
"from": "is-absolute@>=0.1.4 <0.2.0",
"resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-0.1.5.tgz",
"dependencies": {
"is-relative": {
"version": "0.1.3",
"from": "is-relative@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/is-relative/-/is-relative-0.1.3.tgz"
}
}
},
"is-integer": {
"version": "1.0.3",
"from": "is-integer@>=1.0.3 <2.0.0",
"resolved": "https://registry.npmjs.org/is-integer/-/is-integer-1.0.3.tgz"
},
"minimist": {
"version": "1.1.0",
"from": "minimist@>=1.1.0 <2.0.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.1.0.tgz"
}
}
},
"tar-stream": {
"version": "0.4.7",
"from": "tar-stream@>=0.4.5 <0.5.0",
"resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-0.4.7.tgz",
"dependencies": {
"bl": {
"version": "0.9.3",
"from": "bl@>=0.9.0 <0.10.0",
"resolved": "https://registry.npmjs.org/bl/-/bl-0.9.3.tgz"
},
"end-of-stream": {
"version": "1.1.0",
"from": "end-of-stream@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.1.0.tgz",
"dependencies": {
"once": {
"version": "1.3.1",
"from": "once@>=1.3.0 <1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.3.1.tgz",
"dependencies": {
"wrappy": {
"version": "1.0.1",
"from": "wrappy@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz"
}
}
}
}
},
"readable-stream": {
"version": "1.0.33",
"from": "readable-stream@>=1.0.27-1 <2.0.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz",
"dependencies": {
"core-util-is": {
"version": "1.0.1",
"from": "core-util-is@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
},
"isarray": {
"version": "0.0.1",
"from": "isarray@0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
},
"string_decoder": {
"version": "0.10.31",
"from": "string_decoder@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
}
}
},
"xtend": {
"version": "4.0.0",
"from": "xtend@>=4.0.0 <5.0.0",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.0.tgz"
}
}
}
}
},
"decompress-unzip": {
"version": "2.0.1",
"from": "decompress-unzip@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/decompress-unzip/-/decompress-unzip-2.0.1.tgz",
"dependencies": {
"adm-zip": {
"version": "0.4.4",
"from": "adm-zip@>=0.4.4 <0.5.0",
"resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.4.tgz"
},
"is-zip": {
"version": "1.0.0",
"from": "is-zip@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/is-zip/-/is-zip-1.0.0.tgz"
},
"rimraf": {
"version": "2.2.8",
"from": "rimraf@>=2.2.8 <3.0.0",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz"
},
"strip-dirs": {
"version": "0.1.1",
"from": "strip-dirs@>=0.1.1 <0.2.0",
"resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-0.1.1.tgz",
"dependencies": {
"chalk": {
"version": "0.5.1",
"from": "chalk@>=0.5.1 <0.6.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-0.5.1.tgz",
"dependencies": {
"ansi-styles": {
"version": "1.1.0",
"from": "ansi-styles@>=1.1.0 <2.0.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.1.0.tgz"
},
"escape-string-regexp": {
"version": "1.0.2",
"from": "escape-string-regexp@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz"
},
"has-ansi": {
"version": "0.1.0",
"from": "has-ansi@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-0.1.0.tgz",
"dependencies": {
"ansi-regex": {
"version": "0.2.1",
"from": "ansi-regex@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz"
}
}
},
"strip-ansi": {
"version": "0.3.0",
"from": "strip-ansi@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.3.0.tgz",
"dependencies": {
"ansi-regex": {
"version": "0.2.1",
"from": "ansi-regex@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz"
}
}
},
"supports-color": {
"version": "0.2.0",
"from": "supports-color@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-0.2.0.tgz"
}
}
},
"is-absolute": {
"version": "0.1.5",
"from": "is-absolute@>=0.1.4 <0.2.0",
"resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-0.1.5.tgz",
"dependencies": {
"is-relative": {
"version": "0.1.3",
"from": "is-relative@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/is-relative/-/is-relative-0.1.3.tgz"
}
}
},
"is-integer": {
"version": "1.0.3",
"from": "is-integer@>=1.0.3 <2.0.0",
"resolved": "https://registry.npmjs.org/is-integer/-/is-integer-1.0.3.tgz"
},
"minimist": {
"version": "1.1.0",
"from": "minimist@>=1.1.0 <2.0.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.1.0.tgz"
}
}
},
"temp-write": {
"version": "1.1.0",
"from": "temp-write@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/temp-write/-/temp-write-1.1.0.tgz",
"dependencies": {
"graceful-fs": {
"version": "3.0.5",
"from": "graceful-fs@>=3.0.2 <4.0.0",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.5.tgz"
},
"mkdirp": {
"version": "0.5.0",
"from": "mkdirp@>=0.5.0 <0.6.0",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz",
"dependencies": {
"minimist": {
"version": "0.0.8",
"from": "minimist@0.0.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz"
}
}
},
"uuid": {
"version": "2.0.1",
"from": "uuid@>=2.0.1 <3.0.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz"
}
}
}
}
},
"each-async": {
"version": "1.1.0",
"from": "each-async@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/each-async/-/each-async-1.1.0.tgz",
"dependencies": {
"onetime": {
"version": "1.0.0",
"from": "onetime@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/onetime/-/onetime-1.0.0.tgz"
},
"setimmediate": {
"version": "1.0.2",
"from": "setimmediate@>=1.0.2 <2.0.0",
"resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.2.tgz"
}
}
},
"get-stdin": {
"version": "3.0.2",
"from": "get-stdin@>=3.0.0 <4.0.0",
"resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-3.0.2.tgz"
},
"gulp-rename": {
"version": "1.2.0",
"from": "gulp-rename@>=1.2.0 <2.0.0",
"resolved": "https://registry.npmjs.org/gulp-rename/-/gulp-rename-1.2.0.tgz"
},
"meow": {
"version": "1.0.0",
"from": "meow@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/meow/-/meow-1.0.0.tgz",
"dependencies": {
"camelcase-keys": {
"version": "1.0.0",
"from": "camelcase-keys@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-1.0.0.tgz",
"dependencies": {
"camelcase": {
"version": "1.0.2",
"from": "camelcase@>=1.0.1 <2.0.0",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.0.2.tgz"
},
"map-obj": {
"version": "1.0.0",
"from": "map-obj@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.0.tgz"
}
}
},
"indent-string": {
"version": "1.2.0",
"from": "indent-string@>=1.1.0 <2.0.0",
"resolved": "https://registry.npmjs.org/indent-string/-/indent-string-1.2.0.tgz",
"dependencies": {
"repeating": {
"version": "1.1.0",
"from": "repeating@>=1.1.0 <2.0.0",
"resolved": "https://registry.npmjs.org/repeating/-/repeating-1.1.0.tgz",
"dependencies": {
"is-finite": {
"version": "1.0.0",
"from": "is-finite@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.0.tgz"
}
}
}
}
},
"minimist": {
"version": "1.1.0",
"from": "minimist@>=1.1.0 <2.0.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.1.0.tgz"
},
"object-assign": {
"version": "1.0.0",
"from": "object-assign@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-1.0.0.tgz"
}
}
},
"rc": {
"version": "0.5.4",
"from": "rc@>=0.5.1 <0.6.0",
"resolved": "https://registry.npmjs.org/rc/-/rc-0.5.4.tgz",
"dependencies": {
"minimist": {
"version": "0.0.10",
"from": "minimist@>=0.0.7 <0.1.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz"
},
"deep-extend": {
"version": "0.2.11",
"from": "deep-extend@>=0.2.5 <0.3.0",
"resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.2.11.tgz"
},
"strip-json-comments": {
"version": "0.1.3",
"from": "strip-json-comments@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-0.1.3.tgz"
},
"ini": {
"version": "1.1.0",
"from": "ini@>=1.1.0 <1.2.0",
"resolved": "https://registry.npmjs.org/ini/-/ini-1.1.0.tgz"
}
}
},
"request": {
"version": "2.49.0",
"from": "request@>=2.34.0 <3.0.0",
"resolved": "https://registry.npmjs.org/request/-/request-2.49.0.tgz",
"dependencies": {
"bl": {
"version": "0.9.3",
"from": "bl@>=0.9.0 <0.10.0",
"resolved": "https://registry.npmjs.org/bl/-/bl-0.9.3.tgz",
"dependencies": {
"readable-stream": {
"version": "1.0.33",
"from": "readable-stream@>=1.0.26 <1.1.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz",
"dependencies": {
"core-util-is": {
"version": "1.0.1",
"from": "core-util-is@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
},
"isarray": {
"version": "0.0.1",
"from": "isarray@0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
},
"string_decoder": {
"version": "0.10.31",
"from": "string_decoder@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
}
}
}
}
},
"caseless": {
"version": "0.8.0",
"from": "caseless@>=0.8.0 <0.9.0",
"resolved": "https://registry.npmjs.org/caseless/-/caseless-0.8.0.tgz"
},
"forever-agent": {
"version": "0.5.2",
"from": "forever-agent@>=0.5.0 <0.6.0",
"resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.5.2.tgz"
},
"form-data": {
"version": "0.1.4",
"from": "form-data@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-0.1.4.tgz",
"dependencies": {
"mime": {
"version": "1.2.11",
"from": "mime@>=1.2.11 <1.3.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz"
},
"async": {
"version": "0.9.0",
"from": "async@>=0.9.0 <0.10.0",
"resolved": "https://registry.npmjs.org/async/-/async-0.9.0.tgz"
}
}
},
"json-stringify-safe": {
"version": "5.0.0",
"from": "json-stringify-safe@>=5.0.0 <5.1.0",
"resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.0.tgz"
},
"mime-types": {
"version": "1.0.2",
"from": "mime-types@>=1.0.1 <1.1.0",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-1.0.2.tgz"
},
"node-uuid": {
"version": "1.4.2",
"from": "node-uuid@>=1.4.0 <1.5.0",
"resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.2.tgz"
},
"qs": {
"version": "2.3.3",
"from": "qs@>=2.3.1 <2.4.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-2.3.3.tgz"
},
"tunnel-agent": {
"version": "0.4.0",
"from": "tunnel-agent@>=0.4.0 <0.5.0",
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.0.tgz"
},
"tough-cookie": {
"version": "0.12.1",
"from": "tough-cookie@>=0.12.0",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-0.12.1.tgz",
"dependencies": {
"punycode": {
"version": "1.3.2",
"from": "punycode@>=0.2.0",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz"
}
}
},
"http-signature": {
"version": "0.10.0",
"from": "http-signature@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/http-signature/-/http-signature-0.10.0.tgz",
"dependencies": {
"assert-plus": {
"version": "0.1.2",
"from": "assert-plus@0.1.2",
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.2.tgz"
},
"asn1": {
"version": "0.1.11",
"from": "asn1@0.1.11",
"resolved": "https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz"
},
"ctype": {
"version": "0.5.2",
"from": "ctype@0.5.2",
"resolved": "https://registry.npmjs.org/ctype/-/ctype-0.5.2.tgz"
}
}
},
"oauth-sign": {
"version": "0.5.0",
"from": "oauth-sign@>=0.5.0 <0.6.0",
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.5.0.tgz"
},
"hawk": {
"version": "1.1.1",
"from": "hawk@1.1.1",
"resolved": "https://registry.npmjs.org/hawk/-/hawk-1.1.1.tgz",
"dependencies": {
"hoek": {
"version": "0.9.1",
"from": "hoek@>=0.9.0 <0.10.0",
"resolved": "https://registry.npmjs.org/hoek/-/hoek-0.9.1.tgz"
},
"boom": {
"version": "0.4.2",
"from": "boom@>=0.4.0 <0.5.0",
"resolved": "https://registry.npmjs.org/boom/-/boom-0.4.2.tgz"
},
"cryptiles": {
"version": "0.2.2",
"from": "cryptiles@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-0.2.2.tgz"
},
"sntp": {
"version": "0.2.4",
"from": "sntp@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/sntp/-/sntp-0.2.4.tgz"
}
}
},
"aws-sign2": {
"version": "0.5.0",
"from": "aws-sign2@>=0.5.0 <0.6.0",
"resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz"
},
"stringstream": {
"version": "0.0.4",
"from": "stringstream@>=0.0.4 <0.1.0",
"resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.4.tgz"
},
"combined-stream": {
"version": "0.0.7",
"from": "combined-stream@>=0.0.5 <0.1.0",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz",
"dependencies": {
"delayed-stream": {
"version": "0.0.5",
"from": "delayed-stream@0.0.5",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz"
}
}
}
}
},
"stream-combiner": {
"version": "0.2.1",
"from": "stream-combiner@>=0.2.1 <0.3.0",
"resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.2.1.tgz",
"dependencies": {
"duplexer": {
"version": "0.1.1",
"from": "duplexer@>=0.1.1 <0.2.0",
"resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz"
},
"through": {
"version": "2.3.6",
"from": "through@>=2.3.4 <2.4.0",
"resolved": "https://registry.npmjs.org/through/-/through-2.3.6.tgz"
}
}
},
"through2": {
"version": "0.6.3",
"from": "through2@>=0.6.1 <0.7.0",
"resolved": "https://registry.npmjs.org/through2/-/through2-0.6.3.tgz",
"dependencies": {
"readable-stream": {
"version": "1.0.33",
"from": "readable-stream@>=1.0.33-1 <1.1.0-0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz",
"dependencies": {
"core-util-is": {
"version": "1.0.1",
"from": "core-util-is@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
},
"isarray": {
"version": "0.0.1",
"from": "isarray@0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
},
"string_decoder": {
"version": "0.10.31",
"from": "string_decoder@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
}
}
},
"xtend": {
"version": "4.0.0",
"from": "xtend@>=4.0.0 <4.1.0-0",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.0.tgz"
}
}
},
"url-regex": {
"version": "1.0.4",
"from": "url-regex@>=1.0.3 <2.0.0",
"resolved": "https://registry.npmjs.org/url-regex/-/url-regex-1.0.4.tgz"
},
"vinyl": {
"version": "0.4.6",
"from": "vinyl@>=0.4.3 <0.5.0",
"resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.4.6.tgz",
"dependencies": {
"clone": {
"version": "0.2.0",
"from": "clone@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/clone/-/clone-0.2.0.tgz"
},
"clone-stats": {
"version": "0.0.1",
"from": "clone-stats@>=0.0.1 <0.0.2",
"resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-0.0.1.tgz"
}
}
},
"vinyl-fs": {
"version": "0.3.13",
"from": "vinyl-fs@>=0.3.7 <0.4.0",
"resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-0.3.13.tgz",
"dependencies": {
"defaults": {
"version": "1.0.0",
"from": "defaults@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.0.tgz",
"dependencies": {
"clone": {
"version": "0.1.19",
"from": "clone@>=0.1.5 <0.2.0",
"resolved": "https://registry.npmjs.org/clone/-/clone-0.1.19.tgz"
}
}
},
"glob-stream": {
"version": "3.1.18",
"from": "glob-stream@>=3.1.5 <4.0.0",
"resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-3.1.18.tgz",
"dependencies": {
"glob": {
"version": "4.3.1",
"from": "glob@>=4.3.1 <5.0.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-4.3.1.tgz",
"dependencies": {
"inflight": {
"version": "1.0.4",
"from": "inflight@>=1.0.4 <2.0.0",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz",
"dependencies": {
"wrappy": {
"version": "1.0.1",
"from": "wrappy@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz"
}
}
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
},
"once": {
"version": "1.3.1",
"from": "once@>=1.3.0 <2.0.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.3.1.tgz",
"dependencies": {
"wrappy": {
"version": "1.0.1",
"from": "wrappy@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz"
}
}
}
}
},
"minimatch": {
"version": "2.0.1",
"from": "minimatch@>=2.0.1 <3.0.0",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.1.tgz",
"dependencies": {
"brace-expansion": {
"version": "1.0.1",
"from": "brace-expansion@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.0.1.tgz",
"dependencies": {
"balanced-match": {
"version": "0.2.0",
"from": "balanced-match@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.2.0.tgz"
},
"concat-map": {
"version": "0.0.0",
"from": "concat-map@0.0.0",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.0.tgz"
}
}
}
}
},
"ordered-read-streams": {
"version": "0.1.0",
"from": "ordered-read-streams@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-0.1.0.tgz"
},
"glob2base": {
"version": "0.0.12",
"from": "glob2base@>=0.0.12 <0.0.13",
"resolved": "https://registry.npmjs.org/glob2base/-/glob2base-0.0.12.tgz",
"dependencies": {
"find-index": {
"version": "0.1.1",
"from": "find-index@>=0.1.1 <0.2.0",
"resolved": "https://registry.npmjs.org/find-index/-/find-index-0.1.1.tgz"
}
}
},
"unique-stream": {
"version": "1.0.0",
"from": "unique-stream@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-1.0.0.tgz"
}
}
},
"glob-watcher": {
"version": "0.0.6",
"from": "glob-watcher@>=0.0.6 <0.0.7",
"resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-0.0.6.tgz",
"dependencies": {
"gaze": {
"version": "0.5.1",
"from": "gaze@>=0.5.1 <0.6.0",
"resolved": "https://registry.npmjs.org/gaze/-/gaze-0.5.1.tgz",
"dependencies": {
"globule": {
"version": "0.1.0",
"from": "globule@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/globule/-/globule-0.1.0.tgz",
"dependencies": {
"lodash": {
"version": "1.0.1",
"from": "lodash@>=1.0.1 <1.1.0",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-1.0.1.tgz"
},
"glob": {
"version": "3.1.21",
"from": "glob@>=3.1.21 <3.2.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-3.1.21.tgz",
"dependencies": {
"graceful-fs": {
"version": "1.2.3",
"from": "graceful-fs@>=1.2.0 <1.3.0",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz"
},
"inherits": {
"version": "1.0.0",
"from": "inherits@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-1.0.0.tgz"
}
}
},
"minimatch": {
"version": "0.2.14",
"from": "minimatch@>=0.2.11 <0.3.0",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz",
"dependencies": {
"lru-cache": {
"version": "2.5.0",
"from": "lru-cache@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz"
},
"sigmund": {
"version": "1.0.0",
"from": "sigmund@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz"
}
}
}
}
}
}
}
}
},
"graceful-fs": {
"version": "3.0.5",
"from": "graceful-fs@>=3.0.0 <4.0.0",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.5.tgz"
},
"mkdirp": {
"version": "0.5.0",
"from": "mkdirp@>=0.0.0 <1.0.0",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz",
"dependencies": {
"minimist": {
"version": "0.0.8",
"from": "minimist@0.0.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz"
}
}
},
"strip-bom": {
"version": "1.0.0",
"from": "strip-bom@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-1.0.0.tgz",
"dependencies": {
"first-chunk-stream": {
"version": "1.0.0",
"from": "first-chunk-stream@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/first-chunk-stream/-/first-chunk-stream-1.0.0.tgz"
},
"is-utf8": {
"version": "0.2.0",
"from": "is-utf8@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.0.tgz"
}
}
}
}
},
"ware": {
"version": "1.2.0",
"from": "ware@>=1.0.1 <2.0.0",
"resolved": "https://registry.npmjs.org/ware/-/ware-1.2.0.tgz",
"dependencies": {
"wrap-fn": {
"version": "0.1.1",
"from": "wrap-fn@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/wrap-fn/-/wrap-fn-0.1.1.tgz",
"dependencies": {
"co": {
"version": "3.1.0",
"from": "co@3.1.0",
"resolved": "https://registry.npmjs.org/co/-/co-3.1.0.tgz"
}
}
}
}
}
}
},
"download-status": {
"version": "2.1.0",
"from": "download-status@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/download-status/-/download-status-2.1.0.tgz",
"dependencies": {
"chalk": {
"version": "0.5.1",
"from": "chalk@>=0.5.1 <0.6.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-0.5.1.tgz",
"dependencies": {
"ansi-styles": {
"version": "1.1.0",
"from": "ansi-styles@>=1.1.0 <2.0.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.1.0.tgz"
},
"escape-string-regexp": {
"version": "1.0.2",
"from": "escape-string-regexp@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz"
},
"has-ansi": {
"version": "0.1.0",
"from": "has-ansi@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-0.1.0.tgz",
"dependencies": {
"ansi-regex": {
"version": "0.2.1",
"from": "ansi-regex@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz"
}
}
},
"strip-ansi": {
"version": "0.3.0",
"from": "strip-ansi@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.3.0.tgz",
"dependencies": {
"ansi-regex": {
"version": "0.2.1",
"from": "ansi-regex@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz"
}
}
},
"supports-color": {
"version": "0.2.0",
"from": "supports-color@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-0.2.0.tgz"
}
}
},
"lpad-align": {
"version": "1.0.2",
"from": "lpad-align@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/lpad-align/-/lpad-align-1.0.2.tgz",
"dependencies": {
"longest": {
"version": "0.2.1",
"from": "longest@>=0.2.1 <0.3.0",
"resolved": "https://registry.npmjs.org/longest/-/longest-0.2.1.tgz"
},
"lpad": {
"version": "1.0.0",
"from": "lpad@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/lpad/-/lpad-1.0.0.tgz"
}
}
},
"object-assign": {
"version": "1.0.0",
"from": "object-assign@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-1.0.0.tgz"
},
"progress": {
"version": "1.1.8",
"from": "progress@>=1.1.8 <2.0.0",
"resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz"
}
}
},
"globby": {
"version": "0.1.1",
"from": "globby@>=0.1.1 <0.2.0",
"resolved": "https://registry.npmjs.org/globby/-/globby-0.1.1.tgz",
"dependencies": {
"array-differ": {
"version": "0.1.0",
"from": "array-differ@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/array-differ/-/array-differ-0.1.0.tgz"
},
"array-union": {
"version": "0.1.0",
"from": "array-union@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/array-union/-/array-union-0.1.0.tgz",
"dependencies": {
"array-uniq": {
"version": "0.1.1",
"from": "array-uniq@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-0.1.1.tgz"
}
}
},
"async": {
"version": "0.9.0",
"from": "async@>=0.9.0 <0.10.0",
"resolved": "https://registry.npmjs.org/async/-/async-0.9.0.tgz"
},
"glob": {
"version": "4.3.1",
"from": "glob@>=4.0.2 <5.0.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-4.3.1.tgz",
"dependencies": {
"inflight": {
"version": "1.0.4",
"from": "inflight@>=1.0.4 <2.0.0",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz",
"dependencies": {
"wrappy": {
"version": "1.0.1",
"from": "wrappy@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz"
}
}
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
},
"minimatch": {
"version": "2.0.1",
"from": "minimatch@>=2.0.1 <3.0.0",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.1.tgz",
"dependencies": {
"brace-expansion": {
"version": "1.0.1",
"from": "brace-expansion@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.0.1.tgz",
"dependencies": {
"balanced-match": {
"version": "0.2.0",
"from": "balanced-match@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.2.0.tgz"
},
"concat-map": {
"version": "0.0.0",
"from": "concat-map@0.0.0",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.0.tgz"
}
}
}
}
},
"once": {
"version": "1.3.1",
"from": "once@>=1.3.0 <2.0.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.3.1.tgz",
"dependencies": {
"wrappy": {
"version": "1.0.1",
"from": "wrappy@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz"
}
}
}
}
}
}
},
"is-path-global": {
"version": "1.0.1",
"from": "is-path-global@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/is-path-global/-/is-path-global-1.0.1.tgz",
"dependencies": {
"is-path-inside": {
"version": "1.0.0",
"from": "is-path-inside@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.0.tgz",
"dependencies": {
"path-is-inside": {
"version": "1.0.1",
"from": "path-is-inside@>=1.0.1 <2.0.0",
"resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.1.tgz"
}
}
}
}
},
"lnfs": {
"version": "1.0.0",
"from": "lnfs@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/lnfs/-/lnfs-1.0.0.tgz",
"dependencies": {
"mkdirp": {
"version": "0.5.0",
"from": "mkdirp@>=0.5.0 <0.6.0",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz",
"dependencies": {
"minimist": {
"version": "0.0.8",
"from": "minimist@0.0.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz"
}
}
},
"rimraf": {
"version": "2.2.8",
"from": "rimraf@>=2.2.8 <3.0.0",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz"
}
}
},
"npm-installed": {
"version": "1.0.0",
"from": "npm-installed@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/npm-installed/-/npm-installed-1.0.0.tgz",
"dependencies": {
"npm-which": {
"version": "1.0.2",
"from": "npm-which@>=1.0.1 <2.0.0",
"resolved": "https://registry.npmjs.org/npm-which/-/npm-which-1.0.2.tgz",
"dependencies": {
"commander": {
"version": "2.5.0",
"from": "commander@>=2.2.0 <3.0.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.5.0.tgz"
},
"npm-path": {
"version": "1.0.1",
"from": "npm-path@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/npm-path/-/npm-path-1.0.1.tgz"
},
"which": {
"version": "1.0.8",
"from": "which@>=1.0.5 <2.0.0",
"resolved": "https://registry.npmjs.org/which/-/which-1.0.8.tgz"
}
}
},
"rc": {
"version": "0.5.4",
"from": "rc@>=0.5.1 <0.6.0",
"resolved": "https://registry.npmjs.org/rc/-/rc-0.5.4.tgz",
"dependencies": {
"minimist": {
"version": "0.0.10",
"from": "minimist@>=0.0.7 <0.1.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz"
},
"deep-extend": {
"version": "0.2.11",
"from": "deep-extend@>=0.2.5 <0.3.0",
"resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.2.11.tgz"
},
"strip-json-comments": {
"version": "0.1.3",
"from": "strip-json-comments@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-0.1.3.tgz"
},
"ini": {
"version": "1.1.0",
"from": "ini@>=1.1.0 <1.2.0",
"resolved": "https://registry.npmjs.org/ini/-/ini-1.1.0.tgz"
}
}
}
}
},
"os-filter-obj": {
"version": "1.0.0",
"from": "os-filter-obj@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/os-filter-obj/-/os-filter-obj-1.0.0.tgz"
}
}
},
"imagemin-log": {
"version": "1.0.2",
"from": "imagemin-log@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/imagemin-log/-/imagemin-log-1.0.2.tgz",
"dependencies": {
"stream-log": {
"version": "0.2.3",
"from": "stream-log@>=0.2.1 <0.3.0",
"resolved": "https://registry.npmjs.org/stream-log/-/stream-log-0.2.3.tgz",
"dependencies": {
"longest": {
"version": "0.2.1",
"from": "longest@>=0.2.1 <0.3.0",
"resolved": "https://registry.npmjs.org/longest/-/longest-0.2.1.tgz"
}
}
}
}
}
}
}
}
},
"svgfilter": {
"version": "0.4.0",
"from": "svgfilter@0.4.0",
"resolved": "https://registry.npmjs.org/svgfilter/-/svgfilter-0.4.0.tgz",
"dependencies": {
"assetgraph": {
"version": "1.8.0",
"from": "assetgraph@1.8.0",
"resolved": "https://registry.npmjs.org/assetgraph/-/assetgraph-1.8.0.tgz",
"dependencies": {
"accord": {
"version": "0.11.0",
"from": "accord@0.11.0",
"resolved": "https://registry.npmjs.org/accord/-/accord-0.11.0.tgz",
"dependencies": {
"fobject": {
"version": "0.0.0",
"from": "fobject@0.0.0",
"resolved": "https://registry.npmjs.org/fobject/-/fobject-0.0.0.tgz"
},
"indx": {
"version": "0.1.2",
"from": "indx@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/indx/-/indx-0.1.2.tgz",
"dependencies": {
"coffee-script": {
"version": "1.7.1",
"from": "coffee-script@>=1.7.0 <1.8.0",
"resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.7.1.tgz"
},
"colors": {
"version": "0.6.2",
"from": "colors@>=0.6.0 <0.7.0",
"resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz"
}
}
},
"resolve": {
"version": "0.7.4",
"from": "resolve@>=0.7.0 <0.8.0",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-0.7.4.tgz"
},
"uglify-js": {
"version": "2.4.15",
"from": "uglify-js@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.4.15.tgz",
"dependencies": {
"source-map": {
"version": "0.1.34",
"from": "source-map@0.1.34",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.34.tgz",
"dependencies": {
"amdefine": {
"version": "0.1.0",
"from": "amdefine@>=0.0.4",
"resolved": "https://registry.npmjs.org/amdefine/-/amdefine-0.1.0.tgz"
}
}
},
"optimist": {
"version": "0.3.7",
"from": "optimist@>=0.3.5 <0.4.0",
"resolved": "https://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz",
"dependencies": {
"wordwrap": {
"version": "0.0.2",
"from": "wordwrap@>=0.0.2 <0.1.0",
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz"
}
}
},
"uglify-to-browserify": {
"version": "1.0.2",
"from": "uglify-to-browserify@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz"
}
}
},
"when": {
"version": "3.6.3",
"from": "when@>=3.0.0 <4.0.0",
"resolved": "https://registry.npmjs.org/when/-/when-3.6.3.tgz"
}
}
},
"createerror": {
"version": "0.4.1",
"from": "createerror@0.4.1",
"resolved": "https://registry.npmjs.org/createerror/-/createerror-0.4.1.tgz"
},
"cssmin": {
"version": "0.3.1",
"from": "cssmin@0.3.1",
"resolved": "https://registry.npmjs.org/cssmin/-/cssmin-0.3.1.tgz"
},
"cssom-papandreou": {
"version": "0.2.4-patch6",
"from": "cssom-papandreou@0.2.4-patch6",
"resolved": "https://registry.npmjs.org/cssom-papandreou/-/cssom-papandreou-0.2.4-patch6.tgz"
},
"glob": {
"version": "4.0.3",
"from": "glob@4.0.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-4.0.3.tgz",
"dependencies": {
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
},
"minimatch": {
"version": "0.3.0",
"from": "minimatch@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz",
"dependencies": {
"lru-cache": {
"version": "2.5.0",
"from": "lru-cache@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz"
},
"sigmund": {
"version": "1.0.0",
"from": "sigmund@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz"
}
}
},
"once": {
"version": "1.3.1",
"from": "once@>=1.3.0 <2.0.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.3.1.tgz",
"dependencies": {
"wrappy": {
"version": "1.0.1",
"from": "wrappy@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz"
}
}
},
"graceful-fs": {
"version": "3.0.5",
"from": "graceful-fs@>=3.0.2 <4.0.0",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.5.tgz"
}
}
},
"httperrors": {
"version": "0.2.0",
"from": "httperrors@0.2.0",
"resolved": "https://registry.npmjs.org/httperrors/-/httperrors-0.2.0.tgz",
"dependencies": {
"createerror": {
"version": "0.0.1",
"from": "createerror@0.0.1",
"resolved": "https://registry.npmjs.org/createerror/-/createerror-0.0.1.tgz",
"dependencies": {
"xtend": {
"version": "1.0.3",
"from": "xtend@1.0.3",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-1.0.3.tgz"
}
}
}
}
},
"imageinfo": {
"version": "1.0.4",
"from": "imageinfo@1.0.4",
"resolved": "https://registry.npmjs.org/imageinfo/-/imageinfo-1.0.4.tgz"
},
"jsdom": {
"version": "0.11.0",
"from": "jsdom@0.11.0",
"resolved": "https://registry.npmjs.org/jsdom/-/jsdom-0.11.0.tgz",
"dependencies": {
"htmlparser2": {
"version": "3.8.2",
"from": "htmlparser2@>=3.1.5 <4.0.0",
"resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.2.tgz",
"dependencies": {
"domhandler": {
"version": "2.3.0",
"from": "domhandler@>=2.3.0 <2.4.0",
"resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.3.0.tgz"
},
"domutils": {
"version": "1.5.0",
"from": "domutils@>=1.5.0 <1.6.0",
"resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.0.tgz"
},
"domelementtype": {
"version": "1.1.3",
"from": "domelementtype@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz"
},
"readable-stream": {
"version": "1.1.13",
"from": "readable-stream@>=1.1.0 <1.2.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.13.tgz",
"dependencies": {
"core-util-is": {
"version": "1.0.1",
"from": "core-util-is@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
},
"isarray": {
"version": "0.0.1",
"from": "isarray@0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
},
"string_decoder": {
"version": "0.10.31",
"from": "string_decoder@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
}
}
},
"entities": {
"version": "1.0.0",
"from": "entities@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz"
}
}
},
"nwmatcher": {
"version": "1.3.3",
"from": "nwmatcher@>=1.3.2 <1.4.0",
"resolved": "https://registry.npmjs.org/nwmatcher/-/nwmatcher-1.3.3.tgz"
},
"xmlhttprequest": {
"version": "1.6.0",
"from": "xmlhttprequest@>=1.5.0",
"resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.6.0.tgz"
},
"cssom": {
"version": "0.3.0",
"from": "cssom@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.0.tgz"
},
"cssstyle": {
"version": "0.2.22",
"from": "cssstyle@>=0.2.9 <0.3.0",
"resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-0.2.22.tgz"
},
"contextify": {
"version": "0.1.9",
"from": "contextify@>=0.1.5 <0.2.0",
"resolved": "https://registry.npmjs.org/contextify/-/contextify-0.1.9.tgz",
"dependencies": {
"bindings": {
"version": "1.2.1",
"from": "bindings@*",
"resolved": "https://registry.npmjs.org/bindings/-/bindings-1.2.1.tgz"
},
"nan": {
"version": "1.3.0",
"from": "nan@>=1.3.0 <1.4.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-1.3.0.tgz"
}
}
}
}
},
"lodash": {
"version": "2.4.1",
"from": "lodash@2.4.1",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.1.tgz"
},
"mkdirp": {
"version": "0.3.5",
"from": "mkdirp@0.3.5",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz"
},
"normalizeurl": {
"version": "0.1.3",
"from": "normalizeurl@0.1.3",
"resolved": "https://registry.npmjs.org/normalizeurl/-/normalizeurl-0.1.3.tgz"
},
"optimist": {
"version": "0.6.1",
"from": "optimist@0.6.1",
"resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz",
"dependencies": {
"wordwrap": {
"version": "0.0.2",
"from": "wordwrap@>=0.0.2 <0.1.0",
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz"
},
"minimist": {
"version": "0.0.10",
"from": "minimist@>=0.0.1 <0.1.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz"
}
}
},
"request": {
"version": "2.9.153",
"from": "request@2.9.153",
"resolved": "https://registry.npmjs.org/request/-/request-2.9.153.tgz"
},
"setimmediate": {
"version": "1.0.2",
"from": "setimmediate@1.0.2",
"resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.2.tgz"
},
"source-map": {
"version": "0.1.33",
"from": "source-map@0.1.33",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.33.tgz",
"dependencies": {
"amdefine": {
"version": "0.1.0",
"from": "amdefine@>=0.0.4",
"resolved": "https://registry.npmjs.org/amdefine/-/amdefine-0.1.0.tgz"
}
}
},
"uglify-js-papandreou": {
"version": "2.4.13-patch1",
"from": "uglify-js-papandreou@2.4.13-patch1",
"resolved": "https://registry.npmjs.org/uglify-js-papandreou/-/uglify-js-papandreou-2.4.13-patch1.tgz",
"dependencies": {
"optimist": {
"version": "0.3.7",
"from": "optimist@>=0.3.5 <0.4.0",
"resolved": "https://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz",
"dependencies": {
"wordwrap": {
"version": "0.0.2",
"from": "wordwrap@>=0.0.2 <0.1.0",
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz"
}
}
},
"uglify-to-browserify": {
"version": "1.0.2",
"from": "uglify-to-browserify@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz"
}
}
},
"uglifyast": {
"version": "0.3.1",
"from": "uglifyast@0.3.1",
"resolved": "https://registry.npmjs.org/uglifyast/-/uglifyast-0.3.1.tgz"
},
"urltools": {
"version": "0.1.1",
"from": "urltools@0.1.1",
"resolved": "https://registry.npmjs.org/urltools/-/urltools-0.1.1.tgz",
"dependencies": {
"underscore": {
"version": "1.5.2",
"from": "underscore@>=1.5.2 <1.6.0",
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.5.2.tgz"
},
"glob": {
"version": "3.2.11",
"from": "glob@>=3.2.7 <3.3.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-3.2.11.tgz",
"dependencies": {
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
},
"minimatch": {
"version": "0.3.0",
"from": "minimatch@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz",
"dependencies": {
"lru-cache": {
"version": "2.5.0",
"from": "lru-cache@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz"
},
"sigmund": {
"version": "1.0.0",
"from": "sigmund@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz"
}
}
}
}
}
}
},
"xmldom": {
"version": "0.1.19",
"from": "xmldom@0.1.19",
"resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.19.tgz"
}
}
},
"optimist": {
"version": "0.5.2",
"from": "optimist@0.5.2",
"resolved": "https://registry.npmjs.org/optimist/-/optimist-0.5.2.tgz",
"dependencies": {
"wordwrap": {
"version": "0.0.2",
"from": "wordwrap@>=0.0.2 <0.1.0",
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz"
}
}
},
"passerror": {
"version": "1.0.1",
"from": "passerror@1.0.1",
"resolved": "https://registry.npmjs.org/passerror/-/passerror-1.0.1.tgz"
}
}
}
}
},
"extend": {
"version": "1.2.1",
"from": "extend@1.2.1",
"resolved": "https://registry.npmjs.org/extend/-/extend-1.2.1.tgz"
},
"jpegtran": {
"version": "0.0.6",
"from": "jpegtran@0.0.6",
"resolved": "https://registry.npmjs.org/jpegtran/-/jpegtran-0.0.6.tgz",
"dependencies": {
"memoizeasync": {
"version": "0.0.1",
"from": "memoizeasync@0.0.1",
"resolved": "https://registry.npmjs.org/memoizeasync/-/memoizeasync-0.0.1.tgz"
},
"jpegtran-bin": {
"version": "0.1.0",
"from": "jpegtran-bin@0.1.0",
"resolved": "https://registry.npmjs.org/jpegtran-bin/-/jpegtran-bin-0.1.0.tgz"
},
"which": {
"version": "1.0.5",
"from": "which@1.0.5",
"resolved": "https://registry.npmjs.org/which/-/which-1.0.5.tgz"
}
}
},
"memoizesync": {
"version": "0.2.0",
"from": "memoizesync@0.2.0",
"resolved": "https://registry.npmjs.org/memoizesync/-/memoizesync-0.2.0.tgz",
"dependencies": {
"lru-cache": {
"version": "2.3.1",
"from": "lru-cache@2.3.1",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.3.1.tgz"
}
}
},
"ngmin": {
"version": "0.4.0",
"from": "ngmin@0.4.0",
"resolved": "https://registry.npmjs.org/ngmin/-/ngmin-0.4.0.tgz",
"dependencies": {
"astral": {
"version": "0.1.0",
"from": "astral@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/astral/-/astral-0.1.0.tgz"
},
"astral-angular-annotate": {
"version": "0.0.2",
"from": "astral-angular-annotate@>=0.0.1 <0.1.0",
"resolved": "https://registry.npmjs.org/astral-angular-annotate/-/astral-angular-annotate-0.0.2.tgz",
"dependencies": {
"astral-pass": {
"version": "0.1.0",
"from": "astral-pass@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/astral-pass/-/astral-pass-0.1.0.tgz"
}
}
},
"escodegen": {
"version": "0.0.28",
"from": "escodegen@>=0.0.15 <0.1.0",
"resolved": "https://registry.npmjs.org/escodegen/-/escodegen-0.0.28.tgz",
"dependencies": {
"estraverse": {
"version": "1.3.2",
"from": "estraverse@>=1.3.0 <1.4.0",
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.3.2.tgz"
},
"source-map": {
"version": "0.1.40",
"from": "source-map@>=0.1.2",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.40.tgz",
"dependencies": {
"amdefine": {
"version": "0.1.0",
"from": "amdefine@>=0.0.4",
"resolved": "https://registry.npmjs.org/amdefine/-/amdefine-0.1.0.tgz"
}
}
}
}
},
"esprima": {
"version": "1.0.4",
"from": "esprima@>=1.0.2 <1.1.0",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-1.0.4.tgz"
},
"commander": {
"version": "1.1.1",
"from": "commander@>=1.1.1 <1.2.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-1.1.1.tgz",
"dependencies": {
"keypress": {
"version": "0.1.0",
"from": "keypress@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/keypress/-/keypress-0.1.0.tgz"
}
}
},
"clone": {
"version": "0.1.19",
"from": "clone@>=0.1.6 <0.2.0",
"resolved": "https://registry.npmjs.org/clone/-/clone-0.1.19.tgz"
}
}
},
"optimist": {
"version": "0.2.6",
"from": "optimist@0.2.6",
"resolved": "https://registry.npmjs.org/optimist/-/optimist-0.2.6.tgz",
"dependencies": {
"wordwrap": {
"version": "0.0.2",
"from": "wordwrap@>=0.0.1 <0.1.0",
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz"
}
}
},
"optipng": {
"version": "0.0.6",
"from": "optipng@0.0.6",
"resolved": "https://registry.npmjs.org/optipng/-/optipng-0.0.6.tgz",
"dependencies": {
"gettemporaryfilepath": {
"version": "0.0.1",
"from": "gettemporaryfilepath@0.0.1",
"resolved": "https://registry.npmjs.org/gettemporaryfilepath/-/gettemporaryfilepath-0.0.1.tgz"
},
"memoizeasync": {
"version": "0.0.1",
"from": "memoizeasync@0.0.1",
"resolved": "https://registry.npmjs.org/memoizeasync/-/memoizeasync-0.0.1.tgz"
},
"optipng-bin": {
"version": "0.1.0",
"from": "optipng-bin@0.1.0",
"resolved": "https://registry.npmjs.org/optipng-bin/-/optipng-bin-0.1.0.tgz"
},
"which": {
"version": "1.0.5",
"from": "which@1.0.5",
"resolved": "https://registry.npmjs.org/which/-/which-1.0.5.tgz"
}
}
},
"passerror": {
"version": "1.0.0",
"from": "passerror@1.0.0",
"resolved": "https://registry.npmjs.org/passerror/-/passerror-1.0.0.tgz"
},
"pngcrush": {
"version": "0.0.5",
"from": "pngcrush@0.0.5",
"resolved": "https://registry.npmjs.org/pngcrush/-/pngcrush-0.0.5.tgz",
"dependencies": {
"gettemporaryfilepath": {
"version": "0.0.1",
"from": "gettemporaryfilepath@0.0.1",
"resolved": "https://registry.npmjs.org/gettemporaryfilepath/-/gettemporaryfilepath-0.0.1.tgz"
}
}
},
"pngquant": {
"version": "0.1.5",
"from": "pngquant@0.1.5",
"resolved": "https://registry.npmjs.org/pngquant/-/pngquant-0.1.5.tgz",
"dependencies": {
"pngquant-bin": {
"version": "0.1.7",
"from": "pngquant-bin@0.1.7",
"resolved": "https://registry.npmjs.org/pngquant-bin/-/pngquant-bin-0.1.7.tgz",
"dependencies": {
"bin-wrapper": {
"version": "0.2.4",
"from": "bin-wrapper@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/bin-wrapper/-/bin-wrapper-0.2.4.tgz",
"dependencies": {
"bin-check": {
"version": "0.1.5",
"from": "bin-check@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/bin-check/-/bin-check-0.1.5.tgz"
},
"download": {
"version": "0.1.19",
"from": "download@>=0.1.2 <0.2.0",
"resolved": "https://registry.npmjs.org/download/-/download-0.1.19.tgz",
"dependencies": {
"decompress": {
"version": "0.2.5",
"from": "decompress@>=0.2.5 <0.3.0",
"resolved": "https://registry.npmjs.org/decompress/-/decompress-0.2.5.tgz",
"dependencies": {
"adm-zip": {
"version": "0.4.4",
"from": "adm-zip@>=0.4.3 <0.5.0",
"resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.4.tgz"
},
"ext-name": {
"version": "1.0.1",
"from": "ext-name@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/ext-name/-/ext-name-1.0.1.tgz",
"dependencies": {
"ext-list": {
"version": "0.2.0",
"from": "ext-list@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/ext-list/-/ext-list-0.2.0.tgz",
"dependencies": {
"got": {
"version": "0.2.0",
"from": "got@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/got/-/got-0.2.0.tgz",
"dependencies": {
"object-assign": {
"version": "0.3.1",
"from": "object-assign@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-0.3.1.tgz"
}
}
}
}
},
"underscore.string": {
"version": "2.3.3",
"from": "underscore.string@>=2.3.3 <2.4.0",
"resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.3.3.tgz"
}
}
},
"stream-combiner": {
"version": "0.0.4",
"from": "stream-combiner@>=0.0.4 <0.0.5",
"resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz",
"dependencies": {
"duplexer": {
"version": "0.1.1",
"from": "duplexer@>=0.1.1 <0.2.0",
"resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz"
}
}
},
"tar": {
"version": "0.1.20",
"from": "tar@>=0.1.18 <0.2.0",
"resolved": "https://registry.npmjs.org/tar/-/tar-0.1.20.tgz",
"dependencies": {
"block-stream": {
"version": "0.0.7",
"from": "block-stream@*",
"resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.7.tgz"
},
"fstream": {
"version": "0.1.31",
"from": "fstream@>=0.1.28 <0.2.0",
"resolved": "https://registry.npmjs.org/fstream/-/fstream-0.1.31.tgz",
"dependencies": {
"graceful-fs": {
"version": "3.0.5",
"from": "graceful-fs@>=3.0.2 <3.1.0",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.5.tgz"
},
"mkdirp": {
"version": "0.5.0",
"from": "mkdirp@>=0.5.0 <0.6.0",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz",
"dependencies": {
"minimist": {
"version": "0.0.8",
"from": "minimist@0.0.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz"
}
}
}
}
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
}
}
}
}
},
"each-async": {
"version": "0.1.3",
"from": "each-async@>=0.1.1 <0.2.0",
"resolved": "https://registry.npmjs.org/each-async/-/each-async-0.1.3.tgz"
},
"get-stdin": {
"version": "0.1.0",
"from": "get-stdin@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-0.1.0.tgz"
},
"get-urls": {
"version": "0.1.2",
"from": "get-urls@>=0.1.1 <0.2.0",
"resolved": "https://registry.npmjs.org/get-urls/-/get-urls-0.1.2.tgz"
},
"mkdirp": {
"version": "0.3.5",
"from": "mkdirp@>=0.3.5 <0.4.0",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz"
},
"nopt": {
"version": "2.2.1",
"from": "nopt@>=2.2.0 <3.0.0",
"resolved": "https://registry.npmjs.org/nopt/-/nopt-2.2.1.tgz",
"dependencies": {
"abbrev": {
"version": "1.0.5",
"from": "abbrev@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.5.tgz"
}
}
},
"request": {
"version": "2.49.0",
"from": "request@>=2.34.0 <3.0.0",
"resolved": "https://registry.npmjs.org/request/-/request-2.49.0.tgz",
"dependencies": {
"bl": {
"version": "0.9.3",
"from": "bl@>=0.9.0 <0.10.0",
"resolved": "https://registry.npmjs.org/bl/-/bl-0.9.3.tgz",
"dependencies": {
"readable-stream": {
"version": "1.0.33",
"from": "readable-stream@>=1.0.26 <1.1.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz",
"dependencies": {
"core-util-is": {
"version": "1.0.1",
"from": "core-util-is@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
},
"isarray": {
"version": "0.0.1",
"from": "isarray@0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
},
"string_decoder": {
"version": "0.10.31",
"from": "string_decoder@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
}
}
}
}
},
"caseless": {
"version": "0.8.0",
"from": "caseless@>=0.8.0 <0.9.0",
"resolved": "https://registry.npmjs.org/caseless/-/caseless-0.8.0.tgz"
},
"forever-agent": {
"version": "0.5.2",
"from": "forever-agent@>=0.5.0 <0.6.0",
"resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.5.2.tgz"
},
"form-data": {
"version": "0.1.4",
"from": "form-data@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-0.1.4.tgz",
"dependencies": {
"mime": {
"version": "1.2.11",
"from": "mime@>=1.2.11 <1.3.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz"
},
"async": {
"version": "0.9.0",
"from": "async@>=0.9.0 <0.10.0",
"resolved": "https://registry.npmjs.org/async/-/async-0.9.0.tgz"
}
}
},
"json-stringify-safe": {
"version": "5.0.0",
"from": "json-stringify-safe@>=5.0.0 <5.1.0",
"resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.0.tgz"
},
"mime-types": {
"version": "1.0.2",
"from": "mime-types@>=1.0.1 <1.1.0",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-1.0.2.tgz"
},
"node-uuid": {
"version": "1.4.2",
"from": "node-uuid@>=1.4.0 <1.5.0",
"resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.2.tgz"
},
"qs": {
"version": "2.3.3",
"from": "qs@>=2.3.1 <2.4.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-2.3.3.tgz"
},
"tunnel-agent": {
"version": "0.4.0",
"from": "tunnel-agent@>=0.4.0 <0.5.0",
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.0.tgz"
},
"tough-cookie": {
"version": "0.12.1",
"from": "tough-cookie@>=0.12.0",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-0.12.1.tgz",
"dependencies": {
"punycode": {
"version": "1.3.2",
"from": "punycode@>=0.2.0",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz"
}
}
},
"http-signature": {
"version": "0.10.0",
"from": "http-signature@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/http-signature/-/http-signature-0.10.0.tgz",
"dependencies": {
"assert-plus": {
"version": "0.1.2",
"from": "assert-plus@0.1.2",
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.2.tgz"
},
"asn1": {
"version": "0.1.11",
"from": "asn1@0.1.11",
"resolved": "https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz"
},
"ctype": {
"version": "0.5.2",
"from": "ctype@0.5.2",
"resolved": "https://registry.npmjs.org/ctype/-/ctype-0.5.2.tgz"
}
}
},
"oauth-sign": {
"version": "0.5.0",
"from": "oauth-sign@>=0.5.0 <0.6.0",
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.5.0.tgz"
},
"hawk": {
"version": "1.1.1",
"from": "hawk@1.1.1",
"resolved": "https://registry.npmjs.org/hawk/-/hawk-1.1.1.tgz",
"dependencies": {
"hoek": {
"version": "0.9.1",
"from": "hoek@>=0.9.0 <0.10.0",
"resolved": "https://registry.npmjs.org/hoek/-/hoek-0.9.1.tgz"
},
"boom": {
"version": "0.4.2",
"from": "boom@>=0.4.0 <0.5.0",
"resolved": "https://registry.npmjs.org/boom/-/boom-0.4.2.tgz"
},
"cryptiles": {
"version": "0.2.2",
"from": "cryptiles@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-0.2.2.tgz"
},
"sntp": {
"version": "0.2.4",
"from": "sntp@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/sntp/-/sntp-0.2.4.tgz"
}
}
},
"aws-sign2": {
"version": "0.5.0",
"from": "aws-sign2@>=0.5.0 <0.6.0",
"resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz"
},
"stringstream": {
"version": "0.0.4",
"from": "stringstream@>=0.0.4 <0.1.0",
"resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.4.tgz"
},
"combined-stream": {
"version": "0.0.7",
"from": "combined-stream@>=0.0.5 <0.1.0",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz",
"dependencies": {
"delayed-stream": {
"version": "0.0.5",
"from": "delayed-stream@0.0.5",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz"
}
}
}
}
},
"through2": {
"version": "0.4.2",
"from": "through2@>=0.4.0 <0.5.0",
"resolved": "https://registry.npmjs.org/through2/-/through2-0.4.2.tgz",
"dependencies": {
"readable-stream": {
"version": "1.0.33",
"from": "readable-stream@>=1.0.17 <1.1.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz",
"dependencies": {
"core-util-is": {
"version": "1.0.1",
"from": "core-util-is@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
},
"isarray": {
"version": "0.0.1",
"from": "isarray@0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
},
"string_decoder": {
"version": "0.10.31",
"from": "string_decoder@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
}
}
},
"xtend": {
"version": "2.1.2",
"from": "xtend@>=2.1.1 <2.2.0",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz",
"dependencies": {
"object-keys": {
"version": "0.4.0",
"from": "object-keys@>=0.4.0 <0.5.0",
"resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz"
}
}
}
}
}
}
},
"executable": {
"version": "0.1.3",
"from": "executable@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/executable/-/executable-0.1.3.tgz"
},
"find-file": {
"version": "0.1.4",
"from": "find-file@>=0.1.2 <0.2.0",
"resolved": "https://registry.npmjs.org/find-file/-/find-file-0.1.4.tgz"
},
"mout": {
"version": "0.9.1",
"from": "mout@>=0.9.1 <0.10.0",
"resolved": "https://registry.npmjs.org/mout/-/mout-0.9.1.tgz"
},
"rimraf": {
"version": "2.2.8",
"from": "rimraf@>=2.2.6 <3.0.0",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz"
},
"tempfile": {
"version": "0.1.3",
"from": "tempfile@>=0.1.2 <0.2.0",
"resolved": "https://registry.npmjs.org/tempfile/-/tempfile-0.1.3.tgz",
"dependencies": {
"uuid": {
"version": "1.4.2",
"from": "uuid@>=1.4.0 <1.5.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-1.4.2.tgz"
}
}
}
}
}
}
}
}
},
"semver": {
"version": "3.0.1",
"from": "semver@3.0.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-3.0.1.tgz"
},
"seq": {
"version": "0.3.5",
"from": "seq@0.3.5",
"resolved": "https://registry.npmjs.org/seq/-/seq-0.3.5.tgz",
"dependencies": {
"chainsaw": {
"version": "0.0.9",
"from": "chainsaw@0.0.9",
"resolved": "https://registry.npmjs.org/chainsaw/-/chainsaw-0.0.9.tgz",
"dependencies": {
"traverse": {
"version": "0.3.9",
"from": "traverse@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/traverse/-/traverse-0.3.9.tgz"
}
}
},
"hashish": {
"version": "0.0.4",
"from": "hashish@>=0.0.2 <0.1.0",
"resolved": "https://registry.npmjs.org/hashish/-/hashish-0.0.4.tgz",
"dependencies": {
"traverse": {
"version": "0.6.6",
"from": "traverse@>=0.2.4",
"resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz"
}
}
}
}
},
"temp": {
"version": "0.4.0",
"from": "temp@0.4.0",
"resolved": "https://registry.npmjs.org/temp/-/temp-0.4.0.tgz"
},
"underscore": {
"version": "1.2.0",
"from": "underscore@1.2.0",
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.2.0.tgz"
},
"urltools": {
"version": "0.2.0",
"from": "urltools@0.2.0",
"resolved": "https://registry.npmjs.org/urltools/-/urltools-0.2.0.tgz",
"dependencies": {
"underscore": {
"version": "1.5.2",
"from": "underscore@1.5.2",
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.5.2.tgz"
},
"glob": {
"version": "3.2.11",
"from": "glob@3.2.11",
"resolved": "https://registry.npmjs.org/glob/-/glob-3.2.11.tgz",
"dependencies": {
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
},
"minimatch": {
"version": "0.3.0",
"from": "minimatch@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz",
"dependencies": {
"lru-cache": {
"version": "2.5.0",
"from": "lru-cache@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz"
},
"sigmund": {
"version": "1.0.0",
"from": "sigmund@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz"
}
}
}
}
}
}
},
"assetgraph-sprite": {
"version": "0.6.2",
"from": "assetgraph-sprite@0.6.2",
"resolved": "https://registry.npmjs.org/assetgraph-sprite/-/assetgraph-sprite-0.6.2.tgz",
"dependencies": {
"passerror": {
"version": "0.0.1",
"from": "passerror@0.0.1",
"resolved": "https://registry.npmjs.org/passerror/-/passerror-0.0.1.tgz"
},
"underscore": {
"version": "1.4.2",
"from": "underscore@1.4.2",
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.4.2.tgz"
},
"canvas": {
"version": "1.1.2",
"from": "canvas@1.1.2",
"resolved": "https://registry.npmjs.org/canvas/-/canvas-1.1.2.tgz",
"dependencies": {
"nan": {
"version": "0.4.4",
"from": "nan@>=0.4.1 <0.5.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-0.4.4.tgz"
}
}
}
}
},
"histogram": {
"version": "0.1.5",
"from": "histogram@0.1.5",
"resolved": "https://registry.npmjs.org/histogram/-/histogram-0.1.5.tgz",
"dependencies": {
"canvas": {
"version": "1.1.6",
"from": "canvas@>=1.1.1 <1.2.0",
"resolved": "https://registry.npmjs.org/canvas/-/canvas-1.1.6.tgz",
"dependencies": {
"nan": {
"version": "1.2.0",
"from": "nan@>=1.2.0 <1.3.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-1.2.0.tgz"
}
}
}
}
},
"node-zopfli": {
"version": "1.1.4",
"from": "node-zopfli@1.1.4",
"resolved": "https://registry.npmjs.org/node-zopfli/-/node-zopfli-1.1.4.tgz",
"dependencies": {
"commander": {
"version": "2.2.0",
"from": "commander@>=2.2.0 <2.3.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.2.0.tgz"
},
"buffer-crc32": {
"version": "0.2.5",
"from": "buffer-crc32@>=0.2.1 <0.3.0",
"resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.5.tgz"
},
"async": {
"version": "0.9.0",
"from": "async@>=0.9.0 <0.10.0",
"resolved": "https://registry.npmjs.org/async/-/async-0.9.0.tgz"
},
"lodash": {
"version": "2.4.1",
"from": "lodash@>=2.4.1 <2.5.0",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.1.tgz"
},
"nan": {
"version": "1.1.2",
"from": "nan@>=1.1.0 <1.2.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-1.1.2.tgz"
},
"node-pre-gyp": {
"version": "0.5.31",
"from": "node-pre-gyp@>=0.5.11 <0.6.0",
"resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.5.31.tgz",
"dependencies": {
"nopt": {
"version": "3.0.1",
"from": "nopt@~3.0.1",
"resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.1.tgz",
"dependencies": {
"abbrev": {
"version": "1.0.5",
"from": "abbrev@1",
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.5.tgz"
}
}
},
"npmlog": {
"version": "0.1.1",
"from": "npmlog@~0.1.1",
"resolved": "https://registry.npmjs.org/npmlog/-/npmlog-0.1.1.tgz",
"dependencies": {
"ansi": {
"version": "0.3.0",
"from": "ansi@~0.3.0",
"resolved": "https://registry.npmjs.org/ansi/-/ansi-0.3.0.tgz"
}
}
},
"request": {
"version": "2.47.0",
"from": "request@2.x",
"resolved": "https://registry.npmjs.org/request/-/request-2.47.0.tgz",
"dependencies": {
"bl": {
"version": "0.9.3",
"from": "bl@~0.9.0",
"resolved": "https://registry.npmjs.org/bl/-/bl-0.9.3.tgz",
"dependencies": {
"readable-stream": {
"version": "1.0.33",
"from": "readable-stream@~1.0.26",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz",
"dependencies": {
"core-util-is": {
"version": "1.0.1",
"from": "core-util-is@~1.0.0",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
},
"isarray": {
"version": "0.0.1",
"from": "isarray@0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
},
"string_decoder": {
"version": "0.10.31",
"from": "string_decoder@~0.10.x",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
},
"inherits": {
"version": "2.0.1",
"from": "inherits@~2.0.1",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
}
}
}
}
},
"caseless": {
"version": "0.6.0",
"from": "caseless@~0.6.0",
"resolved": "https://registry.npmjs.org/caseless/-/caseless-0.6.0.tgz"
},
"forever-agent": {
"version": "0.5.2",
"from": "forever-agent@~0.5.0",
"resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.5.2.tgz"
},
"form-data": {
"version": "0.1.4",
"from": "form-data@~0.1.0",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-0.1.4.tgz",
"dependencies": {
"mime": {
"version": "1.2.11",
"from": "mime@~1.2.11",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz"
},
"async": {
"version": "0.9.0",
"from": "async@~0.9.0",
"resolved": "https://registry.npmjs.org/async/-/async-0.9.0.tgz"
}
}
},
"json-stringify-safe": {
"version": "5.0.0",
"from": "json-stringify-safe@~5.0.0",
"resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.0.tgz"
},
"mime-types": {
"version": "1.0.2",
"from": "mime-types@~1.0.1",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-1.0.2.tgz"
},
"node-uuid": {
"version": "1.4.1",
"from": "node-uuid@~1.4.0",
"resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.1.tgz"
},
"qs": {
"version": "2.3.1",
"from": "qs@~2.3.1",
"resolved": "https://registry.npmjs.org/qs/-/qs-2.3.1.tgz"
},
"tunnel-agent": {
"version": "0.4.0",
"from": "tunnel-agent@~0.4.0",
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.0.tgz"
},
"tough-cookie": {
"version": "0.12.1",
"from": "tough-cookie@>=0.12.0",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-0.12.1.tgz",
"dependencies": {
"punycode": {
"version": "1.3.2",
"from": "punycode@>=0.2.0",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz"
}
}
},
"http-signature": {
"version": "0.10.0",
"from": "http-signature@~0.10.0",
"resolved": "https://registry.npmjs.org/http-signature/-/http-signature-0.10.0.tgz",
"dependencies": {
"assert-plus": {
"version": "0.1.2",
"from": "assert-plus@0.1.2",
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.2.tgz"
},
"asn1": {
"version": "0.1.11",
"from": "asn1@0.1.11",
"resolved": "https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz"
},
"ctype": {
"version": "0.5.2",
"from": "ctype@0.5.2",
"resolved": "https://registry.npmjs.org/ctype/-/ctype-0.5.2.tgz"
}
}
},
"oauth-sign": {
"version": "0.4.0",
"from": "oauth-sign@~0.4.0",
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.4.0.tgz"
},
"hawk": {
"version": "1.1.1",
"from": "hawk@1.1.1",
"resolved": "https://registry.npmjs.org/hawk/-/hawk-1.1.1.tgz",
"dependencies": {
"hoek": {
"version": "0.9.1",
"from": "hoek@0.9.x",
"resolved": "https://registry.npmjs.org/hoek/-/hoek-0.9.1.tgz"
},
"boom": {
"version": "0.4.2",
"from": "boom@0.4.x",
"resolved": "https://registry.npmjs.org/boom/-/boom-0.4.2.tgz"
},
"cryptiles": {
"version": "0.2.2",
"from": "cryptiles@0.2.x",
"resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-0.2.2.tgz"
},
"sntp": {
"version": "0.2.4",
"from": "sntp@0.2.x",
"resolved": "https://registry.npmjs.org/sntp/-/sntp-0.2.4.tgz"
}
}
},
"aws-sign2": {
"version": "0.5.0",
"from": "aws-sign2@~0.5.0",
"resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz"
},
"stringstream": {
"version": "0.0.4",
"from": "stringstream@~0.0.4",
"resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.4.tgz"
},
"combined-stream": {
"version": "0.0.5",
"from": "combined-stream@~0.0.5",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.5.tgz",
"dependencies": {
"delayed-stream": {
"version": "0.0.5",
"from": "delayed-stream@0.0.5",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz"
}
}
}
}
},
"semver": {
"version": "4.1.0",
"from": "semver@~4.1.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-4.1.0.tgz"
},
"tar": {
"version": "1.0.1",
"from": "tar@~1.0.1",
"resolved": "https://registry.npmjs.org/tar/-/tar-1.0.1.tgz",
"dependencies": {
"block-stream": {
"version": "0.0.7",
"from": "block-stream@*",
"resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.7.tgz"
},
"fstream": {
"version": "1.0.2",
"from": "fstream@^1.0.2",
"resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.2.tgz",
"dependencies": {
"graceful-fs": {
"version": "3.0.4",
"from": "graceful-fs@3",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.4.tgz"
}
}
},
"inherits": {
"version": "2.0.1",
"from": "inherits@2",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
}
}
},
"tar-pack": {
"version": "2.0.0",
"from": "tar-pack@~2.0.0",
"resolved": "https://registry.npmjs.org/tar-pack/-/tar-pack-2.0.0.tgz",
"dependencies": {
"uid-number": {
"version": "0.0.3",
"from": "uid-number@0.0.3",
"resolved": "https://registry.npmjs.org/uid-number/-/uid-number-0.0.3.tgz"
},
"once": {
"version": "1.1.1",
"from": "once@~1.1.1",
"resolved": "https://registry.npmjs.org/once/-/once-1.1.1.tgz"
},
"debug": {
"version": "0.7.4",
"from": "debug@~0.7.2",
"resolved": "https://registry.npmjs.org/debug/-/debug-0.7.4.tgz"
},
"fstream": {
"version": "0.1.31",
"from": "fstream@~0.1.22",
"resolved": "https://registry.npmjs.org/fstream/-/fstream-0.1.31.tgz",
"dependencies": {
"graceful-fs": {
"version": "3.0.4",
"from": "graceful-fs@3",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.4.tgz"
},
"inherits": {
"version": "2.0.1",
"from": "inherits@~2.0.1",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
}
}
},
"tar": {
"version": "0.1.20",
"from": "tar@~0.1.17",
"resolved": "https://registry.npmjs.org/tar/-/tar-0.1.20.tgz",
"dependencies": {
"block-stream": {
"version": "0.0.7",
"from": "block-stream@*",
"resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.7.tgz"
},
"inherits": {
"version": "2.0.1",
"from": "inherits@~2.0.1",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
}
}
},
"fstream-ignore": {
"version": "0.0.7",
"from": "fstream-ignore@0.0.7",
"resolved": "https://registry.npmjs.org/fstream-ignore/-/fstream-ignore-0.0.7.tgz",
"dependencies": {
"minimatch": {
"version": "0.2.14",
"from": "minimatch@~0.2.0",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz",
"dependencies": {
"lru-cache": {
"version": "2.5.0",
"from": "lru-cache@2",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz"
},
"sigmund": {
"version": "1.0.0",
"from": "sigmund@~1.0.0",
"resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz"
}
}
},
"inherits": {
"version": "2.0.1",
"from": "inherits@~2.0.1",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
}
}
},
"readable-stream": {
"version": "1.0.33",
"from": "readable-stream@~1.0.2",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz",
"dependencies": {
"core-util-is": {
"version": "1.0.1",
"from": "core-util-is@~1.0.0",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
},
"isarray": {
"version": "0.0.1",
"from": "isarray@0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
},
"string_decoder": {
"version": "0.10.31",
"from": "string_decoder@~0.10.x",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
},
"inherits": {
"version": "2.0.1",
"from": "inherits@~2.0.1",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
}
}
},
"graceful-fs": {
"version": "1.2.3",
"from": "graceful-fs@1.2",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz"
}
}
},
"mkdirp": {
"version": "0.5.0",
"from": "mkdirp@~0.5.0",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz",
"dependencies": {
"minimist": {
"version": "0.0.8",
"from": "minimist@0.0.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz"
}
}
},
"rc": {
"version": "0.5.2",
"from": "rc@~0.5.1",
"resolved": "https://registry.npmjs.org/rc/-/rc-0.5.2.tgz",
"dependencies": {
"minimist": {
"version": "0.0.10",
"from": "minimist@~0.0.7",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz"
},
"deep-extend": {
"version": "0.2.11",
"from": "deep-extend@~0.2.5",
"resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.2.11.tgz"
},
"strip-json-comments": {
"version": "0.1.3",
"from": "strip-json-comments@0.1.x",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-0.1.3.tgz"
},
"ini": {
"version": "1.1.0",
"from": "ini@~1.1.0",
"resolved": "https://registry.npmjs.org/ini/-/ini-1.1.0.tgz"
}
}
},
"rimraf": {
"version": "2.2.8",
"from": "rimraf@~2.2.8",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz"
}
}
}
}
}
}
},
"autoprefixer": {
"version": "4.0.0",
"from": "autoprefixer@>=4.0.0 <5.0.0",
"resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-4.0.0.tgz",
"dependencies": {
"fs-extra": {
"version": "0.11.1",
"from": "fs-extra@0.11.1",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.11.1.tgz",
"dependencies": {
"ncp": {
"version": "0.6.0",
"from": "ncp@>=0.6.0 <0.7.0",
"resolved": "https://registry.npmjs.org/ncp/-/ncp-0.6.0.tgz"
},
"mkdirp": {
"version": "0.5.0",
"from": "mkdirp@>=0.5.0 <0.6.0",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz",
"dependencies": {
"minimist": {
"version": "0.0.8",
"from": "minimist@0.0.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz"
}
}
},
"jsonfile": {
"version": "2.0.0",
"from": "jsonfile@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.0.0.tgz"
},
"rimraf": {
"version": "2.2.8",
"from": "rimraf@>=2.2.8 <3.0.0",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz"
}
}
},
"postcss": {
"version": "3.0.7",
"from": "postcss@>=3.0.1 <3.1.0",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-3.0.7.tgz",
"dependencies": {
"source-map": {
"version": "0.1.40",
"from": "source-map@>=0.1.8 <0.2.0",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.40.tgz",
"dependencies": {
"amdefine": {
"version": "0.1.0",
"from": "amdefine@>=0.0.4",
"resolved": "https://registry.npmjs.org/amdefine/-/amdefine-0.1.0.tgz"
}
}
},
"js-base64": {
"version": "2.1.5",
"from": "js-base64@>=2.1.5 <2.2.0",
"resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.1.5.tgz"
}
}
}
}
},
"autoprefixer-core": {
"version": "4.0.2",
"from": "autoprefixer-core@>=4.0.1 <5.0.0",
"resolved": "https://registry.npmjs.org/autoprefixer-core/-/autoprefixer-core-4.0.2.tgz",
"dependencies": {
"caniuse-db": {
"version": "1.0.30000031",
"from": "caniuse-db@>=1.0.30000030 <2.0.0",
"resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30000031.tgz"
},
"postcss": {
"version": "3.0.7",
"from": "postcss@>=3.0.6 <3.1.0",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-3.0.7.tgz",
"dependencies": {
"source-map": {
"version": "0.1.40",
"from": "source-map@>=0.1.40 <0.2.0",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.40.tgz",
"dependencies": {
"amdefine": {
"version": "0.1.0",
"from": "amdefine@>=0.0.4",
"resolved": "https://registry.npmjs.org/amdefine/-/amdefine-0.1.0.tgz"
}
}
},
"js-base64": {
"version": "2.1.5",
"from": "js-base64@>=2.1.5 <2.2.0",
"resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.1.5.tgz"
}
}
}
}
},
"bower": {
"version": "1.3.12",
"from": "bower@>=1.3.12 <2.0.0",
"resolved": "https://registry.npmjs.org/bower/-/bower-1.3.12.tgz",
"dependencies": {
"abbrev": {
"version": "1.0.5",
"from": "abbrev@>=1.0.4 <1.1.0",
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.5.tgz"
},
"archy": {
"version": "0.0.2",
"from": "archy@0.0.2",
"resolved": "https://registry.npmjs.org/archy/-/archy-0.0.2.tgz"
},
"bower-config": {
"version": "0.5.2",
"from": "bower-config@>=0.5.2 <0.6.0",
"resolved": "https://registry.npmjs.org/bower-config/-/bower-config-0.5.2.tgz",
"dependencies": {
"graceful-fs": {
"version": "2.0.3",
"from": "graceful-fs@2.0.3",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-2.0.3.tgz"
},
"mout": {
"version": "0.9.1",
"from": "mout@0.9.1",
"resolved": "https://registry.npmjs.org/mout/-/mout-0.9.1.tgz"
},
"optimist": {
"version": "0.6.1",
"from": "optimist@0.6.1",
"resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz",
"dependencies": {
"wordwrap": {
"version": "0.0.2",
"from": "wordwrap@>=0.0.2 <0.1.0",
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz"
},
"minimist": {
"version": "0.0.10",
"from": "minimist@0.0.10",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz"
}
}
},
"osenv": {
"version": "0.0.3",
"from": "osenv@0.0.3",
"resolved": "https://registry.npmjs.org/osenv/-/osenv-0.0.3.tgz"
}
}
},
"bower-endpoint-parser": {
"version": "0.2.2",
"from": "bower-endpoint-parser@>=0.2.2 <0.3.0",
"resolved": "https://registry.npmjs.org/bower-endpoint-parser/-/bower-endpoint-parser-0.2.2.tgz"
},
"bower-json": {
"version": "0.4.0",
"from": "bower-json@>=0.4.0 <0.5.0",
"resolved": "https://registry.npmjs.org/bower-json/-/bower-json-0.4.0.tgz",
"dependencies": {
"deep-extend": {
"version": "0.2.11",
"from": "deep-extend@0.2.11",
"resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.2.11.tgz"
},
"graceful-fs": {
"version": "2.0.3",
"from": "graceful-fs@2.0.3",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-2.0.3.tgz"
},
"intersect": {
"version": "0.0.3",
"from": "intersect@0.0.3",
"resolved": "https://registry.npmjs.org/intersect/-/intersect-0.0.3.tgz"
}
}
},
"bower-logger": {
"version": "0.2.2",
"from": "bower-logger@>=0.2.2 <0.3.0",
"resolved": "https://registry.npmjs.org/bower-logger/-/bower-logger-0.2.2.tgz"
},
"bower-registry-client": {
"version": "0.2.1",
"from": "bower-registry-client@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/bower-registry-client/-/bower-registry-client-0.2.1.tgz",
"dependencies": {
"async": {
"version": "0.2.10",
"from": "async@0.2.10",
"resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz"
},
"graceful-fs": {
"version": "2.0.3",
"from": "graceful-fs@2.0.3",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-2.0.3.tgz"
},
"lru-cache": {
"version": "2.3.1",
"from": "lru-cache@2.3.1",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.3.1.tgz"
},
"request": {
"version": "2.27.0",
"from": "request@2.27.0",
"resolved": "https://registry.npmjs.org/request/-/request-2.27.0.tgz",
"dependencies": {
"qs": {
"version": "0.6.6",
"from": "qs@>=0.6.0 <0.7.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-0.6.6.tgz"
},
"json-stringify-safe": {
"version": "5.0.0",
"from": "json-stringify-safe@>=5.0.0 <5.1.0",
"resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.0.tgz"
},
"forever-agent": {
"version": "0.5.2",
"from": "forever-agent@>=0.5.0 <0.6.0",
"resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.5.2.tgz"
},
"tunnel-agent": {
"version": "0.3.0",
"from": "tunnel-agent@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.3.0.tgz"
},
"http-signature": {
"version": "0.10.0",
"from": "http-signature@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/http-signature/-/http-signature-0.10.0.tgz",
"dependencies": {
"assert-plus": {
"version": "0.1.2",
"from": "assert-plus@0.1.2",
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.2.tgz"
},
"asn1": {
"version": "0.1.11",
"from": "asn1@0.1.11",
"resolved": "https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz"
},
"ctype": {
"version": "0.5.2",
"from": "ctype@0.5.2",
"resolved": "https://registry.npmjs.org/ctype/-/ctype-0.5.2.tgz"
}
}
},
"hawk": {
"version": "1.0.0",
"from": "hawk@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/hawk/-/hawk-1.0.0.tgz",
"dependencies": {
"hoek": {
"version": "0.9.1",
"from": "hoek@>=0.9.0 <0.10.0",
"resolved": "https://registry.npmjs.org/hoek/-/hoek-0.9.1.tgz"
},
"boom": {
"version": "0.4.2",
"from": "boom@>=0.4.0 <0.5.0",
"resolved": "https://registry.npmjs.org/boom/-/boom-0.4.2.tgz"
},
"cryptiles": {
"version": "0.2.2",
"from": "cryptiles@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-0.2.2.tgz"
},
"sntp": {
"version": "0.2.4",
"from": "sntp@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/sntp/-/sntp-0.2.4.tgz"
}
}
},
"aws-sign": {
"version": "0.3.0",
"from": "aws-sign@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/aws-sign/-/aws-sign-0.3.0.tgz"
},
"oauth-sign": {
"version": "0.3.0",
"from": "oauth-sign@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.3.0.tgz"
},
"cookie-jar": {
"version": "0.3.0",
"from": "cookie-jar@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/cookie-jar/-/cookie-jar-0.3.0.tgz"
},
"node-uuid": {
"version": "1.4.2",
"from": "node-uuid@>=1.4.0 <1.5.0",
"resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.2.tgz"
},
"mime": {
"version": "1.2.11",
"from": "mime@>=1.2.9 <1.3.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz"
},
"form-data": {
"version": "0.1.4",
"from": "form-data@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-0.1.4.tgz",
"dependencies": {
"combined-stream": {
"version": "0.0.7",
"from": "combined-stream@>=0.0.4 <0.1.0",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz",
"dependencies": {
"delayed-stream": {
"version": "0.0.5",
"from": "delayed-stream@0.0.5",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz"
}
}
},
"async": {
"version": "0.9.0",
"from": "async@>=0.9.0 <0.10.0",
"resolved": "https://registry.npmjs.org/async/-/async-0.9.0.tgz"
}
}
}
}
},
"request-replay": {
"version": "0.2.0",
"from": "request-replay@0.2.0",
"resolved": "https://registry.npmjs.org/request-replay/-/request-replay-0.2.0.tgz",
"dependencies": {
"retry": {
"version": "0.6.1",
"from": "retry@>=0.6.0 <0.7.0",
"resolved": "https://registry.npmjs.org/retry/-/retry-0.6.1.tgz"
}
}
},
"mkdirp": {
"version": "0.3.5",
"from": "mkdirp@0.3.5",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz"
}
}
},
"cardinal": {
"version": "0.4.0",
"from": "cardinal@0.4.0",
"resolved": "https://registry.npmjs.org/cardinal/-/cardinal-0.4.0.tgz",
"dependencies": {
"redeyed": {
"version": "0.4.4",
"from": "redeyed@>=0.4.0 <0.5.0",
"resolved": "https://registry.npmjs.org/redeyed/-/redeyed-0.4.4.tgz",
"dependencies": {
"esprima": {
"version": "1.0.4",
"from": "esprima@>=1.0.4 <1.1.0",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-1.0.4.tgz"
}
}
}
}
},
"chalk": {
"version": "0.5.0",
"from": "chalk@0.5.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-0.5.0.tgz",
"dependencies": {
"ansi-styles": {
"version": "1.1.0",
"from": "ansi-styles@>=1.1.0 <2.0.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.1.0.tgz"
},
"escape-string-regexp": {
"version": "1.0.2",
"from": "escape-string-regexp@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz"
},
"has-ansi": {
"version": "0.1.0",
"from": "has-ansi@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-0.1.0.tgz",
"dependencies": {
"ansi-regex": {
"version": "0.2.1",
"from": "ansi-regex@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz"
}
}
},
"strip-ansi": {
"version": "0.3.0",
"from": "strip-ansi@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.3.0.tgz",
"dependencies": {
"ansi-regex": {
"version": "0.2.1",
"from": "ansi-regex@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz"
}
}
},
"supports-color": {
"version": "0.2.0",
"from": "supports-color@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-0.2.0.tgz"
}
}
},
"chmodr": {
"version": "0.1.0",
"from": "chmodr@0.1.0",
"resolved": "https://registry.npmjs.org/chmodr/-/chmodr-0.1.0.tgz"
},
"decompress-zip": {
"version": "0.0.8",
"from": "decompress-zip@0.0.8",
"resolved": "https://registry.npmjs.org/decompress-zip/-/decompress-zip-0.0.8.tgz",
"dependencies": {
"q": {
"version": "1.0.1",
"from": "q@1.0.1",
"resolved": "https://registry.npmjs.org/q/-/q-1.0.1.tgz"
},
"mkpath": {
"version": "0.1.0",
"from": "mkpath@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/mkpath/-/mkpath-0.1.0.tgz"
},
"binary": {
"version": "0.3.0",
"from": "binary@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/binary/-/binary-0.3.0.tgz",
"dependencies": {
"chainsaw": {
"version": "0.1.0",
"from": "chainsaw@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/chainsaw/-/chainsaw-0.1.0.tgz",
"dependencies": {
"traverse": {
"version": "0.3.9",
"from": "traverse@0.3.9",
"resolved": "https://registry.npmjs.org/traverse/-/traverse-0.3.9.tgz"
}
}
},
"buffers": {
"version": "0.1.1",
"from": "buffers@>=0.1.1 <0.2.0",
"resolved": "https://registry.npmjs.org/buffers/-/buffers-0.1.1.tgz"
}
}
},
"touch": {
"version": "0.0.2",
"from": "touch@0.0.2",
"resolved": "https://registry.npmjs.org/touch/-/touch-0.0.2.tgz",
"dependencies": {
"nopt": {
"version": "1.0.10",
"from": "nopt@>=1.0.10 <1.1.0",
"resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz",
"dependencies": {
"abbrev": {
"version": "1.0.5",
"from": "abbrev@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.5.tgz"
}
}
}
}
},
"readable-stream": {
"version": "1.1.13",
"from": "readable-stream@1.1.13",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.13.tgz",
"dependencies": {
"core-util-is": {
"version": "1.0.1",
"from": "core-util-is@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
},
"isarray": {
"version": "0.0.1",
"from": "isarray@0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
},
"string_decoder": {
"version": "0.10.31",
"from": "string_decoder@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
}
}
},
"nopt": {
"version": "2.2.1",
"from": "nopt@2.2.1",
"resolved": "https://registry.npmjs.org/nopt/-/nopt-2.2.1.tgz",
"dependencies": {
"abbrev": {
"version": "1.0.5",
"from": "abbrev@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.5.tgz"
}
}
}
}
},
"fstream": {
"version": "1.0.3",
"from": "fstream@>=1.0.2 <1.1.0",
"resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.3.tgz",
"dependencies": {
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.0 <2.1.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
}
}
},
"fstream-ignore": {
"version": "1.0.2",
"from": "fstream-ignore@>=1.0.1 <1.1.0",
"resolved": "https://registry.npmjs.org/fstream-ignore/-/fstream-ignore-1.0.2.tgz",
"dependencies": {
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
},
"minimatch": {
"version": "2.0.1",
"from": "minimatch@>=2.0.1 <3.0.0",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.1.tgz",
"dependencies": {
"brace-expansion": {
"version": "1.0.1",
"from": "brace-expansion@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.0.1.tgz",
"dependencies": {
"balanced-match": {
"version": "0.2.0",
"from": "balanced-match@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.2.0.tgz"
},
"concat-map": {
"version": "0.0.0",
"from": "concat-map@0.0.0",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.0.tgz"
}
}
}
}
}
}
},
"glob": {
"version": "4.0.6",
"from": "glob@4.0.6",
"resolved": "https://registry.npmjs.org/glob/-/glob-4.0.6.tgz",
"dependencies": {
"graceful-fs": {
"version": "3.0.5",
"from": "graceful-fs@>=3.0.2 <4.0.0",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.5.tgz"
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
},
"minimatch": {
"version": "1.0.0",
"from": "minimatch@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-1.0.0.tgz",
"dependencies": {
"sigmund": {
"version": "1.0.0",
"from": "sigmund@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz"
}
}
},
"once": {
"version": "1.3.1",
"from": "once@>=1.3.0 <2.0.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.3.1.tgz",
"dependencies": {
"wrappy": {
"version": "1.0.1",
"from": "wrappy@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz"
}
}
}
}
},
"handlebars": {
"version": "2.0.0",
"from": "handlebars@>=2.0.0 <2.1.0",
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-2.0.0.tgz",
"dependencies": {
"optimist": {
"version": "0.3.7",
"from": "optimist@0.3.7",
"resolved": "https://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz",
"dependencies": {
"wordwrap": {
"version": "0.0.2",
"from": "wordwrap@>=0.0.1 <0.1.0",
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz"
}
}
},
"uglify-js": {
"version": "2.3.6",
"from": "uglify-js@2.3.6",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.3.6.tgz",
"dependencies": {
"async": {
"version": "0.2.10",
"from": "async@>=0.2.6 <0.3.0",
"resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz"
},
"source-map": {
"version": "0.1.40",
"from": "source-map@>=0.1.7 <0.2.0",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.40.tgz",
"dependencies": {
"amdefine": {
"version": "0.1.0",
"from": "amdefine@>=0.0.4",
"resolved": "https://registry.npmjs.org/amdefine/-/amdefine-0.1.0.tgz"
}
}
}
}
}
}
},
"inquirer": {
"version": "0.7.1",
"from": "inquirer@0.7.1",
"resolved": "https://registry.npmjs.org/inquirer/-/inquirer-0.7.1.tgz",
"dependencies": {
"cli-color": {
"version": "0.3.2",
"from": "cli-color@>=0.3.2 <0.4.0",
"resolved": "https://registry.npmjs.org/cli-color/-/cli-color-0.3.2.tgz",
"dependencies": {
"d": {
"version": "0.1.1",
"from": "d@>=0.1.1 <0.2.0",
"resolved": "https://registry.npmjs.org/d/-/d-0.1.1.tgz"
},
"es5-ext": {
"version": "0.10.4",
"from": "es5-ext@>=0.10.2 <0.11.0",
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.4.tgz",
"dependencies": {
"es6-iterator": {
"version": "0.1.2",
"from": "es6-iterator@>=0.1.1 <0.2.0",
"resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-0.1.2.tgz"
},
"es6-symbol": {
"version": "0.1.1",
"from": "es6-symbol@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-0.1.1.tgz"
}
}
},
"memoizee": {
"version": "0.3.8",
"from": "memoizee@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.3.8.tgz",
"dependencies": {
"es6-weak-map": {
"version": "0.1.2",
"from": "es6-weak-map@>=0.1.2 <0.2.0",
"resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-0.1.2.tgz",
"dependencies": {
"es6-iterator": {
"version": "0.1.2",
"from": "es6-iterator@>=0.1.1 <0.2.0",
"resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-0.1.2.tgz"
},
"es6-symbol": {
"version": "0.1.1",
"from": "es6-symbol@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-0.1.1.tgz"
}
}
},
"event-emitter": {
"version": "0.3.1",
"from": "event-emitter@>=0.3.1 <0.4.0",
"resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.1.tgz"
},
"lru-queue": {
"version": "0.1.0",
"from": "lru-queue@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz"
},
"next-tick": {
"version": "0.2.2",
"from": "next-tick@>=0.2.2 <0.3.0",
"resolved": "https://registry.npmjs.org/next-tick/-/next-tick-0.2.2.tgz"
}
}
},
"timers-ext": {
"version": "0.1.0",
"from": "timers-ext@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.0.tgz",
"dependencies": {
"next-tick": {
"version": "0.2.2",
"from": "next-tick@>=0.2.2 <0.3.0",
"resolved": "https://registry.npmjs.org/next-tick/-/next-tick-0.2.2.tgz"
}
}
}
}
},
"figures": {
"version": "1.3.5",
"from": "figures@>=1.3.2 <2.0.0",
"resolved": "https://registry.npmjs.org/figures/-/figures-1.3.5.tgz"
},
"lodash": {
"version": "2.4.1",
"from": "lodash@>=2.4.1 <2.5.0",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.1.tgz"
},
"mute-stream": {
"version": "0.0.4",
"from": "mute-stream@0.0.4",
"resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.4.tgz"
},
"readline2": {
"version": "0.1.0",
"from": "readline2@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/readline2/-/readline2-0.1.0.tgz",
"dependencies": {
"chalk": {
"version": "0.4.0",
"from": "chalk@>=0.4.0 <0.5.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-0.4.0.tgz",
"dependencies": {
"has-color": {
"version": "0.1.7",
"from": "has-color@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz"
},
"ansi-styles": {
"version": "1.0.0",
"from": "ansi-styles@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.0.0.tgz"
},
"strip-ansi": {
"version": "0.1.1",
"from": "strip-ansi@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz"
}
}
}
}
},
"rx": {
"version": "2.3.20",
"from": "rx@>=2.2.27 <3.0.0",
"resolved": "https://registry.npmjs.org/rx/-/rx-2.3.20.tgz"
},
"through": {
"version": "2.3.6",
"from": "through@>=2.3.4 <2.4.0",
"resolved": "https://registry.npmjs.org/through/-/through-2.3.6.tgz"
}
}
},
"insight": {
"version": "0.4.3",
"from": "insight@0.4.3",
"resolved": "https://registry.npmjs.org/insight/-/insight-0.4.3.tgz",
"dependencies": {
"async": {
"version": "0.9.0",
"from": "async@>=0.9.0 <0.10.0",
"resolved": "https://registry.npmjs.org/async/-/async-0.9.0.tgz"
},
"chalk": {
"version": "0.5.1",
"from": "chalk@>=0.5.1 <0.6.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-0.5.1.tgz",
"dependencies": {
"ansi-styles": {
"version": "1.1.0",
"from": "ansi-styles@1.1.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.1.0.tgz"
},
"escape-string-regexp": {
"version": "1.0.2",
"from": "escape-string-regexp@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz"
},
"has-ansi": {
"version": "0.1.0",
"from": "has-ansi@0.1.0",
"resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-0.1.0.tgz",
"dependencies": {
"ansi-regex": {
"version": "0.2.1",
"from": "ansi-regex@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz"
}
}
},
"strip-ansi": {
"version": "0.3.0",
"from": "strip-ansi@0.3.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.3.0.tgz",
"dependencies": {
"ansi-regex": {
"version": "0.2.1",
"from": "ansi-regex@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz"
}
}
},
"supports-color": {
"version": "0.2.0",
"from": "supports-color@0.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-0.2.0.tgz"
}
}
},
"configstore": {
"version": "0.3.1",
"from": "configstore@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/configstore/-/configstore-0.3.1.tgz",
"dependencies": {
"js-yaml": {
"version": "3.0.2",
"from": "js-yaml@3.0.2",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.0.2.tgz",
"dependencies": {
"argparse": {
"version": "0.1.16",
"from": "argparse@>=0.1.11 <0.2.0",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-0.1.16.tgz",
"dependencies": {
"underscore": {
"version": "1.7.0",
"from": "underscore@>=1.7.0 <1.8.0",
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz"
},
"underscore.string": {
"version": "2.4.0",
"from": "underscore.string@>=2.4.0 <2.5.0",
"resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.4.0.tgz"
}
}
},
"esprima": {
"version": "1.0.4",
"from": "esprima@>=1.0.2 <1.1.0",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-1.0.4.tgz"
}
}
},
"object-assign": {
"version": "0.3.1",
"from": "object-assign@0.3.1",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-0.3.1.tgz"
},
"uuid": {
"version": "1.4.2",
"from": "uuid@1.4.2",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-1.4.2.tgz"
}
}
},
"inquirer": {
"version": "0.6.0",
"from": "inquirer@0.6.0",
"resolved": "https://registry.npmjs.org/inquirer/-/inquirer-0.6.0.tgz",
"dependencies": {
"cli-color": {
"version": "0.3.2",
"from": "cli-color@>=0.3.2 <0.4.0",
"resolved": "https://registry.npmjs.org/cli-color/-/cli-color-0.3.2.tgz",
"dependencies": {
"d": {
"version": "0.1.1",
"from": "d@>=0.1.1 <0.2.0",
"resolved": "https://registry.npmjs.org/d/-/d-0.1.1.tgz"
},
"es5-ext": {
"version": "0.10.4",
"from": "es5-ext@>=0.10.2 <0.11.0",
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.4.tgz",
"dependencies": {
"es6-iterator": {
"version": "0.1.2",
"from": "es6-iterator@>=0.1.1 <0.2.0",
"resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-0.1.2.tgz"
},
"es6-symbol": {
"version": "0.1.1",
"from": "es6-symbol@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-0.1.1.tgz"
}
}
},
"memoizee": {
"version": "0.3.8",
"from": "memoizee@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.3.8.tgz",
"dependencies": {
"es6-weak-map": {
"version": "0.1.2",
"from": "es6-weak-map@>=0.1.2 <0.2.0",
"resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-0.1.2.tgz",
"dependencies": {
"es6-iterator": {
"version": "0.1.2",
"from": "es6-iterator@>=0.1.1 <0.2.0",
"resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-0.1.2.tgz"
},
"es6-symbol": {
"version": "0.1.1",
"from": "es6-symbol@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-0.1.1.tgz"
}
}
},
"event-emitter": {
"version": "0.3.1",
"from": "event-emitter@>=0.3.1 <0.4.0",
"resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.1.tgz"
},
"lru-queue": {
"version": "0.1.0",
"from": "lru-queue@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz"
},
"next-tick": {
"version": "0.2.2",
"from": "next-tick@>=0.2.2 <0.3.0",
"resolved": "https://registry.npmjs.org/next-tick/-/next-tick-0.2.2.tgz"
}
}
},
"timers-ext": {
"version": "0.1.0",
"from": "timers-ext@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.0.tgz",
"dependencies": {
"next-tick": {
"version": "0.2.2",
"from": "next-tick@>=0.2.2 <0.3.0",
"resolved": "https://registry.npmjs.org/next-tick/-/next-tick-0.2.2.tgz"
}
}
}
}
},
"lodash": {
"version": "2.4.1",
"from": "lodash@>=2.4.1 <2.5.0",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.1.tgz"
},
"mute-stream": {
"version": "0.0.4",
"from": "mute-stream@0.0.4",
"resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.4.tgz"
},
"readline2": {
"version": "0.1.0",
"from": "readline2@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/readline2/-/readline2-0.1.0.tgz",
"dependencies": {
"chalk": {
"version": "0.4.0",
"from": "chalk@>=0.4.0 <0.5.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-0.4.0.tgz",
"dependencies": {
"has-color": {
"version": "0.1.7",
"from": "has-color@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz"
},
"ansi-styles": {
"version": "1.0.0",
"from": "ansi-styles@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.0.0.tgz"
},
"strip-ansi": {
"version": "0.1.1",
"from": "strip-ansi@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz"
}
}
}
}
},
"rx": {
"version": "2.3.20",
"from": "rx@>=2.2.27 <3.0.0",
"resolved": "https://registry.npmjs.org/rx/-/rx-2.3.20.tgz"
},
"through": {
"version": "2.3.6",
"from": "through@>=2.3.4 <2.4.0",
"resolved": "https://registry.npmjs.org/through/-/through-2.3.6.tgz"
}
}
},
"lodash.debounce": {
"version": "2.4.1",
"from": "lodash.debounce@>=2.4.1 <3.0.0",
"resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-2.4.1.tgz",
"dependencies": {
"lodash.isfunction": {
"version": "2.4.1",
"from": "lodash.isfunction@>=2.4.1 <2.5.0",
"resolved": "https://registry.npmjs.org/lodash.isfunction/-/lodash.isfunction-2.4.1.tgz"
},
"lodash.isobject": {
"version": "2.4.1",
"from": "lodash.isobject@>=2.4.1 <2.5.0",
"resolved": "https://registry.npmjs.org/lodash.isobject/-/lodash.isobject-2.4.1.tgz",
"dependencies": {
"lodash._objecttypes": {
"version": "2.4.1",
"from": "lodash._objecttypes@>=2.4.1 <2.5.0",
"resolved": "https://registry.npmjs.org/lodash._objecttypes/-/lodash._objecttypes-2.4.1.tgz"
}
}
},
"lodash.now": {
"version": "2.4.1",
"from": "lodash.now@>=2.4.1 <2.5.0",
"resolved": "https://registry.npmjs.org/lodash.now/-/lodash.now-2.4.1.tgz",
"dependencies": {
"lodash._isnative": {
"version": "2.4.1",
"from": "lodash._isnative@>=2.4.1 <2.5.0",
"resolved": "https://registry.npmjs.org/lodash._isnative/-/lodash._isnative-2.4.1.tgz"
}
}
}
}
},
"object-assign": {
"version": "1.0.0",
"from": "object-assign@1.0.0",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-1.0.0.tgz"
},
"os-name": {
"version": "1.0.1",
"from": "os-name@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/os-name/-/os-name-1.0.1.tgz",
"dependencies": {
"osx-release": {
"version": "1.0.0",
"from": "osx-release@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/osx-release/-/osx-release-1.0.0.tgz"
}
}
},
"request": {
"version": "2.49.0",
"from": "request@2.49.0",
"resolved": "https://registry.npmjs.org/request/-/request-2.49.0.tgz",
"dependencies": {
"bl": {
"version": "0.9.3",
"from": "bl@>=0.9.0 <0.10.0",
"resolved": "https://registry.npmjs.org/bl/-/bl-0.9.3.tgz",
"dependencies": {
"readable-stream": {
"version": "1.0.33",
"from": "readable-stream@>=1.0.27-1 <2.0.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz",
"dependencies": {
"core-util-is": {
"version": "1.0.1",
"from": "core-util-is@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
},
"isarray": {
"version": "0.0.1",
"from": "isarray@0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
},
"string_decoder": {
"version": "0.10.31",
"from": "string_decoder@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
}
}
}
}
},
"caseless": {
"version": "0.8.0",
"from": "caseless@>=0.8.0 <0.9.0",
"resolved": "https://registry.npmjs.org/caseless/-/caseless-0.8.0.tgz"
},
"forever-agent": {
"version": "0.5.2",
"from": "forever-agent@>=0.5.0 <0.6.0",
"resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.5.2.tgz"
},
"form-data": {
"version": "0.1.4",
"from": "form-data@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-0.1.4.tgz",
"dependencies": {
"mime": {
"version": "1.2.11",
"from": "mime@>=1.2.11 <1.3.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz"
}
}
},
"json-stringify-safe": {
"version": "5.0.0",
"from": "json-stringify-safe@>=5.0.0 <5.1.0",
"resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.0.tgz"
},
"mime-types": {
"version": "1.0.2",
"from": "mime-types@>=1.0.1 <1.1.0",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-1.0.2.tgz"
},
"node-uuid": {
"version": "1.4.2",
"from": "node-uuid@>=1.4.0 <1.5.0",
"resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.2.tgz"
},
"qs": {
"version": "2.3.3",
"from": "qs@>=2.3.1 <2.4.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-2.3.3.tgz"
},
"tunnel-agent": {
"version": "0.4.0",
"from": "tunnel-agent@>=0.4.0 <0.5.0",
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.0.tgz"
},
"http-signature": {
"version": "0.10.0",
"from": "http-signature@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/http-signature/-/http-signature-0.10.0.tgz",
"dependencies": {
"assert-plus": {
"version": "0.1.2",
"from": "assert-plus@0.1.2",
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.2.tgz"
},
"asn1": {
"version": "0.1.11",
"from": "asn1@0.1.11",
"resolved": "https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz"
},
"ctype": {
"version": "0.5.2",
"from": "ctype@0.5.2",
"resolved": "https://registry.npmjs.org/ctype/-/ctype-0.5.2.tgz"
}
}
},
"oauth-sign": {
"version": "0.5.0",
"from": "oauth-sign@>=0.5.0 <0.6.0",
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.5.0.tgz"
},
"hawk": {
"version": "1.1.1",
"from": "hawk@1.1.1",
"resolved": "https://registry.npmjs.org/hawk/-/hawk-1.1.1.tgz",
"dependencies": {
"hoek": {
"version": "0.9.1",
"from": "hoek@>=0.9.0 <0.10.0",
"resolved": "https://registry.npmjs.org/hoek/-/hoek-0.9.1.tgz"
},
"boom": {
"version": "0.4.2",
"from": "boom@>=0.4.0 <0.5.0",
"resolved": "https://registry.npmjs.org/boom/-/boom-0.4.2.tgz"
},
"cryptiles": {
"version": "0.2.2",
"from": "cryptiles@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-0.2.2.tgz"
},
"sntp": {
"version": "0.2.4",
"from": "sntp@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/sntp/-/sntp-0.2.4.tgz"
}
}
},
"aws-sign2": {
"version": "0.5.0",
"from": "aws-sign2@>=0.5.0 <0.6.0",
"resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz"
},
"stringstream": {
"version": "0.0.4",
"from": "stringstream@>=0.0.4 <0.1.0",
"resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.4.tgz"
},
"combined-stream": {
"version": "0.0.7",
"from": "combined-stream@>=0.0.5 <0.1.0",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz",
"dependencies": {
"delayed-stream": {
"version": "0.0.5",
"from": "delayed-stream@0.0.5",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz"
}
}
}
}
},
"tough-cookie": {
"version": "0.12.1",
"from": "tough-cookie@>=0.12.1 <0.13.0",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-0.12.1.tgz",
"dependencies": {
"punycode": {
"version": "1.3.2",
"from": "punycode@>=0.2.0",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz"
}
}
}
}
},
"is-root": {
"version": "1.0.0",
"from": "is-root@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/is-root/-/is-root-1.0.0.tgz"
},
"junk": {
"version": "1.0.0",
"from": "junk@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/junk/-/junk-1.0.0.tgz"
},
"lockfile": {
"version": "1.0.0",
"from": "lockfile@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/lockfile/-/lockfile-1.0.0.tgz"
},
"lru-cache": {
"version": "2.5.0",
"from": "lru-cache@>=2.5.0 <2.6.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz"
},
"mout": {
"version": "0.9.1",
"from": "mout@0.9.1",
"resolved": "https://registry.npmjs.org/mout/-/mout-0.9.1.tgz"
},
"nopt": {
"version": "3.0.1",
"from": "nopt@>=3.0.0 <3.1.0",
"resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.1.tgz"
},
"osenv": {
"version": "0.1.0",
"from": "osenv@0.1.0",
"resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.0.tgz"
},
"p-throttler": {
"version": "0.1.0",
"from": "p-throttler@0.1.0",
"resolved": "https://registry.npmjs.org/p-throttler/-/p-throttler-0.1.0.tgz",
"dependencies": {
"q": {
"version": "0.9.7",
"from": "q@>=0.9.2 <0.10.0",
"resolved": "https://registry.npmjs.org/q/-/q-0.9.7.tgz"
}
}
},
"promptly": {
"version": "0.2.0",
"from": "promptly@0.2.0",
"resolved": "https://registry.npmjs.org/promptly/-/promptly-0.2.0.tgz",
"dependencies": {
"read": {
"version": "1.0.5",
"from": "read@>=1.0.4 <1.1.0",
"resolved": "https://registry.npmjs.org/read/-/read-1.0.5.tgz",
"dependencies": {
"mute-stream": {
"version": "0.0.4",
"from": "mute-stream@>=0.0.4 <0.1.0",
"resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.4.tgz"
}
}
}
}
},
"q": {
"version": "1.0.1",
"from": "q@1.0.1",
"resolved": "https://registry.npmjs.org/q/-/q-1.0.1.tgz"
},
"request": {
"version": "2.42.0",
"from": "request@2.42.0",
"resolved": "https://registry.npmjs.org/request/-/request-2.42.0.tgz",
"dependencies": {
"bl": {
"version": "0.9.3",
"from": "bl@>=0.9.0 <0.10.0",
"resolved": "https://registry.npmjs.org/bl/-/bl-0.9.3.tgz",
"dependencies": {
"readable-stream": {
"version": "1.0.33",
"from": "readable-stream@>=1.0.26 <1.1.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz",
"dependencies": {
"core-util-is": {
"version": "1.0.1",
"from": "core-util-is@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
},
"isarray": {
"version": "0.0.1",
"from": "isarray@0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
},
"string_decoder": {
"version": "0.10.31",
"from": "string_decoder@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
}
}
}
}
},
"caseless": {
"version": "0.6.0",
"from": "caseless@>=0.6.0 <0.7.0",
"resolved": "https://registry.npmjs.org/caseless/-/caseless-0.6.0.tgz"
},
"forever-agent": {
"version": "0.5.2",
"from": "forever-agent@>=0.5.0 <0.6.0",
"resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.5.2.tgz"
},
"qs": {
"version": "1.2.2",
"from": "qs@>=1.2.0 <1.3.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-1.2.2.tgz"
},
"json-stringify-safe": {
"version": "5.0.0",
"from": "json-stringify-safe@>=5.0.0 <5.1.0",
"resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.0.tgz"
},
"mime-types": {
"version": "1.0.2",
"from": "mime-types@>=1.0.1 <1.1.0",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-1.0.2.tgz"
},
"node-uuid": {
"version": "1.4.2",
"from": "node-uuid@>=1.4.0 <1.5.0",
"resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.2.tgz"
},
"tunnel-agent": {
"version": "0.4.0",
"from": "tunnel-agent@>=0.4.0 <0.5.0",
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.0.tgz"
},
"tough-cookie": {
"version": "0.12.1",
"from": "tough-cookie@>=0.12.0",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-0.12.1.tgz",
"dependencies": {
"punycode": {
"version": "1.3.2",
"from": "punycode@>=0.2.0",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz"
}
}
},
"form-data": {
"version": "0.1.4",
"from": "form-data@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-0.1.4.tgz",
"dependencies": {
"combined-stream": {
"version": "0.0.7",
"from": "combined-stream@>=0.0.4 <0.1.0",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz",
"dependencies": {
"delayed-stream": {
"version": "0.0.5",
"from": "delayed-stream@0.0.5",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz"
}
}
},
"mime": {
"version": "1.2.11",
"from": "mime@>=1.2.11 <1.3.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz"
},
"async": {
"version": "0.9.0",
"from": "async@>=0.9.0 <0.10.0",
"resolved": "https://registry.npmjs.org/async/-/async-0.9.0.tgz"
}
}
},
"http-signature": {
"version": "0.10.0",
"from": "http-signature@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/http-signature/-/http-signature-0.10.0.tgz",
"dependencies": {
"assert-plus": {
"version": "0.1.2",
"from": "assert-plus@0.1.2",
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.2.tgz"
},
"asn1": {
"version": "0.1.11",
"from": "asn1@0.1.11",
"resolved": "https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz"
},
"ctype": {
"version": "0.5.2",
"from": "ctype@0.5.2",
"resolved": "https://registry.npmjs.org/ctype/-/ctype-0.5.2.tgz"
}
}
},
"oauth-sign": {
"version": "0.4.0",
"from": "oauth-sign@>=0.4.0 <0.5.0",
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.4.0.tgz"
},
"hawk": {
"version": "1.1.1",
"from": "hawk@1.1.1",
"resolved": "https://registry.npmjs.org/hawk/-/hawk-1.1.1.tgz",
"dependencies": {
"hoek": {
"version": "0.9.1",
"from": "hoek@>=0.9.0 <0.10.0",
"resolved": "https://registry.npmjs.org/hoek/-/hoek-0.9.1.tgz"
},
"boom": {
"version": "0.4.2",
"from": "boom@>=0.4.0 <0.5.0",
"resolved": "https://registry.npmjs.org/boom/-/boom-0.4.2.tgz"
},
"cryptiles": {
"version": "0.2.2",
"from": "cryptiles@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-0.2.2.tgz"
},
"sntp": {
"version": "0.2.4",
"from": "sntp@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/sntp/-/sntp-0.2.4.tgz"
}
}
},
"aws-sign2": {
"version": "0.5.0",
"from": "aws-sign2@>=0.5.0 <0.6.0",
"resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz"
},
"stringstream": {
"version": "0.0.4",
"from": "stringstream@>=0.0.4 <0.1.0",
"resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.4.tgz"
}
}
},
"request-progress": {
"version": "0.3.0",
"from": "request-progress@0.3.0",
"resolved": "https://registry.npmjs.org/request-progress/-/request-progress-0.3.0.tgz",
"dependencies": {
"throttleit": {
"version": "0.0.2",
"from": "throttleit@>=0.0.2 <0.1.0",
"resolved": "https://registry.npmjs.org/throttleit/-/throttleit-0.0.2.tgz"
}
}
},
"retry": {
"version": "0.6.0",
"from": "retry@0.6.0",
"resolved": "https://registry.npmjs.org/retry/-/retry-0.6.0.tgz"
},
"rimraf": {
"version": "2.2.8",
"from": "rimraf@>=2.2.0 <2.3.0",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz"
},
"semver": {
"version": "2.3.2",
"from": "semver@2.3.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-2.3.2.tgz"
},
"shell-quote": {
"version": "1.4.2",
"from": "shell-quote@>=1.4.1 <1.5.0",
"resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.4.2.tgz",
"dependencies": {
"jsonify": {
"version": "0.0.0",
"from": "jsonify@>=0.0.0 <0.1.0",
"resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz"
},
"array-filter": {
"version": "0.0.1",
"from": "array-filter@0.0.1",
"resolved": "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz"
},
"array-reduce": {
"version": "0.0.0",
"from": "array-reduce@>=0.0.0 <0.1.0",
"resolved": "https://registry.npmjs.org/array-reduce/-/array-reduce-0.0.0.tgz"
},
"array-map": {
"version": "0.0.0",
"from": "array-map@>=0.0.0 <0.1.0",
"resolved": "https://registry.npmjs.org/array-map/-/array-map-0.0.0.tgz"
}
}
},
"stringify-object": {
"version": "1.0.0",
"from": "stringify-object@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-1.0.0.tgz"
},
"tar-fs": {
"version": "0.5.2",
"from": "tar-fs@0.5.2",
"resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-0.5.2.tgz",
"dependencies": {
"mkdirp": {
"version": "0.5.0",
"from": "mkdirp@>=0.5.0 <0.6.0",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz",
"dependencies": {
"minimist": {
"version": "0.0.8",
"from": "minimist@0.0.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz"
}
}
},
"pump": {
"version": "0.3.5",
"from": "pump@>=0.3.5 <0.4.0",
"resolved": "https://registry.npmjs.org/pump/-/pump-0.3.5.tgz",
"dependencies": {
"once": {
"version": "1.2.0",
"from": "once@>=1.2.0 <1.3.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.2.0.tgz"
},
"end-of-stream": {
"version": "1.0.0",
"from": "end-of-stream@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.0.0.tgz",
"dependencies": {
"once": {
"version": "1.3.1",
"from": "once@>=1.3.0 <1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.3.1.tgz",
"dependencies": {
"wrappy": {
"version": "1.0.1",
"from": "wrappy@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz"
}
}
}
}
}
}
},
"tar-stream": {
"version": "0.4.7",
"from": "tar-stream@>=0.4.6 <0.5.0",
"resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-0.4.7.tgz",
"dependencies": {
"bl": {
"version": "0.9.3",
"from": "bl@>=0.9.0 <0.10.0",
"resolved": "https://registry.npmjs.org/bl/-/bl-0.9.3.tgz"
},
"end-of-stream": {
"version": "1.1.0",
"from": "end-of-stream@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.1.0.tgz",
"dependencies": {
"once": {
"version": "1.3.1",
"from": "once@>=1.3.0 <1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.3.1.tgz",
"dependencies": {
"wrappy": {
"version": "1.0.1",
"from": "wrappy@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz"
}
}
}
}
},
"readable-stream": {
"version": "1.0.33",
"from": "readable-stream@>=1.0.27-1 <2.0.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz",
"dependencies": {
"core-util-is": {
"version": "1.0.1",
"from": "core-util-is@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
},
"isarray": {
"version": "0.0.1",
"from": "isarray@0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
},
"string_decoder": {
"version": "0.10.31",
"from": "string_decoder@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
}
}
},
"xtend": {
"version": "4.0.0",
"from": "xtend@>=4.0.0 <5.0.0",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.0.tgz"
}
}
}
}
},
"tmp": {
"version": "0.0.23",
"from": "tmp@0.0.23",
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.23.tgz"
},
"update-notifier": {
"version": "0.2.0",
"from": "update-notifier@0.2.0",
"resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-0.2.0.tgz",
"dependencies": {
"configstore": {
"version": "0.3.1",
"from": "configstore@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/configstore/-/configstore-0.3.1.tgz",
"dependencies": {
"graceful-fs": {
"version": "3.0.5",
"from": "graceful-fs@>=3.0.1 <3.1.0",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.5.tgz"
},
"js-yaml": {
"version": "3.0.2",
"from": "js-yaml@>=3.0.1 <3.1.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.0.2.tgz",
"dependencies": {
"argparse": {
"version": "0.1.16",
"from": "argparse@>=0.1.11 <0.2.0",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-0.1.16.tgz",
"dependencies": {
"underscore": {
"version": "1.7.0",
"from": "underscore@>=1.7.0 <1.8.0",
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz"
},
"underscore.string": {
"version": "2.4.0",
"from": "underscore.string@>=2.4.0 <2.5.0",
"resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.4.0.tgz"
}
}
},
"esprima": {
"version": "1.0.4",
"from": "esprima@>=1.0.4 <1.1.0",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-1.0.4.tgz"
}
}
},
"mkdirp": {
"version": "0.5.0",
"from": "mkdirp@>=0.5.0 <0.6.0",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz",
"dependencies": {
"minimist": {
"version": "0.0.8",
"from": "minimist@0.0.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz"
}
}
},
"object-assign": {
"version": "0.3.1",
"from": "object-assign@>=0.3.1 <0.4.0",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-0.3.1.tgz"
},
"uuid": {
"version": "1.4.2",
"from": "uuid@>=1.4.1 <1.5.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-1.4.2.tgz"
}
}
},
"latest-version": {
"version": "0.2.0",
"from": "latest-version@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/latest-version/-/latest-version-0.2.0.tgz",
"dependencies": {
"package-json": {
"version": "0.2.0",
"from": "package-json@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/package-json/-/package-json-0.2.0.tgz",
"dependencies": {
"got": {
"version": "0.3.0",
"from": "got@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/got/-/got-0.3.0.tgz",
"dependencies": {
"object-assign": {
"version": "0.3.1",
"from": "object-assign@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-0.3.1.tgz"
}
}
},
"registry-url": {
"version": "0.1.1",
"from": "registry-url@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/registry-url/-/registry-url-0.1.1.tgz",
"dependencies": {
"npmconf": {
"version": "2.1.1",
"from": "npmconf@>=2.0.1 <3.0.0",
"resolved": "https://registry.npmjs.org/npmconf/-/npmconf-2.1.1.tgz",
"dependencies": {
"config-chain": {
"version": "1.1.8",
"from": "config-chain@>=1.1.8 <1.2.0",
"resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.8.tgz",
"dependencies": {
"proto-list": {
"version": "1.2.3",
"from": "proto-list@>=1.2.1 <1.3.0",
"resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.3.tgz"
}
}
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.0 <2.1.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
},
"ini": {
"version": "1.3.2",
"from": "ini@>=1.2.0 <2.0.0",
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.2.tgz"
},
"mkdirp": {
"version": "0.5.0",
"from": "mkdirp@>=0.5.0 <0.6.0",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz",
"dependencies": {
"minimist": {
"version": "0.0.8",
"from": "minimist@0.0.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz"
}
}
},
"once": {
"version": "1.3.1",
"from": "once@>=1.3.0 <1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.3.1.tgz",
"dependencies": {
"wrappy": {
"version": "1.0.1",
"from": "wrappy@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz"
}
}
},
"uid-number": {
"version": "0.0.5",
"from": "uid-number@0.0.5",
"resolved": "https://registry.npmjs.org/uid-number/-/uid-number-0.0.5.tgz"
}
}
}
}
}
}
}
}
},
"semver-diff": {
"version": "0.1.0",
"from": "semver-diff@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-0.1.0.tgz"
},
"string-length": {
"version": "0.1.2",
"from": "string-length@>=0.1.2 <0.2.0",
"resolved": "https://registry.npmjs.org/string-length/-/string-length-0.1.2.tgz",
"dependencies": {
"strip-ansi": {
"version": "0.2.2",
"from": "strip-ansi@>=0.2.1 <0.3.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.2.2.tgz",
"dependencies": {
"ansi-regex": {
"version": "0.1.0",
"from": "ansi-regex@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.1.0.tgz"
}
}
}
}
}
}
},
"which": {
"version": "1.0.8",
"from": "which@>=1.0.5 <1.1.0",
"resolved": "https://registry.npmjs.org/which/-/which-1.0.8.tgz"
}
}
},
"connect": {
"version": "3.3.3",
"from": "connect@>=3.3.0 <4.0.0",
"resolved": "https://registry.npmjs.org/connect/-/connect-3.3.3.tgz",
"dependencies": {
"debug": {
"version": "2.1.0",
"from": "debug@>=2.1.0 <2.2.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.1.0.tgz",
"dependencies": {
"ms": {
"version": "0.6.2",
"from": "ms@0.6.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-0.6.2.tgz"
}
}
},
"finalhandler": {
"version": "0.3.2",
"from": "finalhandler@0.3.2",
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-0.3.2.tgz",
"dependencies": {
"escape-html": {
"version": "1.0.1",
"from": "escape-html@1.0.1",
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.1.tgz"
},
"on-finished": {
"version": "2.1.1",
"from": "on-finished@>=2.1.1 <2.2.0",
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.1.1.tgz",
"dependencies": {
"ee-first": {
"version": "1.1.0",
"from": "ee-first@1.1.0",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.0.tgz"
}
}
}
}
},
"parseurl": {
"version": "1.3.0",
"from": "parseurl@>=1.3.0 <1.4.0",
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.0.tgz"
},
"utils-merge": {
"version": "1.0.0",
"from": "utils-merge@1.0.0",
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz"
}
}
},
"fb-flo": {
"version": "0.3.1",
"from": "fb-flo@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/fb-flo/-/fb-flo-0.3.1.tgz",
"dependencies": {
"websocket": {
"version": "1.0.14",
"from": "websocket@>=1.0.8 <1.1.0",
"resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.14.tgz",
"dependencies": {
"debug": {
"version": "2.1.0",
"from": "debug@>=2.1.0 <2.2.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.1.0.tgz",
"dependencies": {
"ms": {
"version": "0.6.2",
"from": "ms@0.6.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-0.6.2.tgz"
}
}
},
"nan": {
"version": "1.0.0",
"from": "nan@1.0.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-1.0.0.tgz"
},
"typedarray-to-buffer": {
"version": "3.0.0",
"from": "typedarray-to-buffer@>=3.0.0 <3.1.0",
"resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.0.0.tgz",
"dependencies": {
"is-typedarray": {
"version": "0.0.0",
"from": "is-typedarray@0.0.0",
"resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-0.0.0.tgz"
}
}
}
}
},
"sane": {
"version": "0.7.1",
"from": "sane@0.7.1",
"resolved": "https://registry.npmjs.org/sane/-/sane-0.7.1.tgz",
"dependencies": {
"walker": {
"version": "1.0.6",
"from": "walker@>=1.0.5 <1.1.0",
"resolved": "https://registry.npmjs.org/walker/-/walker-1.0.6.tgz",
"dependencies": {
"makeerror": {
"version": "1.0.8",
"from": "makeerror@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.8.tgz",
"dependencies": {
"tmpl": {
"version": "1.0.1",
"from": "tmpl@>=1.0.0",
"resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.1.tgz"
}
}
}
}
},
"minimatch": {
"version": "0.2.14",
"from": "minimatch@>=0.2.14 <0.3.0",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz",
"dependencies": {
"lru-cache": {
"version": "2.5.0",
"from": "lru-cache@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz"
},
"sigmund": {
"version": "1.0.0",
"from": "sigmund@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz"
}
}
},
"watch": {
"version": "0.10.0",
"from": "watch@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/watch/-/watch-0.10.0.tgz"
}
}
}
}
},
"glob": {
"version": "4.3.1",
"from": "glob@>=4.0.6 <5.0.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-4.3.1.tgz",
"dependencies": {
"inflight": {
"version": "1.0.4",
"from": "inflight@>=1.0.4 <2.0.0",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz",
"dependencies": {
"wrappy": {
"version": "1.0.1",
"from": "wrappy@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz"
}
}
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
},
"minimatch": {
"version": "2.0.1",
"from": "minimatch@>=2.0.1 <3.0.0",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.1.tgz",
"dependencies": {
"brace-expansion": {
"version": "1.0.1",
"from": "brace-expansion@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.0.1.tgz",
"dependencies": {
"balanced-match": {
"version": "0.2.0",
"from": "balanced-match@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.2.0.tgz"
},
"concat-map": {
"version": "0.0.0",
"from": "concat-map@0.0.0",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.0.tgz"
}
}
}
}
},
"once": {
"version": "1.3.1",
"from": "once@>=1.3.0 <2.0.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.3.1.tgz",
"dependencies": {
"wrappy": {
"version": "1.0.1",
"from": "wrappy@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz"
}
}
}
}
},
"graceful-fs": {
"version": "3.0.5",
"from": "graceful-fs@>=3.0.5 <4.0.0",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.5.tgz"
},
"jasmine-core": {
"version": "2.1.3",
"from": "jasmine-core@>=2.1.2 <3.0.0",
"resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-2.1.3.tgz"
},
"jshint": {
"version": "2.5.10",
"from": "jshint@>=2.5.6 <3.0.0",
"resolved": "https://registry.npmjs.org/jshint/-/jshint-2.5.10.tgz",
"dependencies": {
"cli": {
"version": "0.6.5",
"from": "cli@>=0.6.0 <0.7.0",
"resolved": "https://registry.npmjs.org/cli/-/cli-0.6.5.tgz",
"dependencies": {
"glob": {
"version": "3.2.11",
"from": "glob@3.2.11",
"resolved": "https://registry.npmjs.org/glob/-/glob-3.2.11.tgz",
"dependencies": {
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
},
"minimatch": {
"version": "0.3.0",
"from": "minimatch@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz",
"dependencies": {
"lru-cache": {
"version": "2.5.0",
"from": "lru-cache@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz"
},
"sigmund": {
"version": "1.0.0",
"from": "sigmund@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz"
}
}
}
}
}
}
},
"console-browserify": {
"version": "1.1.0",
"from": "console-browserify@>=1.1.0 <1.2.0",
"resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz",
"dependencies": {
"date-now": {
"version": "0.1.4",
"from": "date-now@0.1.4",
"resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz"
}
}
},
"exit": {
"version": "0.1.2",
"from": "exit@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz"
},
"htmlparser2": {
"version": "3.8.2",
"from": "htmlparser2@>=3.8.0 <3.9.0",
"resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.2.tgz",
"dependencies": {
"domhandler": {
"version": "2.3.0",
"from": "domhandler@>=2.3.0 <2.4.0",
"resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.3.0.tgz"
},
"domutils": {
"version": "1.5.0",
"from": "domutils@>=1.5.0 <1.6.0",
"resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.0.tgz"
},
"domelementtype": {
"version": "1.1.3",
"from": "domelementtype@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz"
},
"readable-stream": {
"version": "1.1.13",
"from": "readable-stream@1.1.13",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.13.tgz",
"dependencies": {
"core-util-is": {
"version": "1.0.1",
"from": "core-util-is@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
},
"isarray": {
"version": "0.0.1",
"from": "isarray@0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
},
"string_decoder": {
"version": "0.10.31",
"from": "string_decoder@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
}
}
},
"entities": {
"version": "1.0.0",
"from": "entities@1.0.0",
"resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz"
}
}
},
"minimatch": {
"version": "1.0.0",
"from": "minimatch@1.0.0",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-1.0.0.tgz",
"dependencies": {
"lru-cache": {
"version": "2.5.0",
"from": "lru-cache@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz"
},
"sigmund": {
"version": "1.0.0",
"from": "sigmund@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz"
}
}
},
"shelljs": {
"version": "0.3.0",
"from": "shelljs@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.3.0.tgz"
},
"strip-json-comments": {
"version": "1.0.2",
"from": "strip-json-comments@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.2.tgz"
},
"underscore": {
"version": "1.6.0",
"from": "underscore@1.6.0",
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz"
}
}
},
"karma": {
"version": "0.12.28",
"from": "karma@>=0.12.24 <0.13.0",
"resolved": "https://registry.npmjs.org/karma/-/karma-0.12.28.tgz",
"dependencies": {
"di": {
"version": "0.0.1",
"from": "di@>=0.0.1 <0.1.0",
"resolved": "https://registry.npmjs.org/di/-/di-0.0.1.tgz"
},
"socket.io": {
"version": "0.9.17",
"from": "socket.io@0.9.17",
"resolved": "https://registry.npmjs.org/socket.io/-/socket.io-0.9.17.tgz",
"dependencies": {
"socket.io-client": {
"version": "0.9.16",
"from": "socket.io-client@0.9.16",
"resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-0.9.16.tgz",
"dependencies": {
"uglify-js": {
"version": "1.2.5",
"from": "uglify-js@1.2.5",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-1.2.5.tgz"
},
"ws": {
"version": "0.4.32",
"from": "ws@>=0.4.0 <0.5.0",
"resolved": "https://registry.npmjs.org/ws/-/ws-0.4.32.tgz",
"dependencies": {
"commander": {
"version": "2.1.0",
"from": "commander@>=2.1.0 <2.2.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.1.0.tgz"
},
"nan": {
"version": "1.0.0",
"from": "nan@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-1.0.0.tgz"
},
"tinycolor": {
"version": "0.0.1",
"from": "tinycolor@>=0.0.0 <1.0.0",
"resolved": "https://registry.npmjs.org/tinycolor/-/tinycolor-0.0.1.tgz"
},
"options": {
"version": "0.0.6",
"from": "options@>=0.0.5",
"resolved": "https://registry.npmjs.org/options/-/options-0.0.6.tgz"
}
}
},
"xmlhttprequest": {
"version": "1.4.2",
"from": "xmlhttprequest@1.4.2",
"resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.4.2.tgz"
},
"active-x-obfuscator": {
"version": "0.0.1",
"from": "active-x-obfuscator@0.0.1",
"resolved": "https://registry.npmjs.org/active-x-obfuscator/-/active-x-obfuscator-0.0.1.tgz",
"dependencies": {
"zeparser": {
"version": "0.0.5",
"from": "zeparser@0.0.5",
"resolved": "https://registry.npmjs.org/zeparser/-/zeparser-0.0.5.tgz"
}
}
}
}
},
"policyfile": {
"version": "0.0.4",
"from": "policyfile@0.0.4",
"resolved": "https://registry.npmjs.org/policyfile/-/policyfile-0.0.4.tgz"
},
"base64id": {
"version": "0.1.0",
"from": "base64id@0.1.0",
"resolved": "https://registry.npmjs.org/base64id/-/base64id-0.1.0.tgz"
},
"redis": {
"version": "0.7.3",
"from": "redis@0.7.3",
"resolved": "https://registry.npmjs.org/redis/-/redis-0.7.3.tgz"
}
}
},
"chokidar": {
"version": "0.12.0",
"from": "chokidar@>=0.8.2",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-0.12.0.tgz",
"dependencies": {
"readdirp": {
"version": "1.2.0",
"from": "readdirp@>=1.2.0 <1.3.0",
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-1.2.0.tgz",
"dependencies": {
"graceful-fs": {
"version": "2.0.3",
"from": "graceful-fs@2.0.3",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-2.0.3.tgz"
},
"minimatch": {
"version": "0.2.14",
"from": "minimatch@0.2.14",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz",
"dependencies": {
"lru-cache": {
"version": "2.5.0",
"from": "lru-cache@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz"
},
"sigmund": {
"version": "1.0.0",
"from": "sigmund@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz"
}
}
},
"readable-stream": {
"version": "1.0.33",
"from": "readable-stream@>=1.0.26-2 <1.1.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz",
"dependencies": {
"core-util-is": {
"version": "1.0.1",
"from": "core-util-is@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
},
"isarray": {
"version": "0.0.1",
"from": "isarray@0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
},
"string_decoder": {
"version": "0.10.31",
"from": "string_decoder@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.0 <2.1.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
}
}
}
}
},
"async-each": {
"version": "0.1.6",
"from": "async-each@>=0.1.5 <0.2.0",
"resolved": "https://registry.npmjs.org/async-each/-/async-each-0.1.6.tgz"
},
"fsevents": {
"version": "0.3.1",
"from": "fsevents@>=0.3.1 <0.4.0",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-0.3.1.tgz",
"dependencies": {
"nan": {
"version": "1.3.0",
"from": "nan@1.3.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-1.3.0.tgz"
}
}
}
}
},
"glob": {
"version": "3.2.11",
"from": "glob@3.2.11",
"resolved": "https://registry.npmjs.org/glob/-/glob-3.2.11.tgz",
"dependencies": {
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
},
"minimatch": {
"version": "0.3.0",
"from": "minimatch@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz",
"dependencies": {
"lru-cache": {
"version": "2.5.0",
"from": "lru-cache@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz"
},
"sigmund": {
"version": "1.0.0",
"from": "sigmund@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz"
}
}
}
}
},
"minimatch": {
"version": "0.2.14",
"from": "minimatch@0.2.14",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz",
"dependencies": {
"lru-cache": {
"version": "2.5.0",
"from": "lru-cache@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz"
},
"sigmund": {
"version": "1.0.0",
"from": "sigmund@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz"
}
}
},
"http-proxy": {
"version": "0.10.4",
"from": "http-proxy@0.10.4",
"resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-0.10.4.tgz",
"dependencies": {
"pkginfo": {
"version": "0.3.0",
"from": "pkginfo@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/pkginfo/-/pkginfo-0.3.0.tgz"
},
"utile": {
"version": "0.2.1",
"from": "utile@>=0.2.1 <0.3.0",
"resolved": "https://registry.npmjs.org/utile/-/utile-0.2.1.tgz",
"dependencies": {
"async": {
"version": "0.2.10",
"from": "async@>=0.2.9 <0.3.0",
"resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz"
},
"deep-equal": {
"version": "0.2.1",
"from": "deep-equal@*",
"resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-0.2.1.tgz"
},
"i": {
"version": "0.3.2",
"from": "i@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/i/-/i-0.3.2.tgz"
},
"mkdirp": {
"version": "0.5.0",
"from": "mkdirp@>=0.0.0 <1.0.0",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz",
"dependencies": {
"minimist": {
"version": "0.0.8",
"from": "minimist@0.0.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz"
}
}
},
"ncp": {
"version": "0.4.2",
"from": "ncp@>=0.4.0 <0.5.0",
"resolved": "https://registry.npmjs.org/ncp/-/ncp-0.4.2.tgz"
}
}
}
}
},
"optimist": {
"version": "0.6.1",
"from": "optimist@>=0.6.0 <0.7.0",
"resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz",
"dependencies": {
"wordwrap": {
"version": "0.0.2",
"from": "wordwrap@>=0.0.2 <0.1.0",
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz"
},
"minimist": {
"version": "0.0.10",
"from": "minimist@0.0.10",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz"
}
}
},
"rimraf": {
"version": "2.2.8",
"from": "rimraf@>=2.2.5 <2.3.0",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz"
},
"q": {
"version": "0.9.7",
"from": "q@0.9.7",
"resolved": "https://registry.npmjs.org/q/-/q-0.9.7.tgz"
},
"colors": {
"version": "0.6.2",
"from": "colors@0.6.2",
"resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz"
},
"log4js": {
"version": "0.6.21",
"from": "log4js@>=0.6.3 <0.7.0",
"resolved": "https://registry.npmjs.org/log4js/-/log4js-0.6.21.tgz",
"dependencies": {
"async": {
"version": "0.2.10",
"from": "async@0.2.10",
"resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz"
},
"readable-stream": {
"version": "1.0.33",
"from": "readable-stream@>=1.0.2 <1.1.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz",
"dependencies": {
"core-util-is": {
"version": "1.0.1",
"from": "core-util-is@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
},
"isarray": {
"version": "0.0.1",
"from": "isarray@0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
},
"string_decoder": {
"version": "0.10.31",
"from": "string_decoder@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
}
}
},
"semver": {
"version": "1.1.4",
"from": "semver@1.1.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-1.1.4.tgz"
}
}
},
"useragent": {
"version": "2.0.10",
"from": "useragent@2.0.10",
"resolved": "https://registry.npmjs.org/useragent/-/useragent-2.0.10.tgz",
"dependencies": {
"lru-cache": {
"version": "2.2.4",
"from": "lru-cache@>=2.2.0 <2.3.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.2.4.tgz"
}
}
},
"graceful-fs": {
"version": "2.0.3",
"from": "graceful-fs@2.0.3",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-2.0.3.tgz"
},
"connect": {
"version": "2.26.6",
"from": "connect@2.26.6",
"resolved": "https://registry.npmjs.org/connect/-/connect-2.26.6.tgz",
"dependencies": {
"basic-auth-connect": {
"version": "1.0.0",
"from": "basic-auth-connect@1.0.0",
"resolved": "https://registry.npmjs.org/basic-auth-connect/-/basic-auth-connect-1.0.0.tgz"
},
"body-parser": {
"version": "1.8.4",
"from": "body-parser@>=1.8.4 <1.9.0",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.8.4.tgz",
"dependencies": {
"iconv-lite": {
"version": "0.4.4",
"from": "iconv-lite@0.4.4",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.4.tgz"
},
"on-finished": {
"version": "2.1.0",
"from": "on-finished@2.1.0",
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.1.0.tgz",
"dependencies": {
"ee-first": {
"version": "1.0.5",
"from": "ee-first@1.0.5",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.0.5.tgz"
}
}
},
"raw-body": {
"version": "1.3.0",
"from": "raw-body@1.3.0",
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-1.3.0.tgz"
}
}
},
"bytes": {
"version": "1.0.0",
"from": "bytes@1.0.0",
"resolved": "https://registry.npmjs.org/bytes/-/bytes-1.0.0.tgz"
},
"cookie": {
"version": "0.1.2",
"from": "cookie@0.1.2",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.1.2.tgz"
},
"cookie-parser": {
"version": "1.3.3",
"from": "cookie-parser@>=1.3.3 <1.4.0",
"resolved": "https://registry.npmjs.org/cookie-parser/-/cookie-parser-1.3.3.tgz"
},
"cookie-signature": {
"version": "1.0.5",
"from": "cookie-signature@1.0.5",
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.5.tgz"
},
"compression": {
"version": "1.1.2",
"from": "compression@>=1.1.2 <1.2.0",
"resolved": "https://registry.npmjs.org/compression/-/compression-1.1.2.tgz",
"dependencies": {
"accepts": {
"version": "1.1.3",
"from": "accepts@>=1.1.2 <1.2.0",
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.1.3.tgz",
"dependencies": {
"mime-types": {
"version": "2.0.3",
"from": "mime-types@>=2.0.3 <2.1.0",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.0.3.tgz",
"dependencies": {
"mime-db": {
"version": "1.2.0",
"from": "mime-db@>=1.2.0 <1.3.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.2.0.tgz"
}
}
},
"negotiator": {
"version": "0.4.9",
"from": "negotiator@0.4.9",
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.4.9.tgz"
}
}
},
"compressible": {
"version": "2.0.1",
"from": "compressible@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.1.tgz",
"dependencies": {
"mime-db": {
"version": "1.3.0",
"from": "mime-db@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.3.0.tgz"
}
}
},
"vary": {
"version": "1.0.0",
"from": "vary@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/vary/-/vary-1.0.0.tgz"
}
}
},
"connect-timeout": {
"version": "1.3.0",
"from": "connect-timeout@>=1.3.0 <1.4.0",
"resolved": "https://registry.npmjs.org/connect-timeout/-/connect-timeout-1.3.0.tgz",
"dependencies": {
"ms": {
"version": "0.6.2",
"from": "ms@0.6.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-0.6.2.tgz"
}
}
},
"csurf": {
"version": "1.6.3",
"from": "csurf@>=1.6.2 <1.7.0",
"resolved": "https://registry.npmjs.org/csurf/-/csurf-1.6.3.tgz",
"dependencies": {
"csrf": {
"version": "2.0.2",
"from": "csrf@>=2.0.2 <2.1.0",
"resolved": "https://registry.npmjs.org/csrf/-/csrf-2.0.2.tgz",
"dependencies": {
"rndm": {
"version": "1.0.0",
"from": "rndm@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/rndm/-/rndm-1.0.0.tgz"
},
"scmp": {
"version": "1.0.0",
"from": "scmp@1.0.0",
"resolved": "https://registry.npmjs.org/scmp/-/scmp-1.0.0.tgz"
},
"uid-safe": {
"version": "1.0.1",
"from": "uid-safe@>=1.0.1 <1.1.0",
"resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-1.0.1.tgz",
"dependencies": {
"mz": {
"version": "1.1.0",
"from": "mz@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/mz/-/mz-1.1.0.tgz",
"dependencies": {
"native-or-bluebird": {
"version": "1.1.2",
"from": "native-or-bluebird@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/native-or-bluebird/-/native-or-bluebird-1.1.2.tgz"
}
}
}
}
},
"base64-url": {
"version": "1.0.0",
"from": "base64-url@1.0.0",
"resolved": "https://registry.npmjs.org/base64-url/-/base64-url-1.0.0.tgz"
}
}
},
"http-errors": {
"version": "1.2.7",
"from": "http-errors@>=1.2.7 <1.3.0",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.2.7.tgz",
"dependencies": {
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
},
"statuses": {
"version": "1.2.0",
"from": "statuses@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/statuses/-/statuses-1.2.0.tgz"
}
}
}
}
},
"debug": {
"version": "2.0.0",
"from": "debug@>=2.0.0 <2.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.0.0.tgz",
"dependencies": {
"ms": {
"version": "0.6.2",
"from": "ms@0.6.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-0.6.2.tgz"
}
}
},
"depd": {
"version": "0.4.5",
"from": "depd@0.4.5",
"resolved": "https://registry.npmjs.org/depd/-/depd-0.4.5.tgz"
},
"errorhandler": {
"version": "1.2.3",
"from": "errorhandler@>=1.2.2 <1.3.0",
"resolved": "https://registry.npmjs.org/errorhandler/-/errorhandler-1.2.3.tgz",
"dependencies": {
"accepts": {
"version": "1.1.3",
"from": "accepts@>=1.1.2 <1.2.0",
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.1.3.tgz",
"dependencies": {
"mime-types": {
"version": "2.0.3",
"from": "mime-types@>=2.0.3 <2.1.0",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.0.3.tgz",
"dependencies": {
"mime-db": {
"version": "1.2.0",
"from": "mime-db@>=1.2.0 <1.3.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.2.0.tgz"
}
}
},
"negotiator": {
"version": "0.4.9",
"from": "negotiator@0.4.9",
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.4.9.tgz"
}
}
},
"escape-html": {
"version": "1.0.1",
"from": "escape-html@1.0.1",
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.1.tgz"
}
}
},
"express-session": {
"version": "1.8.2",
"from": "express-session@>=1.8.2 <1.9.0",
"resolved": "https://registry.npmjs.org/express-session/-/express-session-1.8.2.tgz",
"dependencies": {
"crc": {
"version": "3.0.0",
"from": "crc@3.0.0",
"resolved": "https://registry.npmjs.org/crc/-/crc-3.0.0.tgz"
},
"uid-safe": {
"version": "1.0.1",
"from": "uid-safe@1.0.1",
"resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-1.0.1.tgz",
"dependencies": {
"mz": {
"version": "1.1.0",
"from": "mz@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/mz/-/mz-1.1.0.tgz",
"dependencies": {
"native-or-bluebird": {
"version": "1.1.2",
"from": "native-or-bluebird@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/native-or-bluebird/-/native-or-bluebird-1.1.2.tgz"
}
}
},
"base64-url": {
"version": "1.0.0",
"from": "base64-url@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/base64-url/-/base64-url-1.0.0.tgz"
}
}
},
"utils-merge": {
"version": "1.0.0",
"from": "utils-merge@1.0.0",
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz"
}
}
},
"finalhandler": {
"version": "0.2.0",
"from": "finalhandler@0.2.0",
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-0.2.0.tgz",
"dependencies": {
"escape-html": {
"version": "1.0.1",
"from": "escape-html@1.0.1",
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.1.tgz"
}
}
},
"fresh": {
"version": "0.2.4",
"from": "fresh@0.2.4",
"resolved": "https://registry.npmjs.org/fresh/-/fresh-0.2.4.tgz"
},
"media-typer": {
"version": "0.3.0",
"from": "media-typer@0.3.0",
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz"
},
"method-override": {
"version": "2.2.0",
"from": "method-override@>=2.2.0 <2.3.0",
"resolved": "https://registry.npmjs.org/method-override/-/method-override-2.2.0.tgz",
"dependencies": {
"methods": {
"version": "1.1.0",
"from": "methods@1.1.0",
"resolved": "https://registry.npmjs.org/methods/-/methods-1.1.0.tgz"
},
"vary": {
"version": "1.0.0",
"from": "vary@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/vary/-/vary-1.0.0.tgz"
}
}
},
"morgan": {
"version": "1.3.2",
"from": "morgan@>=1.3.2 <1.4.0",
"resolved": "https://registry.npmjs.org/morgan/-/morgan-1.3.2.tgz",
"dependencies": {
"basic-auth": {
"version": "1.0.0",
"from": "basic-auth@1.0.0",
"resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-1.0.0.tgz"
},
"on-finished": {
"version": "2.1.0",
"from": "on-finished@2.1.0",
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.1.0.tgz",
"dependencies": {
"ee-first": {
"version": "1.0.5",
"from": "ee-first@1.0.5",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.0.5.tgz"
}
}
}
}
},
"multiparty": {
"version": "3.3.2",
"from": "multiparty@3.3.2",
"resolved": "https://registry.npmjs.org/multiparty/-/multiparty-3.3.2.tgz",
"dependencies": {
"readable-stream": {
"version": "1.1.13",
"from": "readable-stream@>=1.1.9 <1.2.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.13.tgz",
"dependencies": {
"core-util-is": {
"version": "1.0.1",
"from": "core-util-is@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
},
"isarray": {
"version": "0.0.1",
"from": "isarray@0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
},
"string_decoder": {
"version": "0.10.31",
"from": "string_decoder@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
}
}
},
"stream-counter": {
"version": "0.2.0",
"from": "stream-counter@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/stream-counter/-/stream-counter-0.2.0.tgz"
}
}
},
"on-headers": {
"version": "1.0.0",
"from": "on-headers@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.0.tgz"
},
"parseurl": {
"version": "1.3.0",
"from": "parseurl@>=1.3.0 <1.4.0",
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.0.tgz"
},
"qs": {
"version": "2.2.4",
"from": "qs@2.2.4",
"resolved": "https://registry.npmjs.org/qs/-/qs-2.2.4.tgz"
},
"response-time": {
"version": "2.0.1",
"from": "response-time@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/response-time/-/response-time-2.0.1.tgz"
},
"serve-favicon": {
"version": "2.1.7",
"from": "serve-favicon@>=2.1.5 <2.2.0",
"resolved": "https://registry.npmjs.org/serve-favicon/-/serve-favicon-2.1.7.tgz",
"dependencies": {
"etag": {
"version": "1.5.1",
"from": "etag@>=1.5.0 <1.6.0",
"resolved": "https://registry.npmjs.org/etag/-/etag-1.5.1.tgz",
"dependencies": {
"crc": {
"version": "3.2.1",
"from": "crc@3.2.1",
"resolved": "https://registry.npmjs.org/crc/-/crc-3.2.1.tgz"
}
}
},
"ms": {
"version": "0.6.2",
"from": "ms@0.6.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-0.6.2.tgz"
}
}
},
"serve-index": {
"version": "1.2.1",
"from": "serve-index@>=1.2.1 <1.3.0",
"resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.2.1.tgz",
"dependencies": {
"accepts": {
"version": "1.1.3",
"from": "accepts@>=1.1.0 <1.2.0",
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.1.3.tgz",
"dependencies": {
"mime-types": {
"version": "2.0.3",
"from": "mime-types@>=2.0.3 <2.1.0",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.0.3.tgz",
"dependencies": {
"mime-db": {
"version": "1.2.0",
"from": "mime-db@>=1.2.0 <1.3.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.2.0.tgz"
}
}
},
"negotiator": {
"version": "0.4.9",
"from": "negotiator@0.4.9",
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.4.9.tgz"
}
}
},
"batch": {
"version": "0.5.1",
"from": "batch@0.5.1",
"resolved": "https://registry.npmjs.org/batch/-/batch-0.5.1.tgz"
}
}
},
"serve-static": {
"version": "1.6.4",
"from": "serve-static@>=1.6.4 <1.7.0",
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.6.4.tgz",
"dependencies": {
"escape-html": {
"version": "1.0.1",
"from": "escape-html@1.0.1",
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.1.tgz"
},
"send": {
"version": "0.9.3",
"from": "send@0.9.3",
"resolved": "https://registry.npmjs.org/send/-/send-0.9.3.tgz",
"dependencies": {
"destroy": {
"version": "1.0.3",
"from": "destroy@1.0.3",
"resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.3.tgz"
},
"etag": {
"version": "1.4.0",
"from": "etag@>=1.4.0 <1.5.0",
"resolved": "https://registry.npmjs.org/etag/-/etag-1.4.0.tgz",
"dependencies": {
"crc": {
"version": "3.0.0",
"from": "crc@3.0.0",
"resolved": "https://registry.npmjs.org/crc/-/crc-3.0.0.tgz"
}
}
},
"mime": {
"version": "1.2.11",
"from": "mime@>=1.2.11 <1.3.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz"
},
"ms": {
"version": "0.6.2",
"from": "ms@0.6.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-0.6.2.tgz"
},
"on-finished": {
"version": "2.1.0",
"from": "on-finished@2.1.0",
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.1.0.tgz",
"dependencies": {
"ee-first": {
"version": "1.0.5",
"from": "ee-first@1.0.5",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.0.5.tgz"
}
}
},
"range-parser": {
"version": "1.0.2",
"from": "range-parser@>=1.0.2 <1.1.0",
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.0.2.tgz"
}
}
},
"utils-merge": {
"version": "1.0.0",
"from": "utils-merge@1.0.0",
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz"
}
}
},
"type-is": {
"version": "1.5.3",
"from": "type-is@>=1.5.2 <1.6.0",
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.5.3.tgz",
"dependencies": {
"mime-types": {
"version": "2.0.3",
"from": "mime-types@>=2.0.3 <2.1.0",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.0.3.tgz",
"dependencies": {
"mime-db": {
"version": "1.2.0",
"from": "mime-db@>=1.2.0 <1.3.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.2.0.tgz"
}
}
}
}
},
"vhost": {
"version": "3.0.0",
"from": "vhost@>=3.0.0 <3.1.0",
"resolved": "https://registry.npmjs.org/vhost/-/vhost-3.0.0.tgz"
},
"pause": {
"version": "0.0.1",
"from": "pause@0.0.1",
"resolved": "https://registry.npmjs.org/pause/-/pause-0.0.1.tgz"
}
}
},
"source-map": {
"version": "0.1.40",
"from": "source-map@>=0.1.40 <0.2.0",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.40.tgz",
"dependencies": {
"amdefine": {
"version": "0.1.0",
"from": "amdefine@>=0.0.4",
"resolved": "https://registry.npmjs.org/amdefine/-/amdefine-0.1.0.tgz"
}
}
}
}
},
"karma-chrome-launcher": {
"version": "0.1.7",
"from": "karma-chrome-launcher@>=0.1.5 <0.2.0",
"resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-0.1.7.tgz"
},
"karma-cli": {
"version": "0.0.4",
"from": "karma-cli@>=0.0.4 <0.0.5",
"resolved": "https://registry.npmjs.org/karma-cli/-/karma-cli-0.0.4.tgz",
"dependencies": {
"resolve": {
"version": "0.5.1",
"from": "resolve@0.5.1",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-0.5.1.tgz"
}
}
},
"karma-firefox-launcher": {
"version": "0.1.3",
"from": "karma-firefox-launcher@>=0.1.3 <0.2.0",
"resolved": "https://registry.npmjs.org/karma-firefox-launcher/-/karma-firefox-launcher-0.1.3.tgz"
},
"karma-jasmine": {
"version": "0.3.2",
"from": "karma-jasmine@>=0.3.1 <0.4.0",
"resolved": "https://registry.npmjs.org/karma-jasmine/-/karma-jasmine-0.3.2.tgz"
},
"karma-safari-launcher": {
"version": "0.1.1",
"from": "karma-safari-launcher@>=0.1.1 <0.2.0",
"resolved": "https://registry.npmjs.org/karma-safari-launcher/-/karma-safari-launcher-0.1.1.tgz"
},
"karma-sauce-launcher": {
"version": "0.2.10",
"from": "karma-sauce-launcher@>=0.2.10 <0.3.0",
"resolved": "https://registry.npmjs.org/karma-sauce-launcher/-/karma-sauce-launcher-0.2.10.tgz",
"dependencies": {
"wd": {
"version": "0.3.11",
"from": "wd@>=0.3.4 <0.4.0",
"resolved": "https://registry.npmjs.org/wd/-/wd-0.3.11.tgz",
"dependencies": {
"archiver": {
"version": "0.12.0",
"from": "archiver@0.12.0",
"resolved": "https://registry.npmjs.org/archiver/-/archiver-0.12.0.tgz",
"dependencies": {
"buffer-crc32": {
"version": "0.2.5",
"from": "buffer-crc32@>=0.2.1 <0.3.0",
"resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.5.tgz"
},
"glob": {
"version": "4.0.6",
"from": "glob@>=4.0.6 <4.1.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-4.0.6.tgz",
"dependencies": {
"graceful-fs": {
"version": "3.0.5",
"from": "graceful-fs@>=3.0.2 <4.0.0",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.5.tgz"
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
},
"minimatch": {
"version": "1.0.0",
"from": "minimatch@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-1.0.0.tgz",
"dependencies": {
"lru-cache": {
"version": "2.5.0",
"from": "lru-cache@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz"
},
"sigmund": {
"version": "1.0.0",
"from": "sigmund@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz"
}
}
},
"once": {
"version": "1.3.1",
"from": "once@>=1.3.0 <2.0.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.3.1.tgz",
"dependencies": {
"wrappy": {
"version": "1.0.1",
"from": "wrappy@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz"
}
}
}
}
},
"lazystream": {
"version": "0.1.0",
"from": "lazystream@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/lazystream/-/lazystream-0.1.0.tgz"
},
"lodash": {
"version": "2.4.1",
"from": "lodash@>=2.4.1 <2.5.0",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.1.tgz"
},
"readable-stream": {
"version": "1.0.33",
"from": "readable-stream@>=1.0.26 <1.1.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz",
"dependencies": {
"core-util-is": {
"version": "1.0.1",
"from": "core-util-is@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
},
"isarray": {
"version": "0.0.1",
"from": "isarray@0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
},
"string_decoder": {
"version": "0.10.31",
"from": "string_decoder@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
}
}
},
"tar-stream": {
"version": "1.0.2",
"from": "tar-stream@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.0.2.tgz",
"dependencies": {
"bl": {
"version": "0.9.3",
"from": "bl@>=0.9.0 <0.10.0",
"resolved": "https://registry.npmjs.org/bl/-/bl-0.9.3.tgz"
},
"end-of-stream": {
"version": "1.1.0",
"from": "end-of-stream@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.1.0.tgz",
"dependencies": {
"once": {
"version": "1.3.1",
"from": "once@>=1.3.0 <1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.3.1.tgz",
"dependencies": {
"wrappy": {
"version": "1.0.1",
"from": "wrappy@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz"
}
}
}
}
},
"xtend": {
"version": "4.0.0",
"from": "xtend@>=4.0.0 <5.0.0",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.0.tgz"
}
}
},
"zip-stream": {
"version": "0.4.1",
"from": "zip-stream@>=0.4.0 <0.5.0",
"resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-0.4.1.tgz",
"dependencies": {
"compress-commons": {
"version": "0.1.6",
"from": "compress-commons@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-0.1.6.tgz",
"dependencies": {
"crc32-stream": {
"version": "0.3.1",
"from": "crc32-stream@>=0.3.1 <0.4.0",
"resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-0.3.1.tgz"
}
}
}
}
}
}
},
"async": {
"version": "0.9.0",
"from": "async@>=0.9.0 <0.10.0",
"resolved": "https://registry.npmjs.org/async/-/async-0.9.0.tgz"
},
"q": {
"version": "1.0.1",
"from": "q@1.0.1",
"resolved": "https://registry.npmjs.org/q/-/q-1.0.1.tgz"
},
"request": {
"version": "2.46.0",
"from": "request@2.46.0",
"resolved": "https://registry.npmjs.org/request/-/request-2.46.0.tgz",
"dependencies": {
"bl": {
"version": "0.9.3",
"from": "bl@>=0.9.0 <0.10.0",
"resolved": "https://registry.npmjs.org/bl/-/bl-0.9.3.tgz",
"dependencies": {
"readable-stream": {
"version": "1.0.33",
"from": "readable-stream@>=1.0.26 <1.1.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz",
"dependencies": {
"core-util-is": {
"version": "1.0.1",
"from": "core-util-is@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
},
"isarray": {
"version": "0.0.1",
"from": "isarray@0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
},
"string_decoder": {
"version": "0.10.31",
"from": "string_decoder@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
}
}
}
}
},
"caseless": {
"version": "0.6.0",
"from": "caseless@>=0.6.0 <0.7.0",
"resolved": "https://registry.npmjs.org/caseless/-/caseless-0.6.0.tgz"
},
"forever-agent": {
"version": "0.5.2",
"from": "forever-agent@>=0.5.0 <0.6.0",
"resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.5.2.tgz"
},
"form-data": {
"version": "0.1.4",
"from": "form-data@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-0.1.4.tgz",
"dependencies": {
"combined-stream": {
"version": "0.0.7",
"from": "combined-stream@>=0.0.4 <0.1.0",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz",
"dependencies": {
"delayed-stream": {
"version": "0.0.5",
"from": "delayed-stream@0.0.5",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz"
}
}
},
"mime": {
"version": "1.2.11",
"from": "mime@>=1.2.11 <1.3.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz"
}
}
},
"json-stringify-safe": {
"version": "5.0.0",
"from": "json-stringify-safe@>=5.0.0 <5.1.0",
"resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.0.tgz"
},
"mime-types": {
"version": "1.0.2",
"from": "mime-types@>=1.0.1 <1.1.0",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-1.0.2.tgz"
},
"node-uuid": {
"version": "1.4.2",
"from": "node-uuid@>=1.4.0 <1.5.0",
"resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.2.tgz"
},
"qs": {
"version": "1.2.2",
"from": "qs@>=1.2.0 <1.3.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-1.2.2.tgz"
},
"tunnel-agent": {
"version": "0.4.0",
"from": "tunnel-agent@>=0.4.0 <0.5.0",
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.0.tgz"
},
"tough-cookie": {
"version": "0.12.1",
"from": "tough-cookie@>=0.12.0",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-0.12.1.tgz",
"dependencies": {
"punycode": {
"version": "1.3.2",
"from": "punycode@>=0.2.0",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz"
}
}
},
"http-signature": {
"version": "0.10.0",
"from": "http-signature@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/http-signature/-/http-signature-0.10.0.tgz",
"dependencies": {
"assert-plus": {
"version": "0.1.2",
"from": "assert-plus@0.1.2",
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.2.tgz"
},
"asn1": {
"version": "0.1.11",
"from": "asn1@0.1.11",
"resolved": "https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz"
},
"ctype": {
"version": "0.5.2",
"from": "ctype@0.5.2",
"resolved": "https://registry.npmjs.org/ctype/-/ctype-0.5.2.tgz"
}
}
},
"oauth-sign": {
"version": "0.4.0",
"from": "oauth-sign@>=0.4.0 <0.5.0",
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.4.0.tgz"
},
"hawk": {
"version": "1.1.1",
"from": "hawk@1.1.1",
"resolved": "https://registry.npmjs.org/hawk/-/hawk-1.1.1.tgz",
"dependencies": {
"hoek": {
"version": "0.9.1",
"from": "hoek@>=0.9.0 <0.10.0",
"resolved": "https://registry.npmjs.org/hoek/-/hoek-0.9.1.tgz"
},
"boom": {
"version": "0.4.2",
"from": "boom@>=0.4.0 <0.5.0",
"resolved": "https://registry.npmjs.org/boom/-/boom-0.4.2.tgz"
},
"cryptiles": {
"version": "0.2.2",
"from": "cryptiles@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-0.2.2.tgz"
},
"sntp": {
"version": "0.2.4",
"from": "sntp@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/sntp/-/sntp-0.2.4.tgz"
}
}
},
"aws-sign2": {
"version": "0.5.0",
"from": "aws-sign2@>=0.5.0 <0.6.0",
"resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz"
},
"stringstream": {
"version": "0.0.4",
"from": "stringstream@>=0.0.4 <0.1.0",
"resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.4.tgz"
}
}
},
"underscore.string": {
"version": "2.3.3",
"from": "underscore.string@2.3.3",
"resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.3.3.tgz"
},
"vargs": {
"version": "0.1.0",
"from": "vargs@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/vargs/-/vargs-0.1.0.tgz"
}
}
},
"sauce-connect-launcher": {
"version": "0.6.1",
"from": "sauce-connect-launcher@0.6.1",
"resolved": "https://registry.npmjs.org/sauce-connect-launcher/-/sauce-connect-launcher-0.6.1.tgz",
"dependencies": {
"lodash": {
"version": "2.4.1",
"from": "lodash@2.4.1",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.1.tgz"
},
"async": {
"version": "0.9.0",
"from": "async@>=0.9.0 <0.10.0",
"resolved": "https://registry.npmjs.org/async/-/async-0.9.0.tgz"
},
"adm-zip": {
"version": "0.4.4",
"from": "adm-zip@>=0.4.3 <0.5.0",
"resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.4.tgz"
},
"rimraf": {
"version": "2.2.8",
"from": "rimraf@>=2.2.6 <2.3.0",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz"
}
}
},
"q": {
"version": "0.9.7",
"from": "q@0.9.7",
"resolved": "https://registry.npmjs.org/q/-/q-0.9.7.tgz"
},
"saucelabs": {
"version": "0.1.1",
"from": "saucelabs@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/saucelabs/-/saucelabs-0.1.1.tgz"
}
}
},
"karma-traceur-preprocessor": {
"version": "0.4.0",
"from": "karma-traceur-preprocessor@>=0.4.0 <0.5.0",
"resolved": "https://registry.npmjs.org/karma-traceur-preprocessor/-/karma-traceur-preprocessor-0.4.0.tgz"
},
"lodash": {
"version": "2.4.1",
"from": "lodash@>=2.4.1 <3.0.0",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.1.tgz"
},
"mime": {
"version": "1.2.11",
"from": "mime@>=1.2.11 <2.0.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz"
},
"minimist": {
"version": "1.1.0",
"from": "minimist@>=1.1.0 <2.0.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.1.0.tgz"
},
"mkdirp": {
"version": "0.5.0",
"from": "mkdirp@>=0.5.0 <0.6.0",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz",
"dependencies": {
"minimist": {
"version": "0.0.8",
"from": "minimist@0.0.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz"
}
}
},
"morgan": {
"version": "1.5.0",
"from": "morgan@>=1.4.0 <2.0.0",
"resolved": "https://registry.npmjs.org/morgan/-/morgan-1.5.0.tgz",
"dependencies": {
"basic-auth": {
"version": "1.0.0",
"from": "basic-auth@1.0.0",
"resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-1.0.0.tgz"
},
"debug": {
"version": "2.1.0",
"from": "debug@>=2.1.0 <2.2.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.1.0.tgz",
"dependencies": {
"ms": {
"version": "0.6.2",
"from": "ms@0.6.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-0.6.2.tgz"
}
}
},
"depd": {
"version": "1.0.0",
"from": "depd@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/depd/-/depd-1.0.0.tgz"
},
"on-finished": {
"version": "2.1.1",
"from": "on-finished@2.1.1",
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.1.1.tgz",
"dependencies": {
"ee-first": {
"version": "1.1.0",
"from": "ee-first@1.1.0",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.0.tgz"
}
}
}
}
},
"opn": {
"version": "1.0.0",
"from": "opn@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/opn/-/opn-1.0.0.tgz"
},
"protractor": {
"version": "1.5.0",
"from": "protractor@>=1.3.1 <2.0.0",
"resolved": "https://registry.npmjs.org/protractor/-/protractor-1.5.0.tgz",
"dependencies": {
"request": {
"version": "2.36.0",
"from": "request@2.36.0",
"resolved": "https://registry.npmjs.org/request/-/request-2.36.0.tgz",
"dependencies": {
"qs": {
"version": "0.6.6",
"from": "qs@>=0.6.0 <0.7.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-0.6.6.tgz"
},
"json-stringify-safe": {
"version": "5.0.0",
"from": "json-stringify-safe@>=5.0.0 <5.1.0",
"resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.0.tgz"
},
"mime": {
"version": "1.2.11",
"from": "mime@>=1.2.9 <1.3.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz"
},
"forever-agent": {
"version": "0.5.2",
"from": "forever-agent@>=0.5.0 <0.6.0",
"resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.5.2.tgz"
},
"node-uuid": {
"version": "1.4.2",
"from": "node-uuid@>=1.4.0 <1.5.0",
"resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.2.tgz"
},
"tough-cookie": {
"version": "0.12.1",
"from": "tough-cookie@>=0.12.0",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-0.12.1.tgz",
"dependencies": {
"punycode": {
"version": "1.3.2",
"from": "punycode@>=0.2.0",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz"
}
}
},
"form-data": {
"version": "0.1.4",
"from": "form-data@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-0.1.4.tgz",
"dependencies": {
"combined-stream": {
"version": "0.0.7",
"from": "combined-stream@>=0.0.4 <0.1.0",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz",
"dependencies": {
"delayed-stream": {
"version": "0.0.5",
"from": "delayed-stream@0.0.5",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz"
}
}
},
"async": {
"version": "0.9.0",
"from": "async@>=0.9.0 <0.10.0",
"resolved": "https://registry.npmjs.org/async/-/async-0.9.0.tgz"
}
}
},
"tunnel-agent": {
"version": "0.4.0",
"from": "tunnel-agent@>=0.4.0 <0.5.0",
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.0.tgz"
},
"http-signature": {
"version": "0.10.0",
"from": "http-signature@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/http-signature/-/http-signature-0.10.0.tgz",
"dependencies": {
"assert-plus": {
"version": "0.1.2",
"from": "assert-plus@0.1.2",
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.2.tgz"
},
"asn1": {
"version": "0.1.11",
"from": "asn1@0.1.11",
"resolved": "https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz"
},
"ctype": {
"version": "0.5.2",
"from": "ctype@0.5.2",
"resolved": "https://registry.npmjs.org/ctype/-/ctype-0.5.2.tgz"
}
}
},
"oauth-sign": {
"version": "0.3.0",
"from": "oauth-sign@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.3.0.tgz"
},
"hawk": {
"version": "1.0.0",
"from": "hawk@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/hawk/-/hawk-1.0.0.tgz",
"dependencies": {
"hoek": {
"version": "0.9.1",
"from": "hoek@>=0.9.0 <0.10.0",
"resolved": "https://registry.npmjs.org/hoek/-/hoek-0.9.1.tgz"
},
"boom": {
"version": "0.4.2",
"from": "boom@>=0.4.0 <0.5.0",
"resolved": "https://registry.npmjs.org/boom/-/boom-0.4.2.tgz"
},
"cryptiles": {
"version": "0.2.2",
"from": "cryptiles@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-0.2.2.tgz"
},
"sntp": {
"version": "0.2.4",
"from": "sntp@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/sntp/-/sntp-0.2.4.tgz"
}
}
},
"aws-sign2": {
"version": "0.5.0",
"from": "aws-sign2@>=0.5.0 <0.6.0",
"resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz"
}
}
},
"selenium-webdriver": {
"version": "2.44.0",
"from": "selenium-webdriver@2.44.0",
"resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-2.44.0.tgz",
"dependencies": {
"tmp": {
"version": "0.0.24",
"from": "tmp@0.0.24",
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.24.tgz"
},
"xml2js": {
"version": "0.4.4",
"from": "xml2js@0.4.4",
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.4.tgz",
"dependencies": {
"sax": {
"version": "0.6.1",
"from": "sax@>=0.6.0 <0.7.0",
"resolved": "https://registry.npmjs.org/sax/-/sax-0.6.1.tgz"
},
"xmlbuilder": {
"version": "2.4.5",
"from": "xmlbuilder@>=1.0.0",
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-2.4.5.tgz",
"dependencies": {
"lodash-node": {
"version": "2.4.1",
"from": "lodash-node@>=2.4.1 <2.5.0",
"resolved": "https://registry.npmjs.org/lodash-node/-/lodash-node-2.4.1.tgz"
}
}
}
}
}
}
},
"minijasminenode": {
"version": "1.1.1",
"from": "minijasminenode@1.1.1",
"resolved": "https://registry.npmjs.org/minijasminenode/-/minijasminenode-1.1.1.tgz"
},
"jasminewd": {
"version": "1.1.0",
"from": "jasminewd@1.1.0",
"resolved": "https://registry.npmjs.org/jasminewd/-/jasminewd-1.1.0.tgz"
},
"saucelabs": {
"version": "0.1.1",
"from": "saucelabs@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/saucelabs/-/saucelabs-0.1.1.tgz"
},
"glob": {
"version": "3.2.11",
"from": "glob@3.2.11",
"resolved": "https://registry.npmjs.org/glob/-/glob-3.2.11.tgz",
"dependencies": {
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
},
"minimatch": {
"version": "0.3.0",
"from": "minimatch@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz",
"dependencies": {
"lru-cache": {
"version": "2.5.0",
"from": "lru-cache@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz"
},
"sigmund": {
"version": "1.0.0",
"from": "sigmund@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz"
}
}
}
}
},
"adm-zip": {
"version": "0.4.4",
"from": "adm-zip@>=0.4.4 <0.5.0",
"resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.4.tgz"
},
"optimist": {
"version": "0.6.1",
"from": "optimist@>=0.6.0 <0.7.0",
"resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz",
"dependencies": {
"wordwrap": {
"version": "0.0.2",
"from": "wordwrap@>=0.0.2 <0.1.0",
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz"
},
"minimist": {
"version": "0.0.10",
"from": "minimist@0.0.10",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz"
}
}
},
"q": {
"version": "1.0.0",
"from": "q@1.0.0",
"resolved": "https://registry.npmjs.org/q/-/q-1.0.0.tgz"
},
"source-map-support": {
"version": "0.2.8",
"from": "source-map-support@>=0.2.6 <0.3.0",
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.2.8.tgz",
"dependencies": {
"source-map": {
"version": "0.1.32",
"from": "source-map@0.1.32",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.32.tgz",
"dependencies": {
"amdefine": {
"version": "0.1.0",
"from": "amdefine@>=0.0.4",
"resolved": "https://registry.npmjs.org/amdefine/-/amdefine-0.1.0.tgz"
}
}
}
}
}
}
},
"read-file-stdin": {
"version": "0.2.0",
"from": "read-file-stdin@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/read-file-stdin/-/read-file-stdin-0.2.0.tgz",
"dependencies": {
"gather-stream": {
"version": "1.0.0",
"from": "gather-stream@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/gather-stream/-/gather-stream-1.0.0.tgz"
}
}
},
"rework": {
"version": "1.0.1",
"from": "rework@>=1.0.1 <2.0.0",
"resolved": "https://registry.npmjs.org/rework/-/rework-1.0.1.tgz",
"dependencies": {
"css": {
"version": "2.1.0",
"from": "css@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/css/-/css-2.1.0.tgz",
"dependencies": {
"source-map": {
"version": "0.1.40",
"from": "source-map@>=0.1.38 <0.2.0",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.40.tgz",
"dependencies": {
"amdefine": {
"version": "0.1.0",
"from": "amdefine@>=0.0.4",
"resolved": "https://registry.npmjs.org/amdefine/-/amdefine-0.1.0.tgz"
}
}
},
"source-map-resolve": {
"version": "0.3.1",
"from": "source-map-resolve@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.3.1.tgz",
"dependencies": {
"source-map-url": {
"version": "0.3.0",
"from": "source-map-url@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.3.0.tgz"
},
"atob": {
"version": "1.1.2",
"from": "atob@>=1.1.0 <1.2.0",
"resolved": "https://registry.npmjs.org/atob/-/atob-1.1.2.tgz"
},
"resolve-url": {
"version": "0.2.1",
"from": "resolve-url@>=0.2.1 <0.3.0",
"resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz"
}
}
},
"urix": {
"version": "0.1.0",
"from": "urix@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz"
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.1 <3.0.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
}
}
},
"convert-source-map": {
"version": "0.3.5",
"from": "convert-source-map@0.3.5",
"resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-0.3.5.tgz"
}
}
},
"rework-import": {
"version": "2.0.0",
"from": "rework-import@2.0.0",
"resolved": "https://registry.npmjs.org/rework-import/-/rework-import-2.0.0.tgz",
"dependencies": {
"css": {
"version": "2.1.0",
"from": "css@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/css/-/css-2.1.0.tgz",
"dependencies": {
"source-map": {
"version": "0.1.40",
"from": "source-map@>=0.1.38 <0.2.0",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.40.tgz",
"dependencies": {
"amdefine": {
"version": "0.1.0",
"from": "amdefine@>=0.0.4",
"resolved": "https://registry.npmjs.org/amdefine/-/amdefine-0.1.0.tgz"
}
}
},
"source-map-resolve": {
"version": "0.3.1",
"from": "source-map-resolve@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.3.1.tgz",
"dependencies": {
"source-map-url": {
"version": "0.3.0",
"from": "source-map-url@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.3.0.tgz"
},
"atob": {
"version": "1.1.2",
"from": "atob@>=1.1.0 <1.2.0",
"resolved": "https://registry.npmjs.org/atob/-/atob-1.1.2.tgz"
},
"resolve-url": {
"version": "0.2.1",
"from": "resolve-url@>=0.2.1 <0.3.0",
"resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz"
}
}
},
"urix": {
"version": "0.1.0",
"from": "urix@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz"
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.1 <3.0.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
}
}
},
"globby": {
"version": "1.0.0",
"from": "globby@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/globby/-/globby-1.0.0.tgz",
"dependencies": {
"array-differ": {
"version": "1.0.0",
"from": "array-differ@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz"
},
"array-union": {
"version": "1.0.1",
"from": "array-union@>=1.0.1 <2.0.0",
"resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.1.tgz",
"dependencies": {
"array-uniq": {
"version": "1.0.1",
"from": "array-uniq@>=1.0.1 <2.0.0",
"resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.1.tgz"
}
}
},
"async": {
"version": "0.9.0",
"from": "async@>=0.9.0 <0.10.0",
"resolved": "https://registry.npmjs.org/async/-/async-0.9.0.tgz"
}
}
},
"parse-import": {
"version": "2.0.0",
"from": "parse-import@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/parse-import/-/parse-import-2.0.0.tgz",
"dependencies": {
"get-imports": {
"version": "1.0.0",
"from": "get-imports@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/get-imports/-/get-imports-1.0.0.tgz",
"dependencies": {
"array-uniq": {
"version": "1.0.1",
"from": "array-uniq@>=1.0.1 <2.0.0",
"resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.1.tgz"
},
"import-regex": {
"version": "1.1.0",
"from": "import-regex@>=1.1.0 <2.0.0",
"resolved": "https://registry.npmjs.org/import-regex/-/import-regex-1.1.0.tgz"
}
}
}
}
},
"url-regex": {
"version": "2.1.2",
"from": "url-regex@>=2.1.1 <3.0.0",
"resolved": "https://registry.npmjs.org/url-regex/-/url-regex-2.1.2.tgz",
"dependencies": {
"ip-regex": {
"version": "1.0.1",
"from": "ip-regex@>=1.0.1 <2.0.0",
"resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-1.0.1.tgz"
}
}
}
}
},
"rework-vars": {
"version": "3.1.1",
"from": "rework-vars@>=3.1.1 <4.0.0",
"resolved": "https://registry.npmjs.org/rework-vars/-/rework-vars-3.1.1.tgz",
"dependencies": {
"rework-visit": {
"version": "1.0.0",
"from": "rework-visit@1.0.0",
"resolved": "https://registry.npmjs.org/rework-visit/-/rework-visit-1.0.0.tgz"
},
"balanced-match": {
"version": "0.1.0",
"from": "balanced-match@0.1.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.1.0.tgz"
}
}
},
"send": {
"version": "0.10.1",
"from": "send@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/send/-/send-0.10.1.tgz",
"dependencies": {
"debug": {
"version": "2.1.0",
"from": "debug@>=2.1.0 <2.2.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.1.0.tgz",
"dependencies": {
"ms": {
"version": "0.6.2",
"from": "ms@0.6.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-0.6.2.tgz"
}
}
},
"depd": {
"version": "1.0.0",
"from": "depd@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/depd/-/depd-1.0.0.tgz"
},
"destroy": {
"version": "1.0.3",
"from": "destroy@1.0.3",
"resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.3.tgz"
},
"escape-html": {
"version": "1.0.1",
"from": "escape-html@1.0.1",
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.1.tgz"
},
"etag": {
"version": "1.5.1",
"from": "etag@>=1.5.0 <1.6.0",
"resolved": "https://registry.npmjs.org/etag/-/etag-1.5.1.tgz",
"dependencies": {
"crc": {
"version": "3.2.1",
"from": "crc@3.2.1",
"resolved": "https://registry.npmjs.org/crc/-/crc-3.2.1.tgz"
}
}
},
"fresh": {
"version": "0.2.4",
"from": "fresh@0.2.4",
"resolved": "https://registry.npmjs.org/fresh/-/fresh-0.2.4.tgz"
},
"ms": {
"version": "0.6.2",
"from": "ms@0.6.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-0.6.2.tgz"
},
"on-finished": {
"version": "2.1.1",
"from": "on-finished@2.1.1",
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.1.1.tgz",
"dependencies": {
"ee-first": {
"version": "1.1.0",
"from": "ee-first@1.1.0",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.0.tgz"
}
}
},
"range-parser": {
"version": "1.0.2",
"from": "range-parser@>=1.0.2 <1.1.0",
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.0.2.tgz"
}
}
},
"serve-static": {
"version": "1.7.1",
"from": "serve-static@>=1.7.0 <2.0.0",
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.7.1.tgz",
"dependencies": {
"escape-html": {
"version": "1.0.1",
"from": "escape-html@1.0.1",
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.1.tgz"
},
"parseurl": {
"version": "1.3.0",
"from": "parseurl@>=1.3.0 <1.4.0",
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.0.tgz"
},
"utils-merge": {
"version": "1.0.0",
"from": "utils-merge@1.0.0",
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz"
}
}
},
"systemjs-assetgraph": {
"version": "0.1.0",
"from": "systemjs-assetgraph@*",
"resolved": "https://registry.npmjs.org/systemjs-assetgraph/-/systemjs-assetgraph-0.1.0.tgz",
"dependencies": {
"rsvp": {
"version": "3.0.14",
"from": "rsvp@>=3.0.14 <4.0.0",
"resolved": "https://registry.npmjs.org/rsvp/-/rsvp-3.0.14.tgz"
}
}
},
"systemjs-builder": {
"version": "0.4.5",
"from": "systemjs-builder@>=0.4.5 <0.5.0",
"resolved": "https://registry.npmjs.org/systemjs-builder/-/systemjs-builder-0.4.5.tgz",
"dependencies": {
"rsvp": {
"version": "3.0.14",
"from": "rsvp@>=3.0.14 <4.0.0",
"resolved": "https://registry.npmjs.org/rsvp/-/rsvp-3.0.14.tgz"
},
"source-map": {
"version": "0.1.40",
"from": "source-map@>=0.1.8 <0.2.0",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.40.tgz",
"dependencies": {
"amdefine": {
"version": "0.1.0",
"from": "amdefine@>=0.0.4",
"resolved": "https://registry.npmjs.org/amdefine/-/amdefine-0.1.0.tgz"
}
}
},
"systemjs": {
"version": "0.10.2",
"from": "systemjs@>=0.10.2 <0.11.0",
"resolved": "https://registry.npmjs.org/systemjs/-/systemjs-0.10.2.tgz",
"dependencies": {
"es6-module-loader": {
"version": "0.10.0",
"from": "es6-module-loader@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/es6-module-loader/-/es6-module-loader-0.10.0.tgz",
"dependencies": {
"grunt-contrib-uglify": {
"version": "0.6.0",
"from": "grunt-contrib-uglify@0.6.0",
"resolved": "https://registry.npmjs.org/grunt-contrib-uglify/-/grunt-contrib-uglify-0.6.0.tgz",
"dependencies": {
"chalk": {
"version": "0.5.1",
"from": "chalk@>=0.5.1 <0.6.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-0.5.1.tgz",
"dependencies": {
"ansi-styles": {
"version": "1.1.0",
"from": "ansi-styles@1.1.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.1.0.tgz"
},
"escape-string-regexp": {
"version": "1.0.2",
"from": "escape-string-regexp@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz"
},
"has-ansi": {
"version": "0.1.0",
"from": "has-ansi@0.1.0",
"resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-0.1.0.tgz",
"dependencies": {
"ansi-regex": {
"version": "0.2.1",
"from": "ansi-regex@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz"
}
}
},
"strip-ansi": {
"version": "0.3.0",
"from": "strip-ansi@0.3.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.3.0.tgz",
"dependencies": {
"ansi-regex": {
"version": "0.2.1",
"from": "ansi-regex@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz"
}
}
},
"supports-color": {
"version": "0.2.0",
"from": "supports-color@0.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-0.2.0.tgz"
}
}
},
"maxmin": {
"version": "1.0.0",
"from": "maxmin@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/maxmin/-/maxmin-1.0.0.tgz",
"dependencies": {
"figures": {
"version": "1.3.5",
"from": "figures@>=1.0.1 <2.0.0",
"resolved": "https://registry.npmjs.org/figures/-/figures-1.3.5.tgz"
},
"gzip-size": {
"version": "1.0.0",
"from": "gzip-size@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-1.0.0.tgz",
"dependencies": {
"concat-stream": {
"version": "1.4.7",
"from": "concat-stream@>=1.4.1 <2.0.0",
"resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.4.7.tgz",
"dependencies": {
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
},
"typedarray": {
"version": "0.0.6",
"from": "typedarray@>=0.0.5 <0.1.0",
"resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz"
},
"readable-stream": {
"version": "1.1.13",
"from": "readable-stream@1.1.13",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.13.tgz",
"dependencies": {
"core-util-is": {
"version": "1.0.1",
"from": "core-util-is@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
},
"isarray": {
"version": "0.0.1",
"from": "isarray@0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
},
"string_decoder": {
"version": "0.10.31",
"from": "string_decoder@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
}
}
}
}
},
"browserify-zlib": {
"version": "0.1.4",
"from": "browserify-zlib@>=0.1.4 <0.2.0",
"resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz",
"dependencies": {
"pako": {
"version": "0.2.5",
"from": "pako@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/pako/-/pako-0.2.5.tgz"
}
}
}
}
},
"pretty-bytes": {
"version": "1.0.2",
"from": "pretty-bytes@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-1.0.2.tgz",
"dependencies": {
"get-stdin": {
"version": "1.0.0",
"from": "get-stdin@1.0.0",
"resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-1.0.0.tgz"
}
}
}
}
},
"uri-path": {
"version": "0.0.2",
"from": "uri-path@0.0.2",
"resolved": "https://registry.npmjs.org/uri-path/-/uri-path-0.0.2.tgz"
}
}
},
"traceur": {
"version": "0.0.74",
"from": "traceur@0.0.74",
"resolved": "https://registry.npmjs.org/traceur/-/traceur-0.0.74.tgz",
"dependencies": {
"commander": {
"version": "2.5.0",
"from": "commander@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.5.0.tgz"
},
"glob": {
"version": "4.3.1",
"from": "glob@>=4.0.0 <5.0.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-4.3.1.tgz",
"dependencies": {
"inflight": {
"version": "1.0.4",
"from": "inflight@>=1.0.4 <2.0.0",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz",
"dependencies": {
"wrappy": {
"version": "1.0.1",
"from": "wrappy@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz"
}
}
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
},
"minimatch": {
"version": "2.0.1",
"from": "minimatch@>=2.0.1 <3.0.0",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.1.tgz",
"dependencies": {
"brace-expansion": {
"version": "1.0.1",
"from": "brace-expansion@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.0.1.tgz",
"dependencies": {
"balanced-match": {
"version": "0.2.0",
"from": "balanced-match@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.2.0.tgz"
},
"concat-map": {
"version": "0.0.0",
"from": "concat-map@0.0.0",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.0.tgz"
}
}
}
}
},
"once": {
"version": "1.3.1",
"from": "once@>=1.3.0 <2.0.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.3.1.tgz",
"dependencies": {
"wrappy": {
"version": "1.0.1",
"from": "wrappy@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz"
}
}
}
}
},
"regexpu": {
"version": "0.3.0",
"from": "regexpu@0.3.0",
"resolved": "https://registry.npmjs.org/regexpu/-/regexpu-0.3.0.tgz",
"dependencies": {
"recast": {
"version": "0.8.8",
"from": "recast@>=0.8.0 <0.9.0",
"resolved": "https://registry.npmjs.org/recast/-/recast-0.8.8.tgz",
"dependencies": {
"esprima-fb": {
"version": "7001.1.0-dev-harmony-fb",
"from": "esprima-fb@>=7001.1.0-dev-harmony-fb <7001.2.0",
"resolved": "https://registry.npmjs.org/esprima-fb/-/esprima-fb-7001.1.0-dev-harmony-fb.tgz"
},
"source-map": {
"version": "0.1.32",
"from": "source-map@0.1.32",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.32.tgz",
"dependencies": {
"amdefine": {
"version": "0.1.0",
"from": "amdefine@>=0.0.4",
"resolved": "https://registry.npmjs.org/amdefine/-/amdefine-0.1.0.tgz"
}
}
},
"private": {
"version": "0.1.6",
"from": "private@>=0.1.5 <0.2.0",
"resolved": "https://registry.npmjs.org/private/-/private-0.1.6.tgz"
},
"cls": {
"version": "0.1.5",
"from": "cls@>=0.1.3 <0.2.0",
"resolved": "https://registry.npmjs.org/cls/-/cls-0.1.5.tgz"
},
"depd": {
"version": "1.0.0",
"from": "depd@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/depd/-/depd-1.0.0.tgz"
},
"ast-types": {
"version": "0.5.7",
"from": "ast-types@>=0.5.7 <0.6.0",
"resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.5.7.tgz"
}
}
},
"regenerate": {
"version": "1.0.1",
"from": "regenerate@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.0.1.tgz"
},
"regjsgen": {
"version": "0.2.0",
"from": "regjsgen@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz"
},
"regjsparser": {
"version": "0.1.3",
"from": "regjsparser@>=0.1.2 <0.2.0",
"resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.3.tgz",
"dependencies": {
"jsesc": {
"version": "0.5.0",
"from": "jsesc@>=0.5.0 <0.6.0",
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz"
}
}
}
}
},
"rsvp": {
"version": "3.0.14",
"from": "rsvp@>=3.0.13 <4.0.0",
"resolved": "https://registry.npmjs.org/rsvp/-/rsvp-3.0.14.tgz"
},
"semver": {
"version": "2.3.2",
"from": "semver@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-2.3.2.tgz"
},
"source-map-support": {
"version": "0.2.8",
"from": "source-map-support@>=0.2.8 <0.3.0",
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.2.8.tgz",
"dependencies": {
"source-map": {
"version": "0.1.32",
"from": "source-map@0.1.32",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.32.tgz",
"dependencies": {
"amdefine": {
"version": "0.1.0",
"from": "amdefine@>=0.0.4",
"resolved": "https://registry.npmjs.org/amdefine/-/amdefine-0.1.0.tgz"
}
}
}
}
}
}
},
"when": {
"version": "3.6.3",
"from": "when@>=3.4.6 <4.0.0",
"resolved": "https://registry.npmjs.org/when/-/when-3.6.3.tgz"
},
"grunt": {
"version": "0.4.5",
"from": "grunt@>=0.4.0 <0.5.0",
"resolved": "https://registry.npmjs.org/grunt/-/grunt-0.4.5.tgz",
"dependencies": {
"async": {
"version": "0.1.22",
"from": "async@>=0.1.22 <0.2.0",
"resolved": "https://registry.npmjs.org/async/-/async-0.1.22.tgz"
},
"coffee-script": {
"version": "1.3.3",
"from": "coffee-script@>=1.3.3 <1.4.0",
"resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.3.3.tgz"
},
"colors": {
"version": "0.6.2",
"from": "colors@>=0.6.2 <0.7.0",
"resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz"
},
"dateformat": {
"version": "1.0.2-1.2.3",
"from": "dateformat@1.0.2-1.2.3",
"resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.2-1.2.3.tgz"
},
"eventemitter2": {
"version": "0.4.14",
"from": "eventemitter2@>=0.4.13 <0.5.0",
"resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.14.tgz"
},
"findup-sync": {
"version": "0.1.3",
"from": "findup-sync@>=0.1.2 <0.2.0",
"resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.1.3.tgz",
"dependencies": {
"glob": {
"version": "3.2.11",
"from": "glob@>=3.2.9 <3.3.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-3.2.11.tgz",
"dependencies": {
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
},
"minimatch": {
"version": "0.3.0",
"from": "minimatch@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz",
"dependencies": {
"lru-cache": {
"version": "2.5.0",
"from": "lru-cache@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz"
},
"sigmund": {
"version": "1.0.0",
"from": "sigmund@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz"
}
}
}
}
},
"lodash": {
"version": "2.4.1",
"from": "lodash@>=2.4.1 <2.5.0",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.1.tgz"
}
}
},
"glob": {
"version": "3.1.21",
"from": "glob@>=3.1.21 <3.2.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-3.1.21.tgz",
"dependencies": {
"graceful-fs": {
"version": "1.2.3",
"from": "graceful-fs@>=1.2.0 <1.3.0",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz"
},
"inherits": {
"version": "1.0.0",
"from": "inherits@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-1.0.0.tgz"
}
}
},
"hooker": {
"version": "0.2.3",
"from": "hooker@>=0.2.3 <0.3.0",
"resolved": "https://registry.npmjs.org/hooker/-/hooker-0.2.3.tgz"
},
"iconv-lite": {
"version": "0.2.11",
"from": "iconv-lite@>=0.2.11 <0.3.0",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.2.11.tgz"
},
"minimatch": {
"version": "0.2.14",
"from": "minimatch@>=0.2.12 <0.3.0",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz",
"dependencies": {
"lru-cache": {
"version": "2.5.0",
"from": "lru-cache@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz"
},
"sigmund": {
"version": "1.0.0",
"from": "sigmund@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz"
}
}
},
"nopt": {
"version": "1.0.10",
"from": "nopt@>=1.0.10 <1.1.0",
"resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz",
"dependencies": {
"abbrev": {
"version": "1.0.5",
"from": "abbrev@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.5.tgz"
}
}
},
"rimraf": {
"version": "2.2.8",
"from": "rimraf@>=2.2.8 <2.3.0",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz"
},
"lodash": {
"version": "0.9.2",
"from": "lodash@>=0.9.2 <0.10.0",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-0.9.2.tgz"
},
"underscore.string": {
"version": "2.2.1",
"from": "underscore.string@>=2.2.1 <2.3.0",
"resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.2.1.tgz"
},
"which": {
"version": "1.0.8",
"from": "which@>=1.0.5 <1.1.0",
"resolved": "https://registry.npmjs.org/which/-/which-1.0.8.tgz"
},
"js-yaml": {
"version": "2.0.5",
"from": "js-yaml@>=2.0.5 <2.1.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-2.0.5.tgz",
"dependencies": {
"argparse": {
"version": "0.1.16",
"from": "argparse@>=0.1.11 <0.2.0",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-0.1.16.tgz",
"dependencies": {
"underscore": {
"version": "1.7.0",
"from": "underscore@>=1.7.0 <1.8.0",
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz"
},
"underscore.string": {
"version": "2.4.0",
"from": "underscore.string@>=2.4.0 <2.5.0",
"resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.4.0.tgz"
}
}
},
"esprima": {
"version": "1.0.4",
"from": "esprima@>=1.0.2 <1.1.0",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-1.0.4.tgz"
}
}
},
"exit": {
"version": "0.1.2",
"from": "exit@>=0.1.1 <0.2.0",
"resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz"
},
"getobject": {
"version": "0.1.0",
"from": "getobject@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/getobject/-/getobject-0.1.0.tgz"
},
"grunt-legacy-util": {
"version": "0.2.0",
"from": "grunt-legacy-util@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/grunt-legacy-util/-/grunt-legacy-util-0.2.0.tgz"
},
"grunt-legacy-log": {
"version": "0.1.1",
"from": "grunt-legacy-log@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/grunt-legacy-log/-/grunt-legacy-log-0.1.1.tgz",
"dependencies": {
"lodash": {
"version": "2.4.1",
"from": "lodash@>=2.4.1 <2.5.0",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.1.tgz"
},
"underscore.string": {
"version": "2.3.3",
"from": "underscore.string@>=2.3.3 <2.4.0",
"resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.3.3.tgz"
}
}
}
}
}
}
}
}
},
"traceur": {
"version": "0.0.74",
"from": "traceur@0.0.74",
"resolved": "https://registry.npmjs.org/traceur/-/traceur-0.0.74.tgz",
"dependencies": {
"commander": {
"version": "2.5.0",
"from": "commander@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.5.0.tgz"
},
"glob": {
"version": "4.3.1",
"from": "glob@>=4.0.0 <5.0.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-4.3.1.tgz",
"dependencies": {
"inflight": {
"version": "1.0.4",
"from": "inflight@>=1.0.4 <2.0.0",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz",
"dependencies": {
"wrappy": {
"version": "1.0.1",
"from": "wrappy@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz"
}
}
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
},
"minimatch": {
"version": "2.0.1",
"from": "minimatch@>=2.0.1 <3.0.0",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.1.tgz",
"dependencies": {
"brace-expansion": {
"version": "1.0.1",
"from": "brace-expansion@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.0.1.tgz",
"dependencies": {
"balanced-match": {
"version": "0.2.0",
"from": "balanced-match@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.2.0.tgz"
},
"concat-map": {
"version": "0.0.0",
"from": "concat-map@0.0.0",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.0.tgz"
}
}
}
}
},
"once": {
"version": "1.3.1",
"from": "once@>=1.3.0 <2.0.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.3.1.tgz",
"dependencies": {
"wrappy": {
"version": "1.0.1",
"from": "wrappy@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz"
}
}
}
}
},
"regexpu": {
"version": "0.3.0",
"from": "regexpu@0.3.0",
"resolved": "https://registry.npmjs.org/regexpu/-/regexpu-0.3.0.tgz",
"dependencies": {
"recast": {
"version": "0.8.8",
"from": "recast@>=0.8.0 <0.9.0",
"resolved": "https://registry.npmjs.org/recast/-/recast-0.8.8.tgz",
"dependencies": {
"esprima-fb": {
"version": "7001.1.0-dev-harmony-fb",
"from": "esprima-fb@>=7001.1.0-dev-harmony-fb <7001.2.0",
"resolved": "https://registry.npmjs.org/esprima-fb/-/esprima-fb-7001.1.0-dev-harmony-fb.tgz"
},
"source-map": {
"version": "0.1.32",
"from": "source-map@0.1.32",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.32.tgz",
"dependencies": {
"amdefine": {
"version": "0.1.0",
"from": "amdefine@>=0.0.4",
"resolved": "https://registry.npmjs.org/amdefine/-/amdefine-0.1.0.tgz"
}
}
},
"private": {
"version": "0.1.6",
"from": "private@>=0.1.5 <0.2.0",
"resolved": "https://registry.npmjs.org/private/-/private-0.1.6.tgz"
},
"cls": {
"version": "0.1.5",
"from": "cls@>=0.1.3 <0.2.0",
"resolved": "https://registry.npmjs.org/cls/-/cls-0.1.5.tgz"
},
"depd": {
"version": "1.0.0",
"from": "depd@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/depd/-/depd-1.0.0.tgz"
},
"ast-types": {
"version": "0.5.7",
"from": "ast-types@>=0.5.7 <0.6.0",
"resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.5.7.tgz"
}
}
},
"regenerate": {
"version": "1.0.1",
"from": "regenerate@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.0.1.tgz"
},
"regjsgen": {
"version": "0.2.0",
"from": "regjsgen@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz"
},
"regjsparser": {
"version": "0.1.3",
"from": "regjsparser@>=0.1.2 <0.2.0",
"resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.3.tgz",
"dependencies": {
"jsesc": {
"version": "0.5.0",
"from": "jsesc@>=0.5.0 <0.6.0",
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz"
}
}
}
}
},
"semver": {
"version": "2.3.2",
"from": "semver@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-2.3.2.tgz"
},
"source-map-support": {
"version": "0.2.8",
"from": "source-map-support@>=0.2.8 <0.3.0",
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.2.8.tgz",
"dependencies": {
"source-map": {
"version": "0.1.32",
"from": "source-map@0.1.32",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.32.tgz",
"dependencies": {
"amdefine": {
"version": "0.1.0",
"from": "amdefine@>=0.0.4",
"resolved": "https://registry.npmjs.org/amdefine/-/amdefine-0.1.0.tgz"
}
}
}
}
}
}
},
"uglify-js": {
"version": "2.4.15",
"from": "uglify-js@>=2.4.15 <3.0.0",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.4.15.tgz",
"dependencies": {
"async": {
"version": "0.2.10",
"from": "async@0.2.10",
"resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz"
},
"source-map": {
"version": "0.1.34",
"from": "source-map@0.1.34",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.34.tgz",
"dependencies": {
"amdefine": {
"version": "0.1.0",
"from": "amdefine@>=0.0.4",
"resolved": "https://registry.npmjs.org/amdefine/-/amdefine-0.1.0.tgz"
}
}
},
"optimist": {
"version": "0.3.7",
"from": "optimist@0.3.7",
"resolved": "https://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz",
"dependencies": {
"wordwrap": {
"version": "0.0.2",
"from": "wordwrap@>=0.0.1 <0.1.0",
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz"
}
}
},
"uglify-to-browserify": {
"version": "1.0.2",
"from": "uglify-to-browserify@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz"
}
}
}
}
},
"traceur": {
"version": "0.0.74",
"from": "traceur@0.0.74",
"resolved": "https://registry.npmjs.org/traceur/-/traceur-0.0.74.tgz",
"dependencies": {
"commander": {
"version": "2.5.0",
"from": "commander@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.5.0.tgz"
},
"regexpu": {
"version": "0.3.0",
"from": "regexpu@0.3.0",
"resolved": "https://registry.npmjs.org/regexpu/-/regexpu-0.3.0.tgz",
"dependencies": {
"recast": {
"version": "0.8.8",
"from": "recast@>=0.8.0 <0.9.0",
"resolved": "https://registry.npmjs.org/recast/-/recast-0.8.8.tgz",
"dependencies": {
"esprima-fb": {
"version": "7001.1.0-dev-harmony-fb",
"from": "esprima-fb@>=7001.1.0-dev-harmony-fb <7001.2.0",
"resolved": "https://registry.npmjs.org/esprima-fb/-/esprima-fb-7001.1.0-dev-harmony-fb.tgz"
},
"source-map": {
"version": "0.1.32",
"from": "source-map@0.1.32",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.32.tgz",
"dependencies": {
"amdefine": {
"version": "0.1.0",
"from": "amdefine@>=0.0.4",
"resolved": "https://registry.npmjs.org/amdefine/-/amdefine-0.1.0.tgz"
}
}
},
"private": {
"version": "0.1.6",
"from": "private@>=0.1.5 <0.2.0",
"resolved": "https://registry.npmjs.org/private/-/private-0.1.6.tgz"
},
"cls": {
"version": "0.1.5",
"from": "cls@>=0.1.3 <0.2.0",
"resolved": "https://registry.npmjs.org/cls/-/cls-0.1.5.tgz"
},
"depd": {
"version": "1.0.0",
"from": "depd@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/depd/-/depd-1.0.0.tgz"
},
"ast-types": {
"version": "0.5.7",
"from": "ast-types@>=0.5.7 <0.6.0",
"resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.5.7.tgz"
}
}
},
"regenerate": {
"version": "1.0.1",
"from": "regenerate@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.0.1.tgz"
},
"regjsgen": {
"version": "0.2.0",
"from": "regjsgen@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz"
},
"regjsparser": {
"version": "0.1.3",
"from": "regjsparser@>=0.1.2 <0.2.0",
"resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.3.tgz",
"dependencies": {
"jsesc": {
"version": "0.5.0",
"from": "jsesc@>=0.5.0 <0.6.0",
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz"
}
}
}
}
},
"rsvp": {
"version": "3.0.14",
"from": "rsvp@>=3.0.13 <4.0.0",
"resolved": "https://registry.npmjs.org/rsvp/-/rsvp-3.0.14.tgz"
},
"semver": {
"version": "2.3.2",
"from": "semver@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-2.3.2.tgz"
},
"source-map-support": {
"version": "0.2.8",
"from": "source-map-support@>=0.2.8 <0.3.0",
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.2.8.tgz",
"dependencies": {
"source-map": {
"version": "0.1.32",
"from": "source-map@0.1.32",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.32.tgz",
"dependencies": {
"amdefine": {
"version": "0.1.0",
"from": "amdefine@>=0.0.4",
"resolved": "https://registry.npmjs.org/amdefine/-/amdefine-0.1.0.tgz"
}
}
}
}
}
}
},
"write-file-stdout": {
"version": "0.0.2",
"from": "write-file-stdout@0.0.2",
"resolved": "https://registry.npmjs.org/write-file-stdout/-/write-file-stdout-0.0.2.tgz"
}
}
}
================================================
FILE: package.json
================================================
{
"name": "es6-angular",
"author": "GoCardless",
"version": "0.0.1-pre",
"description": "ES6 + AngularJS",
"scripts": {
"postinstall": "./node_modules/.bin/webdriver-manager update",
"test": "./script/test",
"start": "ulimit -n 10240 && ./script/start"
},
"repository": {
"type": "git",
"url": "git://github.com/gocardless/es6-angularjs.git"
},
"dependencies": {
"assetgraph": "^1.12.1",
"assetgraph-builder": "^2.5.1",
"autoprefixer": "^4.0.0",
"autoprefixer-core": "^4.0.1",
"bower": "^1.3.12",
"connect": "^3.3.0",
"fb-flo": "^0.3.0",
"glob": "^4.0.6",
"graceful-fs": "^3.0.5",
"jasmine-core": "^2.1.2",
"jshint": "^2.5.6",
"karma": "^0.12.24",
"karma-chrome-launcher": "^0.1.5",
"karma-cli": "^0.0.4",
"karma-firefox-launcher": "^0.1.3",
"karma-jasmine": "^0.3.1",
"karma-safari-launcher": "^0.1.1",
"karma-sauce-launcher": "^0.2.10",
"karma-traceur-preprocessor": "^0.4.0",
"lodash": "^2.4.1",
"mime": "^1.2.11",
"minimist": "^1.1.0",
"mkdirp": "^0.5.0",
"morgan": "^1.4.0",
"opn": "^1.0.0",
"protractor": "^1.3.1",
"read-file-stdin": "^0.2.0",
"rework": "^1.0.1",
"rework-import": "^2.0.0",
"rework-vars": "^3.1.1",
"send": "^0.10.0",
"serve-static": "^1.7.0",
"systemjs-assetgraph": "^0.1.0",
"systemjs-builder": "^0.4.5",
"traceur": "^0.0.74",
"write-file-stdout": "0.0.2"
}
}
================================================
FILE: script/build
================================================
#!/bin/bash
# Usage: script/build
# Runs the projects's build.
trap "exit 1" TERM
if [[ -z "$DIST" ]]; then
echo "Missing DIST"
kill -s TERM $$
fi
# Add trailing slash and prepend ./
DIST=$(echo "./$DIST" | sed "s/\/$//")"/"
# Make sure DIST exists
mkdir -p $DIST
# Clean
rm -r $DIST
# Copy
cp -a ./client/. $DIST
# Build
./script/css
./script/precompile
# Increas the max number of file descriptiors
ulimit -n 4096
script/lib/build-production.js --root ./client --outroot $DIST *.html
rm -r $DIST/app $DIST/app-compiled $DIST/components $DIST/assets/stylesheets $DIST/*.js $DIST/*.css
================================================
FILE: script/css
================================================
#!/bin/bash
# Usage: script/css
# Runs the projects's citest suite.
set -e errexit
./script/lib/css.js client/assets/stylesheets/main.css client/main.css
================================================
FILE: script/e2etest
================================================
#!/bin/bash
# Usage: script/e2etest
# Runs the projects integration tests.
set -e errexit
HTTP_PORT=9393
DIST=./e2e-dist/ ./script/build
./script/lib/server.js --port=$HTTP_PORT --root ./e2e-dist &
E2E_TEST_PID=$!
trap "kill $E2E_TEST_PID" INT TERM EXIT
HTTP_PORT=$HTTP_PORT ./node_modules/.bin/protractor
================================================
FILE: script/ensure-no-ddescribe
================================================
#!/bin/bash
DDESCRIBE_LINES=`grep 'ddescribe\|iit\|browser.pause\(\)' -l --include \*.js -r client/app`
DDESCRIBE_COUNT=`echo $DDESCRIBE_LINES | awk 'NF > 0' | wc -l | awk '{ print $1}'`
ZERO="0"
if [ "$DDESCRIBE_COUNT" != "$ZERO" ];
then
echo "WARNING: found ddescribe, iit or browser.pause(), exiting 1:"
echo $DDESCRIBE_LINES
exit 1
else
exit 0
fi
================================================
FILE: script/lib/build-production.js
================================================
#!/usr/bin/env node
'use strict';
var AssetGraph = require('assetgraph-builder');
var systemJsAssetGraph = require('systemjs-assetgraph');
var argv = require('minimist')(process.argv.slice(2));
var config = {
root: argv.root,
outRoot: argv.outroot,
loadAssets: (argv._[0] ? argv._ : ['*.html', 'favicon.ico']),
optimizeImages: false,
inlineSize: 4096,
sharedBundles: false,
manifest: false,
version: undefined,
noCompress: false,
stripDebug: false,
browsers: ['> 1%', 'last 2 versions', 'Firefox ESR']
};
if (!config.root || !config.outRoot) {
throw new Error('--root and --outroot need to set');
}
new AssetGraph({ root: config.root })
.logEvents({
repl: undefined,
stopOnWarning: false,
suppressJavaScriptCommonJsRequireWarnings: true
})
.registerRequireJsConfig({
preventPopulationOfJavaScriptAssetsUntilConfigHasBeenFound: true
})
.loadAssets(config.loadAssets)
.queue(systemJsAssetGraph({
outRoot: config.outRoot,
// comment out the below to use injection instead of bundling
// override use of app-compiled to ensure source maps
configOverride: {
map: {
app: 'app'
}
},
bundle: true
}))
.buildProduction({
version: config.version,
optimizeImages: config.optimizeImages,
inlineSize: config.inlineSize,
browsers: config.browsers,
manifest: config.manifest,
sharedBundles: config.sharedBundles,
noCompress: config.noCompress,
stripDebug: config.stripDebug
})
.writeAssetsToDisc({ url: /^file:/, isLoaded: true }, config.outRoot)
.writeStatsToStderr()
.run();
================================================
FILE: script/lib/css.js
================================================
#!/usr/bin/env node
var path = require('path');
var rework = require('rework');
var reworkImport = require('rework-import');
var reworkVars = require('rework-vars');
var argv = require('minimist')(process.argv.slice(2));
var read = require('read-file-stdin');
var write = require('write-file-stdout');
var autoprefixer = require('autoprefixer-core')();
var options = {
input: path.resolve(argv._[0]),
output: path.resolve(argv._[1])
};
read(options.input, function(err, buffer){
if (err) {
console.error(err);
console.error(err.stack);
}
var css = buffer.toString();
try {
css = rework(css, { source: options.input })
.use(reworkImport())
.use(reworkVars())
.toString();
css = autoprefixer.process(css);
} catch (err) {
console.error(err);
console.error(err.stack);
console.error(css);
}
write(options.output, css);
});
================================================
FILE: script/lib/precompile.js
================================================
'use strict';
// # Precompile
// Builds ES6 into System.register
//
// Use:
// precompile(inFile, outFile);
var traceur = require('traceur');
var path = require('path');
var fs = require('graceful-fs');
var traceurConfig;
function loadConfig() {
traceurConfig = require('../../config/traceur.config.js');
traceurConfig.modules = 'instantiate';
traceurConfig.script = false;
traceurConfig.sourceMaps = 'memory';
}
function precompile(inFile, outFile, basePath, callback) {
if (!traceurConfig) {
loadConfig();
}
traceurConfig.moduleName = null;
var compiler = new traceur.Compiler(traceurConfig);
var sourceMapFile = outFile.replace(/\.js$/, '.map');
fs.readFile(path.resolve(basePath, inFile), function(err, inSource) {
if (err)
return callback(err);
var source, sourceMap;
try {
source = compiler.compile(inSource.toString(), '/' + inFile, path.basename(outFile));
sourceMap = compiler.getSourceMap();
}
catch(e) {
return callback(e);
}
fs.writeFile(path.resolve(basePath, outFile), source, function(err) {
if (err)
return callback(err);
fs.writeFile(path.resolve(basePath, sourceMapFile), sourceMap, callback);
});
});
}
exports.precompile = precompile;
================================================
FILE: script/lib/server.js
================================================
#!/usr/bin/env node
'use strict';
var http = require('http');
var url = require('url');
var connect = require('connect');
var serveStatic = require('serve-static');
var morgan = require('morgan');
var argv = require('minimist')(process.argv.slice(2));
var send = require('send');
var _ = require('lodash');
var options = {
port: argv.p || argv.port,
root: argv.r || argv.root || _.flatten([argv._])[0],
open: argv.open || false,
verbose: argv.v || argv.verbose || false,
index: argv.index || 'index.html',
};
var server = connect()
.use(function serveOverrideIndex(req, res, next) {
if (options.index !== 'index.html' &&
url.parse(req.url).pathname.match(/^(\/|\/index.html)$/)) {
send(req, '/' + options.index, { root: options.root })
.pipe(res);
} else {
next();
}
})
.use(serveStatic(options.root))
.use(function serveIndex(req, res, next) {
if (req.method !== 'GET' || !req.headers.accept.match('text/html')) {
return next();
}
send(req, '/' + options.index, { root: options.root })
.pipe(res);
});
if (options.verbose) {
server.use(morgan('tiny'));
}
http.createServer(server)
.listen(options.port)
.once('error', function (err) {
if (err.code === 'EADDRINUSE') {
console.log('Port in use: %s', options.port);
} else {
console.error(err);
}
})
.on('listening', function () {
console.log('Started web server on http://localhost:' + options.port);
if (options.open) {
require('opn')('http://localhost:' + options.port);
}
});
================================================
FILE: script/lib/watch.js
================================================
#!/usr/bin/env node
'use strict';
var fs = require('fs');
var path = require('path');
var exec = require('child_process').exec;
var argv = require('minimist')(process.argv.slice(2));
var flo = require('fb-flo');
var _ = require('lodash');
var precompile = require('./precompile');
var options = {
verbose: argv.v || argv.verbose || false,
root: argv.r || argv.root || _.flatten([argv._])[0],
glob: _.flatten([argv.g || argv.glob || '**/*']),
host: argv.h || argv.host || 'localhost',
port: argv.p || argv.port || 8888
};
function isIgnorePath(filepath) {
return filepath === 'main.css' || path.dirname(filepath).match(/^(app-compiled)(\/|$)/);
}
function rootPath(filepath) {
return path.join(options.root, filepath);
}
function handleCompile(filepath, callback) {
var ext = path.extname(filepath);
var inUncompiled = path.dirname(filepath).match(/^(app)(\/|$)/);
var compiledFile;
if (ext === '.css') {
exec('./script/css', function (err) {
if (err) {
return callback(err);
}
callback(null, 'main.css', false);
});
} else if (ext === '.js' && inUncompiled) {
try {
compiledFile = filepath.replace(/^(app)/g, '$1-compiled');
precompile.precompile(filepath, compiledFile, options.root, function(err) {
callback(err, compiledFile, true);
});
}
catch(e) {
callback(e && e[0] || e);
}
} else if (inUncompiled) {
// copy any non-js accross
compiledFile = filepath.replace(/^(app)/g, '$1-compiled');
fs.writeFileSync(rootPath(compiledFile), fs.readFileSync(rootPath(filepath)));
callback(null, compiledFile, true);
} else {
callback(null, filepath, true);
}
}
var server = flo(options.root, {
port: options.port,
host: options.host,
verbose: options.verbose,
glob: options.glob
}, function resolver(filepath, callback) {
// Minimal debugging
if (!options.verbose) {
console.log('File changed: %s', filepath);
}
if (isIgnorePath(filepath)) {
return;
}
handleCompile(filepath, function(err, compiledFile, reload) {
if (err) {
console.error('Failed to load %s', filepath);
console.error(err);
return;
}
callback({
resourceURL: compiledFile,
contents: fs.readFileSync(rootPath(compiledFile)).toString(),
reload: reload
});
});
});
server.once('ready', function() {
console.log(options);
console.log('Watching files!');
});
================================================
FILE: script/precompile
================================================
#!/usr/bin/env node
// Usage: script/precompile
// Precompiles client/app to client/app-compiled and
'use strict';
var glob = require('glob');
var precompile = require('./lib/precompile');
var mkdirp = require('mkdirp');
var path = require('path');
var fs = require('graceful-fs');
var failed = false;
function preCompile(inDir, outDir, baseDir) {
glob(path.resolve(baseDir, inDir) + '/**/*', function(err, files) {
if (err) throw err;
files.forEach(function(file) {
var relFile = path.relative(baseDir, file);
var outFile = outDir + '/' + relFile.substr(inDir.length);
mkdirp(path.resolve(baseDir, path.dirname(outFile)), function(err) {
if (err) throw err;
if (failed) {
return;
}
if (relFile.match(/^(app)\/.+\.js$/)) {
precompile.precompile(relFile, outFile, baseDir, function(err) {
if (err)
throw err;
});
} else {
fs.readFile(file, function(err, source) {
if (err) {
if (err.code != 'EISDIR')
throw err;
} else {
fs.writeFile(path.resolve(baseDir, outFile), source, function(err) {
if (err)
throw err;
});
}
});
}
});
});
});
}
preCompile('app', 'app-compiled', 'client');
================================================
FILE: script/setup
================================================
#!/bin/bash
# Usage: script/setup
# Installs project dependencies.
trap "exit 1" TERM
if [ ! command -v brew >/dev/null 2>&1 ]; then
echo "Install homebrew: ruby -e \"$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)\""
kill -s TERM $$
else
echo "Install required brew packages for assetgraph:"
echo "--> brew install cairo jpeg giflib optipng pngcrush pngquant pango graphicsmagick jpeg-turbo inkscape"
fi
if [ command -v node >/dev/null 2>&1 ]; then
echo "Install node: brew install node"
kill -s TERM $$
fi
npm install
./node_modules/.bin/webdriver-manager update
================================================
FILE: script/start
================================================
#!/bin/bash
# Usage: script/start
# Starts the projects's development server.
set -e errexit
./script/precompile
./script/css
node ./script/lib/watch.js --root ./client &
node ./script/lib/server.js --port=3010 --open=true --verbose --root ./client
================================================
FILE: script/test
================================================
#!/bin/bash
# Usage: script/test
# Runs the projects test suite.
set -e errexit
./script/ensure-no-ddescribe
./node_modules/.bin/jshint .
./node_modules/.bin/karma start --single-run
./script/e2etest