traceur-rails 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +20 -0
- data/Rakefile +12 -0
- data/lib/traceur-rails.rb +5 -0
- data/lib/traceur/config.rb +38 -0
- data/lib/traceur/sprockets.rb +4 -0
- data/lib/traceur/support/runner.js +21 -0
- data/lib/traceur/support/traceur/README.md +40 -0
- data/lib/traceur/support/traceur/bin/traceur-runtime.js +2039 -0
- data/lib/traceur/support/traceur/bin/traceur.js +23037 -0
- data/lib/traceur/support/traceur/package.json +60 -0
- data/lib/traceur/support/traceur/src/node/System.js +38 -0
- data/lib/traceur/support/traceur/src/node/api.js +124 -0
- data/lib/traceur/support/traceur/src/node/command.js +213 -0
- data/lib/traceur/support/traceur/src/node/compile-single-file.js +69 -0
- data/lib/traceur/support/traceur/src/node/compiler.js +113 -0
- data/lib/traceur/support/traceur/src/node/deferred.js +110 -0
- data/lib/traceur/support/traceur/src/node/file-util.js +73 -0
- data/lib/traceur/support/traceur/src/node/getopt.js +147 -0
- data/lib/traceur/support/traceur/src/node/inline-module.js +150 -0
- data/lib/traceur/support/traceur/src/node/interpreter.js +33 -0
- data/lib/traceur/support/traceur/src/node/nodeLoader.js +41 -0
- data/lib/traceur/support/traceur/src/node/require.js +85 -0
- data/lib/traceur/support/traceur/src/node/to-amd-compiler.js +33 -0
- data/lib/traceur/support/traceur/src/node/to-commonjs-compiler.js +33 -0
- data/lib/traceur/support/traceur/src/node/traceur.js +32 -0
- data/lib/traceur/support/traceur/traceur +3 -0
- data/lib/traceur/template.rb +61 -0
- data/lib/traceur/tilt.rb +4 -0
- data/lib/traceur/version.rb +3 -0
- data/test/template_test.rb +45 -0
- data/test/test_helper.rb +13 -0
- data/traceur-rails.gemspec +26 -0
- metadata +151 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 89d0cda983ca80da5274d724bffcfdc479cb9832
|
4
|
+
data.tar.gz: bcdbf7ecedc0432c6f46b073cd427f9dcc100a41
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 105ede05f4b941fb2786c8eb1150b3ec02f1cd8ea0e567a1e7ad4beccd16a7e3593048ffea514fc4c8198dd34bc303929184723dfcd086c7500dce2024b1795e
|
7
|
+
data.tar.gz: 216e4e09ce235da7716e8fc54bf91fdb5d6fd72d9f4a0d4dea8e00be77fbf23915795f5ac3e4b0276d1ed6c8f07dd91bfbdff3a51925ae2a2bcaa3830c434f0e
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Aaron Ackerman
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# traceur-rails
|
2
|
+
|
3
|
+
```bash
|
4
|
+
gem install traceur-rails
|
5
|
+
```
|
6
|
+
|
7
|
+
## Requirements
|
8
|
+
|
9
|
+
Requires `node` to be installed.
|
10
|
+
|
11
|
+
## Usage
|
12
|
+
|
13
|
+
Despite being named `traceur-rails` this gem can be used with any project that uses `sprockets`. Use `.tc` as the extension for any file that would normally use a `.js` extension and the file will be compiled with `traceur`.
|
14
|
+
|
15
|
+
## Author
|
16
|
+
|
17
|
+
| [](http://twitter.com/_aaronackerman_ "Follow @_aaronackerman_ on Twitter") |
|
18
|
+
|---|
|
19
|
+
| [Aaron Ackerman](https://twitter.com/_aaronackerman_) |
|
20
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
module Traceur
|
2
|
+
module Config
|
3
|
+
class << self
|
4
|
+
def compile_to
|
5
|
+
@compile_to || :amd
|
6
|
+
end
|
7
|
+
|
8
|
+
def compile_to=(target)
|
9
|
+
@compile_to = target
|
10
|
+
end
|
11
|
+
|
12
|
+
def prefix_patterns
|
13
|
+
@prefix_patterns ||= []
|
14
|
+
end
|
15
|
+
|
16
|
+
def add_prefix_pattern(pattern, prefix)
|
17
|
+
prefix_patterns << [pattern, prefix]
|
18
|
+
end
|
19
|
+
|
20
|
+
def lookup_prefix(path)
|
21
|
+
_, prefix = prefix_patterns.detect {|pattern, prefix| pattern =~ path }
|
22
|
+
prefix
|
23
|
+
end
|
24
|
+
|
25
|
+
def transform=(transform)
|
26
|
+
@transform = transform
|
27
|
+
end
|
28
|
+
|
29
|
+
def transform
|
30
|
+
@transform
|
31
|
+
end
|
32
|
+
|
33
|
+
def compiler_options
|
34
|
+
@compiler_options ||= {}
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
(function(program, execJS) { execJS(program) })(function(module, exports, console) {
|
2
|
+
#{source}
|
3
|
+
}, function(program) {
|
4
|
+
var output, print = function(string) {
|
5
|
+
process.stdout.write('' + string);
|
6
|
+
};
|
7
|
+
try {
|
8
|
+
result = program();
|
9
|
+
if (typeof result == 'undefined' && result !== null) {
|
10
|
+
print('["ok"]');
|
11
|
+
} else {
|
12
|
+
try {
|
13
|
+
print(JSON.stringify(['ok', result]));
|
14
|
+
} catch (err) {
|
15
|
+
print('["err"]');
|
16
|
+
}
|
17
|
+
}
|
18
|
+
} catch (err) {
|
19
|
+
print(JSON.stringify(['err', '' + err]));
|
20
|
+
}
|
21
|
+
});
|
@@ -0,0 +1,40 @@
|
|
1
|
+
[](https://travis-ci.org/google/traceur-compiler)
|
2
|
+
|
3
|
+
<img src="https://raw.github.com/google/traceur-compiler/master/logo/tc.png" alt="Traceur logo" width="200px">
|
4
|
+
## What is Traceur?
|
5
|
+
|
6
|
+
Traceur is a JavaScript.next-to-JavaScript-of-today compiler that allows you to
|
7
|
+
use features from the future **today**. Traceur's goal is to inform the design
|
8
|
+
of new JavaScript features which are only valuable if they allow you to write
|
9
|
+
better code. Traceur allows you to try out new and proposed
|
10
|
+
[language features](https://github.com/google/traceur-compiler/wiki/LanguageFeatures)
|
11
|
+
today, helping you say what you mean in your code while informing the standards process.
|
12
|
+
|
13
|
+
JavaScript's evolution needs your input.
|
14
|
+
[Try](https://github.com/google/traceur-compiler/wiki/GettingStarted) out the
|
15
|
+
new language features.
|
16
|
+
[Tell us](http://groups.google.com/group/traceur-compiler-discuss)
|
17
|
+
how they work for you and what's still causing you to use more boilerplate and
|
18
|
+
"design patterns" than you prefer.
|
19
|
+
|
20
|
+
## What now? What can Traceur do for me?
|
21
|
+
|
22
|
+
Read the
|
23
|
+
[Getting Started](https://github.com/google/traceur-compiler/wiki/GettingStarted)
|
24
|
+
page to get up and running. You can use some language features right now and
|
25
|
+
even try it out in your browser
|
26
|
+
[here](http://google.github.io/traceur-compiler/demo/repl.html).
|
27
|
+
Just type in some code and see what Traceur produces. For an idea of what is
|
28
|
+
available and what we have in the pipeline, see the
|
29
|
+
[Language Features](https://github.com/google/traceur-compiler/wiki/LanguageFeatures)
|
30
|
+
page.
|
31
|
+
|
32
|
+
The JSConf 2011 presentation of Traceur describes the goals of the project and
|
33
|
+
what it can do today. Some documentation is on the wiki on this site.
|
34
|
+
Extra demos are in the source repository.
|
35
|
+
|
36
|
+
We also presented Traceur at NodeConf 2011. The video is
|
37
|
+
available on [YouTube](http://www.youtube.com/watch?feature=player_detailpage&v=ntDZa7ekFEA).
|
38
|
+
|
39
|
+
Questions, suggestions, and comments can be directed to the
|
40
|
+
[discussion group](http://groups.google.com/group/traceur-compiler-discuss).
|
@@ -0,0 +1,2039 @@
|
|
1
|
+
(function(global) {
|
2
|
+
'use strict';
|
3
|
+
if (global.$traceurRuntime) {
|
4
|
+
return;
|
5
|
+
}
|
6
|
+
var $Object = Object;
|
7
|
+
var $TypeError = TypeError;
|
8
|
+
var $create = $Object.create;
|
9
|
+
var $defineProperties = $Object.defineProperties;
|
10
|
+
var $defineProperty = $Object.defineProperty;
|
11
|
+
var $freeze = $Object.freeze;
|
12
|
+
var $getOwnPropertyDescriptor = $Object.getOwnPropertyDescriptor;
|
13
|
+
var $getOwnPropertyNames = $Object.getOwnPropertyNames;
|
14
|
+
var $keys = $Object.keys;
|
15
|
+
var $hasOwnProperty = $Object.prototype.hasOwnProperty;
|
16
|
+
var $toString = $Object.prototype.toString;
|
17
|
+
var $preventExtensions = Object.preventExtensions;
|
18
|
+
var $seal = Object.seal;
|
19
|
+
var $isExtensible = Object.isExtensible;
|
20
|
+
function nonEnum(value) {
|
21
|
+
return {
|
22
|
+
configurable: true,
|
23
|
+
enumerable: false,
|
24
|
+
value: value,
|
25
|
+
writable: true
|
26
|
+
};
|
27
|
+
}
|
28
|
+
var types = {
|
29
|
+
void: function voidType() {},
|
30
|
+
any: function any() {},
|
31
|
+
string: function string() {},
|
32
|
+
number: function number() {},
|
33
|
+
boolean: function boolean() {}
|
34
|
+
};
|
35
|
+
var method = nonEnum;
|
36
|
+
var counter = 0;
|
37
|
+
function newUniqueString() {
|
38
|
+
return '__$' + Math.floor(Math.random() * 1e9) + '$' + ++counter + '$__';
|
39
|
+
}
|
40
|
+
var symbolInternalProperty = newUniqueString();
|
41
|
+
var symbolDescriptionProperty = newUniqueString();
|
42
|
+
var symbolDataProperty = newUniqueString();
|
43
|
+
var symbolValues = $create(null);
|
44
|
+
var privateNames = $create(null);
|
45
|
+
function createPrivateName() {
|
46
|
+
var s = newUniqueString();
|
47
|
+
privateNames[s] = true;
|
48
|
+
return s;
|
49
|
+
}
|
50
|
+
function isSymbol(symbol) {
|
51
|
+
return typeof symbol === 'object' && symbol instanceof SymbolValue;
|
52
|
+
}
|
53
|
+
function typeOf(v) {
|
54
|
+
if (isSymbol(v))
|
55
|
+
return 'symbol';
|
56
|
+
return typeof v;
|
57
|
+
}
|
58
|
+
function Symbol(description) {
|
59
|
+
var value = new SymbolValue(description);
|
60
|
+
if (!(this instanceof Symbol))
|
61
|
+
return value;
|
62
|
+
throw new TypeError('Symbol cannot be new\'ed');
|
63
|
+
}
|
64
|
+
$defineProperty(Symbol.prototype, 'constructor', nonEnum(Symbol));
|
65
|
+
$defineProperty(Symbol.prototype, 'toString', method(function() {
|
66
|
+
var symbolValue = this[symbolDataProperty];
|
67
|
+
if (!getOption('symbols'))
|
68
|
+
return symbolValue[symbolInternalProperty];
|
69
|
+
if (!symbolValue)
|
70
|
+
throw TypeError('Conversion from symbol to string');
|
71
|
+
var desc = symbolValue[symbolDescriptionProperty];
|
72
|
+
if (desc === undefined)
|
73
|
+
desc = '';
|
74
|
+
return 'Symbol(' + desc + ')';
|
75
|
+
}));
|
76
|
+
$defineProperty(Symbol.prototype, 'valueOf', method(function() {
|
77
|
+
var symbolValue = this[symbolDataProperty];
|
78
|
+
if (!symbolValue)
|
79
|
+
throw TypeError('Conversion from symbol to string');
|
80
|
+
if (!getOption('symbols'))
|
81
|
+
return symbolValue[symbolInternalProperty];
|
82
|
+
return symbolValue;
|
83
|
+
}));
|
84
|
+
function SymbolValue(description) {
|
85
|
+
var key = newUniqueString();
|
86
|
+
$defineProperty(this, symbolDataProperty, {value: this});
|
87
|
+
$defineProperty(this, symbolInternalProperty, {value: key});
|
88
|
+
$defineProperty(this, symbolDescriptionProperty, {value: description});
|
89
|
+
freeze(this);
|
90
|
+
symbolValues[key] = this;
|
91
|
+
}
|
92
|
+
$defineProperty(SymbolValue.prototype, 'constructor', nonEnum(Symbol));
|
93
|
+
$defineProperty(SymbolValue.prototype, 'toString', {
|
94
|
+
value: Symbol.prototype.toString,
|
95
|
+
enumerable: false
|
96
|
+
});
|
97
|
+
$defineProperty(SymbolValue.prototype, 'valueOf', {
|
98
|
+
value: Symbol.prototype.valueOf,
|
99
|
+
enumerable: false
|
100
|
+
});
|
101
|
+
var hashProperty = createPrivateName();
|
102
|
+
var hashPropertyDescriptor = {value: undefined};
|
103
|
+
var hashObjectProperties = {
|
104
|
+
hash: {value: undefined},
|
105
|
+
self: {value: undefined}
|
106
|
+
};
|
107
|
+
var hashCounter = 0;
|
108
|
+
function getOwnHashObject(object) {
|
109
|
+
var hashObject = object[hashProperty];
|
110
|
+
if (hashObject && hashObject.self === object)
|
111
|
+
return hashObject;
|
112
|
+
if ($isExtensible(object)) {
|
113
|
+
hashObjectProperties.hash.value = hashCounter++;
|
114
|
+
hashObjectProperties.self.value = object;
|
115
|
+
hashPropertyDescriptor.value = $create(null, hashObjectProperties);
|
116
|
+
$defineProperty(object, hashProperty, hashPropertyDescriptor);
|
117
|
+
return hashPropertyDescriptor.value;
|
118
|
+
}
|
119
|
+
return undefined;
|
120
|
+
}
|
121
|
+
function freeze(object) {
|
122
|
+
getOwnHashObject(object);
|
123
|
+
return $freeze.apply(this, arguments);
|
124
|
+
}
|
125
|
+
function preventExtensions(object) {
|
126
|
+
getOwnHashObject(object);
|
127
|
+
return $preventExtensions.apply(this, arguments);
|
128
|
+
}
|
129
|
+
function seal(object) {
|
130
|
+
getOwnHashObject(object);
|
131
|
+
return $seal.apply(this, arguments);
|
132
|
+
}
|
133
|
+
Symbol.iterator = Symbol();
|
134
|
+
freeze(SymbolValue.prototype);
|
135
|
+
function toProperty(name) {
|
136
|
+
if (isSymbol(name))
|
137
|
+
return name[symbolInternalProperty];
|
138
|
+
return name;
|
139
|
+
}
|
140
|
+
function getOwnPropertyNames(object) {
|
141
|
+
var rv = [];
|
142
|
+
var names = $getOwnPropertyNames(object);
|
143
|
+
for (var i = 0; i < names.length; i++) {
|
144
|
+
var name = names[i];
|
145
|
+
if (!symbolValues[name] && !privateNames[name])
|
146
|
+
rv.push(name);
|
147
|
+
}
|
148
|
+
return rv;
|
149
|
+
}
|
150
|
+
function getOwnPropertyDescriptor(object, name) {
|
151
|
+
return $getOwnPropertyDescriptor(object, toProperty(name));
|
152
|
+
}
|
153
|
+
function getOwnPropertySymbols(object) {
|
154
|
+
var rv = [];
|
155
|
+
var names = $getOwnPropertyNames(object);
|
156
|
+
for (var i = 0; i < names.length; i++) {
|
157
|
+
var symbol = symbolValues[names[i]];
|
158
|
+
if (symbol)
|
159
|
+
rv.push(symbol);
|
160
|
+
}
|
161
|
+
return rv;
|
162
|
+
}
|
163
|
+
function hasOwnProperty(name) {
|
164
|
+
return $hasOwnProperty.call(this, toProperty(name));
|
165
|
+
}
|
166
|
+
function getOption(name) {
|
167
|
+
return global.traceur && global.traceur.options[name];
|
168
|
+
}
|
169
|
+
function setProperty(object, name, value) {
|
170
|
+
var sym,
|
171
|
+
desc;
|
172
|
+
if (isSymbol(name)) {
|
173
|
+
sym = name;
|
174
|
+
name = name[symbolInternalProperty];
|
175
|
+
}
|
176
|
+
object[name] = value;
|
177
|
+
if (sym && (desc = $getOwnPropertyDescriptor(object, name)))
|
178
|
+
$defineProperty(object, name, {enumerable: false});
|
179
|
+
return value;
|
180
|
+
}
|
181
|
+
function defineProperty(object, name, descriptor) {
|
182
|
+
if (isSymbol(name)) {
|
183
|
+
if (descriptor.enumerable) {
|
184
|
+
descriptor = $create(descriptor, {enumerable: {value: false}});
|
185
|
+
}
|
186
|
+
name = name[symbolInternalProperty];
|
187
|
+
}
|
188
|
+
$defineProperty(object, name, descriptor);
|
189
|
+
return object;
|
190
|
+
}
|
191
|
+
function polyfillObject(Object) {
|
192
|
+
$defineProperty(Object, 'defineProperty', {value: defineProperty});
|
193
|
+
$defineProperty(Object, 'getOwnPropertyNames', {value: getOwnPropertyNames});
|
194
|
+
$defineProperty(Object, 'getOwnPropertyDescriptor', {value: getOwnPropertyDescriptor});
|
195
|
+
$defineProperty(Object.prototype, 'hasOwnProperty', {value: hasOwnProperty});
|
196
|
+
$defineProperty(Object, 'freeze', {value: freeze});
|
197
|
+
$defineProperty(Object, 'preventExtensions', {value: preventExtensions});
|
198
|
+
$defineProperty(Object, 'seal', {value: seal});
|
199
|
+
Object.getOwnPropertySymbols = getOwnPropertySymbols;
|
200
|
+
}
|
201
|
+
function exportStar(object) {
|
202
|
+
for (var i = 1; i < arguments.length; i++) {
|
203
|
+
var names = $getOwnPropertyNames(arguments[i]);
|
204
|
+
for (var j = 0; j < names.length; j++) {
|
205
|
+
var name = names[j];
|
206
|
+
if (privateNames[name])
|
207
|
+
continue;
|
208
|
+
(function(mod, name) {
|
209
|
+
$defineProperty(object, name, {
|
210
|
+
get: function() {
|
211
|
+
return mod[name];
|
212
|
+
},
|
213
|
+
enumerable: true
|
214
|
+
});
|
215
|
+
})(arguments[i], names[j]);
|
216
|
+
}
|
217
|
+
}
|
218
|
+
return object;
|
219
|
+
}
|
220
|
+
function isObject(x) {
|
221
|
+
return x != null && (typeof x === 'object' || typeof x === 'function');
|
222
|
+
}
|
223
|
+
function toObject(x) {
|
224
|
+
if (x == null)
|
225
|
+
throw $TypeError();
|
226
|
+
return $Object(x);
|
227
|
+
}
|
228
|
+
function assertObject(x) {
|
229
|
+
if (!isObject(x))
|
230
|
+
throw $TypeError(x + ' is not an Object');
|
231
|
+
return x;
|
232
|
+
}
|
233
|
+
function setupGlobals(global) {
|
234
|
+
global.Symbol = Symbol;
|
235
|
+
polyfillObject(global.Object);
|
236
|
+
}
|
237
|
+
setupGlobals(global);
|
238
|
+
global.$traceurRuntime = {
|
239
|
+
assertObject: assertObject,
|
240
|
+
createPrivateName: createPrivateName,
|
241
|
+
exportStar: exportStar,
|
242
|
+
getOwnHashObject: getOwnHashObject,
|
243
|
+
privateNames: privateNames,
|
244
|
+
setProperty: setProperty,
|
245
|
+
setupGlobals: setupGlobals,
|
246
|
+
toObject: toObject,
|
247
|
+
isObject: isObject,
|
248
|
+
toProperty: toProperty,
|
249
|
+
type: types,
|
250
|
+
typeof: typeOf,
|
251
|
+
defineProperties: $defineProperties,
|
252
|
+
defineProperty: $defineProperty,
|
253
|
+
getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
|
254
|
+
getOwnPropertyNames: $getOwnPropertyNames,
|
255
|
+
keys: $keys
|
256
|
+
};
|
257
|
+
})(typeof global !== 'undefined' ? global : this);
|
258
|
+
(function() {
|
259
|
+
'use strict';
|
260
|
+
function spread() {
|
261
|
+
var rv = [],
|
262
|
+
j = 0,
|
263
|
+
iterResult;
|
264
|
+
for (var i = 0; i < arguments.length; i++) {
|
265
|
+
var valueToSpread = arguments[i];
|
266
|
+
if (!$traceurRuntime.isObject(valueToSpread)) {
|
267
|
+
throw new TypeError('Cannot spread non-object.');
|
268
|
+
}
|
269
|
+
if (typeof valueToSpread[$traceurRuntime.toProperty(Symbol.iterator)] !== 'function') {
|
270
|
+
throw new TypeError('Cannot spread non-iterable object.');
|
271
|
+
}
|
272
|
+
var iter = valueToSpread[$traceurRuntime.toProperty(Symbol.iterator)]();
|
273
|
+
while (!(iterResult = iter.next()).done) {
|
274
|
+
rv[j++] = iterResult.value;
|
275
|
+
}
|
276
|
+
}
|
277
|
+
return rv;
|
278
|
+
}
|
279
|
+
$traceurRuntime.spread = spread;
|
280
|
+
})();
|
281
|
+
(function() {
|
282
|
+
'use strict';
|
283
|
+
var $Object = Object;
|
284
|
+
var $TypeError = TypeError;
|
285
|
+
var $create = $Object.create;
|
286
|
+
var $defineProperties = $traceurRuntime.defineProperties;
|
287
|
+
var $defineProperty = $traceurRuntime.defineProperty;
|
288
|
+
var $getOwnPropertyDescriptor = $traceurRuntime.getOwnPropertyDescriptor;
|
289
|
+
var $getOwnPropertyNames = $traceurRuntime.getOwnPropertyNames;
|
290
|
+
var $getPrototypeOf = Object.getPrototypeOf;
|
291
|
+
function superDescriptor(homeObject, name) {
|
292
|
+
var proto = $getPrototypeOf(homeObject);
|
293
|
+
do {
|
294
|
+
var result = $getOwnPropertyDescriptor(proto, name);
|
295
|
+
if (result)
|
296
|
+
return result;
|
297
|
+
proto = $getPrototypeOf(proto);
|
298
|
+
} while (proto);
|
299
|
+
return undefined;
|
300
|
+
}
|
301
|
+
function superCall(self, homeObject, name, args) {
|
302
|
+
return superGet(self, homeObject, name).apply(self, args);
|
303
|
+
}
|
304
|
+
function superGet(self, homeObject, name) {
|
305
|
+
var descriptor = superDescriptor(homeObject, name);
|
306
|
+
if (descriptor) {
|
307
|
+
if (!descriptor.get)
|
308
|
+
return descriptor.value;
|
309
|
+
return descriptor.get.call(self);
|
310
|
+
}
|
311
|
+
return undefined;
|
312
|
+
}
|
313
|
+
function superSet(self, homeObject, name, value) {
|
314
|
+
var descriptor = superDescriptor(homeObject, name);
|
315
|
+
if (descriptor && descriptor.set) {
|
316
|
+
descriptor.set.call(self, value);
|
317
|
+
return value;
|
318
|
+
}
|
319
|
+
throw $TypeError("super has no setter '" + name + "'.");
|
320
|
+
}
|
321
|
+
function getDescriptors(object) {
|
322
|
+
var descriptors = {},
|
323
|
+
name,
|
324
|
+
names = $getOwnPropertyNames(object);
|
325
|
+
for (var i = 0; i < names.length; i++) {
|
326
|
+
var name = names[i];
|
327
|
+
descriptors[name] = $getOwnPropertyDescriptor(object, name);
|
328
|
+
}
|
329
|
+
return descriptors;
|
330
|
+
}
|
331
|
+
function createClass(ctor, object, staticObject, superClass) {
|
332
|
+
$defineProperty(object, 'constructor', {
|
333
|
+
value: ctor,
|
334
|
+
configurable: true,
|
335
|
+
enumerable: false,
|
336
|
+
writable: true
|
337
|
+
});
|
338
|
+
if (arguments.length > 3) {
|
339
|
+
if (typeof superClass === 'function')
|
340
|
+
ctor.__proto__ = superClass;
|
341
|
+
ctor.prototype = $create(getProtoParent(superClass), getDescriptors(object));
|
342
|
+
} else {
|
343
|
+
ctor.prototype = object;
|
344
|
+
}
|
345
|
+
$defineProperty(ctor, 'prototype', {
|
346
|
+
configurable: false,
|
347
|
+
writable: false
|
348
|
+
});
|
349
|
+
return $defineProperties(ctor, getDescriptors(staticObject));
|
350
|
+
}
|
351
|
+
function getProtoParent(superClass) {
|
352
|
+
if (typeof superClass === 'function') {
|
353
|
+
var prototype = superClass.prototype;
|
354
|
+
if ($Object(prototype) === prototype || prototype === null)
|
355
|
+
return superClass.prototype;
|
356
|
+
}
|
357
|
+
if (superClass === null)
|
358
|
+
return null;
|
359
|
+
throw new $TypeError();
|
360
|
+
}
|
361
|
+
function defaultSuperCall(self, homeObject, args) {
|
362
|
+
if ($getPrototypeOf(homeObject) !== null)
|
363
|
+
superCall(self, homeObject, 'constructor', args);
|
364
|
+
}
|
365
|
+
$traceurRuntime.createClass = createClass;
|
366
|
+
$traceurRuntime.defaultSuperCall = defaultSuperCall;
|
367
|
+
$traceurRuntime.superCall = superCall;
|
368
|
+
$traceurRuntime.superGet = superGet;
|
369
|
+
$traceurRuntime.superSet = superSet;
|
370
|
+
})();
|
371
|
+
(function() {
|
372
|
+
'use strict';
|
373
|
+
var createPrivateName = $traceurRuntime.createPrivateName;
|
374
|
+
var $defineProperties = $traceurRuntime.defineProperties;
|
375
|
+
var $defineProperty = $traceurRuntime.defineProperty;
|
376
|
+
var $create = Object.create;
|
377
|
+
var $TypeError = TypeError;
|
378
|
+
function nonEnum(value) {
|
379
|
+
return {
|
380
|
+
configurable: true,
|
381
|
+
enumerable: false,
|
382
|
+
value: value,
|
383
|
+
writable: true
|
384
|
+
};
|
385
|
+
}
|
386
|
+
var ST_NEWBORN = 0;
|
387
|
+
var ST_EXECUTING = 1;
|
388
|
+
var ST_SUSPENDED = 2;
|
389
|
+
var ST_CLOSED = 3;
|
390
|
+
var END_STATE = -2;
|
391
|
+
var RETHROW_STATE = -3;
|
392
|
+
function getInternalError(state) {
|
393
|
+
return new Error('Traceur compiler bug: invalid state in state machine: ' + state);
|
394
|
+
}
|
395
|
+
function GeneratorContext() {
|
396
|
+
this.state = 0;
|
397
|
+
this.GState = ST_NEWBORN;
|
398
|
+
this.storedException = undefined;
|
399
|
+
this.finallyFallThrough = undefined;
|
400
|
+
this.sent_ = undefined;
|
401
|
+
this.returnValue = undefined;
|
402
|
+
this.tryStack_ = [];
|
403
|
+
}
|
404
|
+
GeneratorContext.prototype = {
|
405
|
+
pushTry: function(catchState, finallyState) {
|
406
|
+
if (finallyState !== null) {
|
407
|
+
var finallyFallThrough = null;
|
408
|
+
for (var i = this.tryStack_.length - 1; i >= 0; i--) {
|
409
|
+
if (this.tryStack_[i].catch !== undefined) {
|
410
|
+
finallyFallThrough = this.tryStack_[i].catch;
|
411
|
+
break;
|
412
|
+
}
|
413
|
+
}
|
414
|
+
if (finallyFallThrough === null)
|
415
|
+
finallyFallThrough = RETHROW_STATE;
|
416
|
+
this.tryStack_.push({
|
417
|
+
finally: finallyState,
|
418
|
+
finallyFallThrough: finallyFallThrough
|
419
|
+
});
|
420
|
+
}
|
421
|
+
if (catchState !== null) {
|
422
|
+
this.tryStack_.push({catch: catchState});
|
423
|
+
}
|
424
|
+
},
|
425
|
+
popTry: function() {
|
426
|
+
this.tryStack_.pop();
|
427
|
+
},
|
428
|
+
get sent() {
|
429
|
+
this.maybeThrow();
|
430
|
+
return this.sent_;
|
431
|
+
},
|
432
|
+
set sent(v) {
|
433
|
+
this.sent_ = v;
|
434
|
+
},
|
435
|
+
get sentIgnoreThrow() {
|
436
|
+
return this.sent_;
|
437
|
+
},
|
438
|
+
maybeThrow: function() {
|
439
|
+
if (this.action === 'throw') {
|
440
|
+
this.action = 'next';
|
441
|
+
throw this.sent_;
|
442
|
+
}
|
443
|
+
},
|
444
|
+
end: function() {
|
445
|
+
switch (this.state) {
|
446
|
+
case END_STATE:
|
447
|
+
return this;
|
448
|
+
case RETHROW_STATE:
|
449
|
+
throw this.storedException;
|
450
|
+
default:
|
451
|
+
throw getInternalError(this.state);
|
452
|
+
}
|
453
|
+
},
|
454
|
+
handleException: function(ex) {
|
455
|
+
this.GState = ST_CLOSED;
|
456
|
+
this.state = END_STATE;
|
457
|
+
throw ex;
|
458
|
+
}
|
459
|
+
};
|
460
|
+
function nextOrThrow(ctx, moveNext, action, x) {
|
461
|
+
switch (ctx.GState) {
|
462
|
+
case ST_EXECUTING:
|
463
|
+
throw new Error(("\"" + action + "\" on executing generator"));
|
464
|
+
case ST_CLOSED:
|
465
|
+
if (action == 'next') {
|
466
|
+
return {
|
467
|
+
value: undefined,
|
468
|
+
done: true
|
469
|
+
};
|
470
|
+
}
|
471
|
+
throw x;
|
472
|
+
case ST_NEWBORN:
|
473
|
+
if (action === 'throw') {
|
474
|
+
ctx.GState = ST_CLOSED;
|
475
|
+
throw x;
|
476
|
+
}
|
477
|
+
if (x !== undefined)
|
478
|
+
throw $TypeError('Sent value to newborn generator');
|
479
|
+
case ST_SUSPENDED:
|
480
|
+
ctx.GState = ST_EXECUTING;
|
481
|
+
ctx.action = action;
|
482
|
+
ctx.sent = x;
|
483
|
+
var value = moveNext(ctx);
|
484
|
+
var done = value === ctx;
|
485
|
+
if (done)
|
486
|
+
value = ctx.returnValue;
|
487
|
+
ctx.GState = done ? ST_CLOSED : ST_SUSPENDED;
|
488
|
+
return {
|
489
|
+
value: value,
|
490
|
+
done: done
|
491
|
+
};
|
492
|
+
}
|
493
|
+
}
|
494
|
+
var ctxName = createPrivateName();
|
495
|
+
var moveNextName = createPrivateName();
|
496
|
+
function GeneratorFunction() {}
|
497
|
+
function GeneratorFunctionPrototype() {}
|
498
|
+
GeneratorFunction.prototype = GeneratorFunctionPrototype;
|
499
|
+
$defineProperty(GeneratorFunctionPrototype, 'constructor', nonEnum(GeneratorFunction));
|
500
|
+
GeneratorFunctionPrototype.prototype = {
|
501
|
+
constructor: GeneratorFunctionPrototype,
|
502
|
+
next: function(v) {
|
503
|
+
return nextOrThrow(this[ctxName], this[moveNextName], 'next', v);
|
504
|
+
},
|
505
|
+
throw: function(v) {
|
506
|
+
return nextOrThrow(this[ctxName], this[moveNextName], 'throw', v);
|
507
|
+
}
|
508
|
+
};
|
509
|
+
$defineProperties(GeneratorFunctionPrototype.prototype, {
|
510
|
+
constructor: {enumerable: false},
|
511
|
+
next: {enumerable: false},
|
512
|
+
throw: {enumerable: false}
|
513
|
+
});
|
514
|
+
Object.defineProperty(GeneratorFunctionPrototype.prototype, Symbol.iterator, nonEnum(function() {
|
515
|
+
return this;
|
516
|
+
}));
|
517
|
+
function createGeneratorInstance(innerFunction, functionObject, self) {
|
518
|
+
var moveNext = getMoveNext(innerFunction, self);
|
519
|
+
var ctx = new GeneratorContext();
|
520
|
+
var object = $create(functionObject.prototype);
|
521
|
+
object[ctxName] = ctx;
|
522
|
+
object[moveNextName] = moveNext;
|
523
|
+
return object;
|
524
|
+
}
|
525
|
+
function initGeneratorFunction(functionObject) {
|
526
|
+
functionObject.prototype = $create(GeneratorFunctionPrototype.prototype);
|
527
|
+
functionObject.__proto__ = GeneratorFunctionPrototype;
|
528
|
+
return functionObject;
|
529
|
+
}
|
530
|
+
function AsyncFunctionContext() {
|
531
|
+
GeneratorContext.call(this);
|
532
|
+
this.err = undefined;
|
533
|
+
var ctx = this;
|
534
|
+
ctx.result = new Promise(function(resolve, reject) {
|
535
|
+
ctx.resolve = resolve;
|
536
|
+
ctx.reject = reject;
|
537
|
+
});
|
538
|
+
}
|
539
|
+
AsyncFunctionContext.prototype = $create(GeneratorContext.prototype);
|
540
|
+
AsyncFunctionContext.prototype.end = function() {
|
541
|
+
switch (this.state) {
|
542
|
+
case END_STATE:
|
543
|
+
this.resolve(this.returnValue);
|
544
|
+
break;
|
545
|
+
case RETHROW_STATE:
|
546
|
+
this.reject(this.storedException);
|
547
|
+
break;
|
548
|
+
default:
|
549
|
+
this.reject(getInternalError(this.state));
|
550
|
+
}
|
551
|
+
};
|
552
|
+
AsyncFunctionContext.prototype.handleException = function() {
|
553
|
+
this.state = RETHROW_STATE;
|
554
|
+
};
|
555
|
+
function asyncWrap(innerFunction, self) {
|
556
|
+
var moveNext = getMoveNext(innerFunction, self);
|
557
|
+
var ctx = new AsyncFunctionContext();
|
558
|
+
ctx.createCallback = function(newState) {
|
559
|
+
return function(value) {
|
560
|
+
ctx.state = newState;
|
561
|
+
ctx.value = value;
|
562
|
+
moveNext(ctx);
|
563
|
+
};
|
564
|
+
};
|
565
|
+
ctx.errback = function(err) {
|
566
|
+
handleCatch(ctx, err);
|
567
|
+
moveNext(ctx);
|
568
|
+
};
|
569
|
+
moveNext(ctx);
|
570
|
+
return ctx.result;
|
571
|
+
}
|
572
|
+
function getMoveNext(innerFunction, self) {
|
573
|
+
return function(ctx) {
|
574
|
+
while (true) {
|
575
|
+
try {
|
576
|
+
return innerFunction.call(self, ctx);
|
577
|
+
} catch (ex) {
|
578
|
+
handleCatch(ctx, ex);
|
579
|
+
}
|
580
|
+
}
|
581
|
+
};
|
582
|
+
}
|
583
|
+
function handleCatch(ctx, ex) {
|
584
|
+
ctx.storedException = ex;
|
585
|
+
var last = ctx.tryStack_[ctx.tryStack_.length - 1];
|
586
|
+
if (!last) {
|
587
|
+
ctx.handleException(ex);
|
588
|
+
return;
|
589
|
+
}
|
590
|
+
ctx.state = last.catch !== undefined ? last.catch : last.finally;
|
591
|
+
if (last.finallyFallThrough !== undefined)
|
592
|
+
ctx.finallyFallThrough = last.finallyFallThrough;
|
593
|
+
}
|
594
|
+
$traceurRuntime.asyncWrap = asyncWrap;
|
595
|
+
$traceurRuntime.initGeneratorFunction = initGeneratorFunction;
|
596
|
+
$traceurRuntime.createGeneratorInstance = createGeneratorInstance;
|
597
|
+
})();
|
598
|
+
(function() {
|
599
|
+
function buildFromEncodedParts(opt_scheme, opt_userInfo, opt_domain, opt_port, opt_path, opt_queryData, opt_fragment) {
|
600
|
+
var out = [];
|
601
|
+
if (opt_scheme) {
|
602
|
+
out.push(opt_scheme, ':');
|
603
|
+
}
|
604
|
+
if (opt_domain) {
|
605
|
+
out.push('//');
|
606
|
+
if (opt_userInfo) {
|
607
|
+
out.push(opt_userInfo, '@');
|
608
|
+
}
|
609
|
+
out.push(opt_domain);
|
610
|
+
if (opt_port) {
|
611
|
+
out.push(':', opt_port);
|
612
|
+
}
|
613
|
+
}
|
614
|
+
if (opt_path) {
|
615
|
+
out.push(opt_path);
|
616
|
+
}
|
617
|
+
if (opt_queryData) {
|
618
|
+
out.push('?', opt_queryData);
|
619
|
+
}
|
620
|
+
if (opt_fragment) {
|
621
|
+
out.push('#', opt_fragment);
|
622
|
+
}
|
623
|
+
return out.join('');
|
624
|
+
}
|
625
|
+
;
|
626
|
+
var splitRe = new RegExp('^' + '(?:' + '([^:/?#.]+)' + ':)?' + '(?://' + '(?:([^/?#]*)@)?' + '([\\w\\d\\-\\u0100-\\uffff.%]*)' + '(?::([0-9]+))?' + ')?' + '([^?#]+)?' + '(?:\\?([^#]*))?' + '(?:#(.*))?' + '$');
|
627
|
+
var ComponentIndex = {
|
628
|
+
SCHEME: 1,
|
629
|
+
USER_INFO: 2,
|
630
|
+
DOMAIN: 3,
|
631
|
+
PORT: 4,
|
632
|
+
PATH: 5,
|
633
|
+
QUERY_DATA: 6,
|
634
|
+
FRAGMENT: 7
|
635
|
+
};
|
636
|
+
function split(uri) {
|
637
|
+
return (uri.match(splitRe));
|
638
|
+
}
|
639
|
+
function removeDotSegments(path) {
|
640
|
+
if (path === '/')
|
641
|
+
return '/';
|
642
|
+
var leadingSlash = path[0] === '/' ? '/' : '';
|
643
|
+
var trailingSlash = path.slice(-1) === '/' ? '/' : '';
|
644
|
+
var segments = path.split('/');
|
645
|
+
var out = [];
|
646
|
+
var up = 0;
|
647
|
+
for (var pos = 0; pos < segments.length; pos++) {
|
648
|
+
var segment = segments[pos];
|
649
|
+
switch (segment) {
|
650
|
+
case '':
|
651
|
+
case '.':
|
652
|
+
break;
|
653
|
+
case '..':
|
654
|
+
if (out.length)
|
655
|
+
out.pop();
|
656
|
+
else
|
657
|
+
up++;
|
658
|
+
break;
|
659
|
+
default:
|
660
|
+
out.push(segment);
|
661
|
+
}
|
662
|
+
}
|
663
|
+
if (!leadingSlash) {
|
664
|
+
while (up-- > 0) {
|
665
|
+
out.unshift('..');
|
666
|
+
}
|
667
|
+
if (out.length === 0)
|
668
|
+
out.push('.');
|
669
|
+
}
|
670
|
+
return leadingSlash + out.join('/') + trailingSlash;
|
671
|
+
}
|
672
|
+
function joinAndCanonicalizePath(parts) {
|
673
|
+
var path = parts[ComponentIndex.PATH] || '';
|
674
|
+
path = removeDotSegments(path);
|
675
|
+
parts[ComponentIndex.PATH] = path;
|
676
|
+
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]);
|
677
|
+
}
|
678
|
+
function canonicalizeUrl(url) {
|
679
|
+
var parts = split(url);
|
680
|
+
return joinAndCanonicalizePath(parts);
|
681
|
+
}
|
682
|
+
function resolveUrl(base, url) {
|
683
|
+
var parts = split(url);
|
684
|
+
var baseParts = split(base);
|
685
|
+
if (parts[ComponentIndex.SCHEME]) {
|
686
|
+
return joinAndCanonicalizePath(parts);
|
687
|
+
} else {
|
688
|
+
parts[ComponentIndex.SCHEME] = baseParts[ComponentIndex.SCHEME];
|
689
|
+
}
|
690
|
+
for (var i = ComponentIndex.SCHEME; i <= ComponentIndex.PORT; i++) {
|
691
|
+
if (!parts[i]) {
|
692
|
+
parts[i] = baseParts[i];
|
693
|
+
}
|
694
|
+
}
|
695
|
+
if (parts[ComponentIndex.PATH][0] == '/') {
|
696
|
+
return joinAndCanonicalizePath(parts);
|
697
|
+
}
|
698
|
+
var path = baseParts[ComponentIndex.PATH];
|
699
|
+
var index = path.lastIndexOf('/');
|
700
|
+
path = path.slice(0, index + 1) + parts[ComponentIndex.PATH];
|
701
|
+
parts[ComponentIndex.PATH] = path;
|
702
|
+
return joinAndCanonicalizePath(parts);
|
703
|
+
}
|
704
|
+
function isAbsolute(name) {
|
705
|
+
if (!name)
|
706
|
+
return false;
|
707
|
+
if (name[0] === '/')
|
708
|
+
return true;
|
709
|
+
var parts = split(name);
|
710
|
+
if (parts[ComponentIndex.SCHEME])
|
711
|
+
return true;
|
712
|
+
return false;
|
713
|
+
}
|
714
|
+
$traceurRuntime.canonicalizeUrl = canonicalizeUrl;
|
715
|
+
$traceurRuntime.isAbsolute = isAbsolute;
|
716
|
+
$traceurRuntime.removeDotSegments = removeDotSegments;
|
717
|
+
$traceurRuntime.resolveUrl = resolveUrl;
|
718
|
+
})();
|
719
|
+
(function(global) {
|
720
|
+
'use strict';
|
721
|
+
var $__2 = $traceurRuntime.assertObject($traceurRuntime),
|
722
|
+
canonicalizeUrl = $__2.canonicalizeUrl,
|
723
|
+
resolveUrl = $__2.resolveUrl,
|
724
|
+
isAbsolute = $__2.isAbsolute;
|
725
|
+
var moduleInstantiators = Object.create(null);
|
726
|
+
var baseURL;
|
727
|
+
if (global.location && global.location.href)
|
728
|
+
baseURL = resolveUrl(global.location.href, './');
|
729
|
+
else
|
730
|
+
baseURL = '';
|
731
|
+
var UncoatedModuleEntry = function UncoatedModuleEntry(url, uncoatedModule) {
|
732
|
+
this.url = url;
|
733
|
+
this.value_ = uncoatedModule;
|
734
|
+
};
|
735
|
+
($traceurRuntime.createClass)(UncoatedModuleEntry, {}, {});
|
736
|
+
var UncoatedModuleInstantiator = function UncoatedModuleInstantiator(url, func) {
|
737
|
+
$traceurRuntime.superCall(this, $UncoatedModuleInstantiator.prototype, "constructor", [url, null]);
|
738
|
+
this.func = func;
|
739
|
+
};
|
740
|
+
var $UncoatedModuleInstantiator = UncoatedModuleInstantiator;
|
741
|
+
($traceurRuntime.createClass)(UncoatedModuleInstantiator, {getUncoatedModule: function() {
|
742
|
+
if (this.value_)
|
743
|
+
return this.value_;
|
744
|
+
return this.value_ = this.func.call(global);
|
745
|
+
}}, {}, UncoatedModuleEntry);
|
746
|
+
function getUncoatedModuleInstantiator(name) {
|
747
|
+
if (!name)
|
748
|
+
return;
|
749
|
+
var url = ModuleStore.normalize(name);
|
750
|
+
return moduleInstantiators[url];
|
751
|
+
}
|
752
|
+
;
|
753
|
+
var moduleInstances = Object.create(null);
|
754
|
+
var liveModuleSentinel = {};
|
755
|
+
function Module(uncoatedModule) {
|
756
|
+
var isLive = arguments[1];
|
757
|
+
var coatedModule = Object.create(null);
|
758
|
+
Object.getOwnPropertyNames(uncoatedModule).forEach((function(name) {
|
759
|
+
var getter,
|
760
|
+
value;
|
761
|
+
if (isLive === liveModuleSentinel) {
|
762
|
+
var descr = Object.getOwnPropertyDescriptor(uncoatedModule, name);
|
763
|
+
if (descr.get)
|
764
|
+
getter = descr.get;
|
765
|
+
}
|
766
|
+
if (!getter) {
|
767
|
+
value = uncoatedModule[name];
|
768
|
+
getter = function() {
|
769
|
+
return value;
|
770
|
+
};
|
771
|
+
}
|
772
|
+
Object.defineProperty(coatedModule, name, {
|
773
|
+
get: getter,
|
774
|
+
enumerable: true
|
775
|
+
});
|
776
|
+
}));
|
777
|
+
Object.preventExtensions(coatedModule);
|
778
|
+
return coatedModule;
|
779
|
+
}
|
780
|
+
var ModuleStore = {
|
781
|
+
normalize: function(name, refererName, refererAddress) {
|
782
|
+
if (typeof name !== "string")
|
783
|
+
throw new TypeError("module name must be a string, not " + typeof name);
|
784
|
+
if (isAbsolute(name))
|
785
|
+
return canonicalizeUrl(name);
|
786
|
+
if (/[^\.]\/\.\.\//.test(name)) {
|
787
|
+
throw new Error('module name embeds /../: ' + name);
|
788
|
+
}
|
789
|
+
if (name[0] === '.' && refererName)
|
790
|
+
return resolveUrl(refererName, name);
|
791
|
+
return canonicalizeUrl(name);
|
792
|
+
},
|
793
|
+
get: function(normalizedName) {
|
794
|
+
var m = getUncoatedModuleInstantiator(normalizedName);
|
795
|
+
if (!m)
|
796
|
+
return undefined;
|
797
|
+
var moduleInstance = moduleInstances[m.url];
|
798
|
+
if (moduleInstance)
|
799
|
+
return moduleInstance;
|
800
|
+
moduleInstance = Module(m.getUncoatedModule(), liveModuleSentinel);
|
801
|
+
return moduleInstances[m.url] = moduleInstance;
|
802
|
+
},
|
803
|
+
set: function(normalizedName, module) {
|
804
|
+
normalizedName = String(normalizedName);
|
805
|
+
moduleInstantiators[normalizedName] = new UncoatedModuleInstantiator(normalizedName, (function() {
|
806
|
+
return module;
|
807
|
+
}));
|
808
|
+
moduleInstances[normalizedName] = module;
|
809
|
+
},
|
810
|
+
get baseURL() {
|
811
|
+
return baseURL;
|
812
|
+
},
|
813
|
+
set baseURL(v) {
|
814
|
+
baseURL = String(v);
|
815
|
+
},
|
816
|
+
registerModule: function(name, func) {
|
817
|
+
var normalizedName = ModuleStore.normalize(name);
|
818
|
+
if (moduleInstantiators[normalizedName])
|
819
|
+
throw new Error('duplicate module named ' + normalizedName);
|
820
|
+
moduleInstantiators[normalizedName] = new UncoatedModuleInstantiator(normalizedName, func);
|
821
|
+
},
|
822
|
+
bundleStore: Object.create(null),
|
823
|
+
register: function(name, deps, func) {
|
824
|
+
if (!deps || !deps.length && !func.length) {
|
825
|
+
this.registerModule(name, func);
|
826
|
+
} else {
|
827
|
+
this.bundleStore[name] = {
|
828
|
+
deps: deps,
|
829
|
+
execute: function() {
|
830
|
+
var $__0 = arguments;
|
831
|
+
var depMap = {};
|
832
|
+
deps.forEach((function(dep, index) {
|
833
|
+
return depMap[dep] = $__0[index];
|
834
|
+
}));
|
835
|
+
var registryEntry = func.call(this, depMap);
|
836
|
+
registryEntry.execute.call(this);
|
837
|
+
return registryEntry.exports;
|
838
|
+
}
|
839
|
+
};
|
840
|
+
}
|
841
|
+
},
|
842
|
+
getAnonymousModule: function(func) {
|
843
|
+
return new Module(func.call(global), liveModuleSentinel);
|
844
|
+
},
|
845
|
+
getForTesting: function(name) {
|
846
|
+
var $__0 = this;
|
847
|
+
if (!this.testingPrefix_) {
|
848
|
+
Object.keys(moduleInstances).some((function(key) {
|
849
|
+
var m = /(traceur@[^\/]*\/)/.exec(key);
|
850
|
+
if (m) {
|
851
|
+
$__0.testingPrefix_ = m[1];
|
852
|
+
return true;
|
853
|
+
}
|
854
|
+
}));
|
855
|
+
}
|
856
|
+
return this.get(this.testingPrefix_ + name);
|
857
|
+
}
|
858
|
+
};
|
859
|
+
ModuleStore.set('@traceur/src/runtime/ModuleStore', new Module({ModuleStore: ModuleStore}));
|
860
|
+
var setupGlobals = $traceurRuntime.setupGlobals;
|
861
|
+
$traceurRuntime.setupGlobals = function(global) {
|
862
|
+
setupGlobals(global);
|
863
|
+
};
|
864
|
+
$traceurRuntime.ModuleStore = ModuleStore;
|
865
|
+
global.System = {
|
866
|
+
register: ModuleStore.register.bind(ModuleStore),
|
867
|
+
get: ModuleStore.get,
|
868
|
+
set: ModuleStore.set,
|
869
|
+
normalize: ModuleStore.normalize
|
870
|
+
};
|
871
|
+
$traceurRuntime.getModuleImpl = function(name) {
|
872
|
+
var instantiator = getUncoatedModuleInstantiator(name);
|
873
|
+
return instantiator && instantiator.getUncoatedModule();
|
874
|
+
};
|
875
|
+
})(typeof global !== 'undefined' ? global : this);
|
876
|
+
System.register("traceur-runtime@0.0.43/src/runtime/polyfills/utils", [], function() {
|
877
|
+
"use strict";
|
878
|
+
var __moduleName = "traceur-runtime@0.0.43/src/runtime/polyfills/utils";
|
879
|
+
var toObject = $traceurRuntime.toObject;
|
880
|
+
function toUint32(x) {
|
881
|
+
return x | 0;
|
882
|
+
}
|
883
|
+
function isObject(x) {
|
884
|
+
return x && (typeof x === 'object' || typeof x === 'function');
|
885
|
+
}
|
886
|
+
function isCallable(x) {
|
887
|
+
return typeof x === 'function';
|
888
|
+
}
|
889
|
+
function toInteger(x) {
|
890
|
+
x = +x;
|
891
|
+
if (isNaN(x))
|
892
|
+
return 0;
|
893
|
+
if (!isFinite(x) || x === 0)
|
894
|
+
return x;
|
895
|
+
return x > 0 ? Math.floor(x) : Math.ceil(x);
|
896
|
+
}
|
897
|
+
var MAX_SAFE_LENGTH = Math.pow(2, 53) - 1;
|
898
|
+
function toLength(x) {
|
899
|
+
var len = toInteger(x);
|
900
|
+
return len < 0 ? 0 : Math.min(len, MAX_SAFE_LENGTH);
|
901
|
+
}
|
902
|
+
return {
|
903
|
+
get toObject() {
|
904
|
+
return toObject;
|
905
|
+
},
|
906
|
+
get toUint32() {
|
907
|
+
return toUint32;
|
908
|
+
},
|
909
|
+
get isObject() {
|
910
|
+
return isObject;
|
911
|
+
},
|
912
|
+
get isCallable() {
|
913
|
+
return isCallable;
|
914
|
+
},
|
915
|
+
get toInteger() {
|
916
|
+
return toInteger;
|
917
|
+
},
|
918
|
+
get toLength() {
|
919
|
+
return toLength;
|
920
|
+
}
|
921
|
+
};
|
922
|
+
});
|
923
|
+
System.register("traceur-runtime@0.0.43/src/runtime/polyfills/Array", [], function() {
|
924
|
+
"use strict";
|
925
|
+
var __moduleName = "traceur-runtime@0.0.43/src/runtime/polyfills/Array";
|
926
|
+
var $__3 = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.43/src/runtime/polyfills/utils")),
|
927
|
+
toInteger = $__3.toInteger,
|
928
|
+
toLength = $__3.toLength,
|
929
|
+
toObject = $__3.toObject,
|
930
|
+
isCallable = $__3.isCallable;
|
931
|
+
function fill(value) {
|
932
|
+
var start = arguments[1] !== (void 0) ? arguments[1] : 0;
|
933
|
+
var end = arguments[2];
|
934
|
+
var object = toObject(this);
|
935
|
+
var len = toLength(object.length);
|
936
|
+
var fillStart = toInteger(start);
|
937
|
+
var fillEnd = end !== undefined ? toInteger(end) : len;
|
938
|
+
fillStart = fillStart < 0 ? Math.max(len + fillStart, 0) : Math.min(fillStart, len);
|
939
|
+
fillEnd = fillEnd < 0 ? Math.max(len + fillEnd, 0) : Math.min(fillEnd, len);
|
940
|
+
while (fillStart < fillEnd) {
|
941
|
+
object[fillStart] = value;
|
942
|
+
fillStart++;
|
943
|
+
}
|
944
|
+
return object;
|
945
|
+
}
|
946
|
+
function find(predicate) {
|
947
|
+
var thisArg = arguments[1];
|
948
|
+
return findHelper(this, predicate, thisArg);
|
949
|
+
}
|
950
|
+
function findIndex(predicate) {
|
951
|
+
var thisArg = arguments[1];
|
952
|
+
return findHelper(this, predicate, thisArg, true);
|
953
|
+
}
|
954
|
+
function findHelper(self, predicate) {
|
955
|
+
var thisArg = arguments[2];
|
956
|
+
var returnIndex = arguments[3] !== (void 0) ? arguments[3] : false;
|
957
|
+
var object = toObject(self);
|
958
|
+
var len = toLength(object.length);
|
959
|
+
if (!isCallable(predicate)) {
|
960
|
+
throw TypeError();
|
961
|
+
}
|
962
|
+
for (var i = 0; i < len; i++) {
|
963
|
+
if (i in object) {
|
964
|
+
var value = object[i];
|
965
|
+
if (predicate.call(thisArg, value, i, object)) {
|
966
|
+
return returnIndex ? i : value;
|
967
|
+
}
|
968
|
+
}
|
969
|
+
}
|
970
|
+
return returnIndex ? -1 : undefined;
|
971
|
+
}
|
972
|
+
return {
|
973
|
+
get fill() {
|
974
|
+
return fill;
|
975
|
+
},
|
976
|
+
get find() {
|
977
|
+
return find;
|
978
|
+
},
|
979
|
+
get findIndex() {
|
980
|
+
return findIndex;
|
981
|
+
}
|
982
|
+
};
|
983
|
+
});
|
984
|
+
System.register("traceur-runtime@0.0.43/src/runtime/polyfills/ArrayIterator", [], function() {
|
985
|
+
"use strict";
|
986
|
+
var $__5;
|
987
|
+
var __moduleName = "traceur-runtime@0.0.43/src/runtime/polyfills/ArrayIterator";
|
988
|
+
var $__6 = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.43/src/runtime/polyfills/utils")),
|
989
|
+
toObject = $__6.toObject,
|
990
|
+
toUint32 = $__6.toUint32;
|
991
|
+
var ARRAY_ITERATOR_KIND_KEYS = 1;
|
992
|
+
var ARRAY_ITERATOR_KIND_VALUES = 2;
|
993
|
+
var ARRAY_ITERATOR_KIND_ENTRIES = 3;
|
994
|
+
var ArrayIterator = function ArrayIterator() {};
|
995
|
+
($traceurRuntime.createClass)(ArrayIterator, ($__5 = {}, Object.defineProperty($__5, "next", {
|
996
|
+
value: function() {
|
997
|
+
var iterator = toObject(this);
|
998
|
+
var array = iterator.iteratorObject_;
|
999
|
+
if (!array) {
|
1000
|
+
throw new TypeError('Object is not an ArrayIterator');
|
1001
|
+
}
|
1002
|
+
var index = iterator.arrayIteratorNextIndex_;
|
1003
|
+
var itemKind = iterator.arrayIterationKind_;
|
1004
|
+
var length = toUint32(array.length);
|
1005
|
+
if (index >= length) {
|
1006
|
+
iterator.arrayIteratorNextIndex_ = Infinity;
|
1007
|
+
return createIteratorResultObject(undefined, true);
|
1008
|
+
}
|
1009
|
+
iterator.arrayIteratorNextIndex_ = index + 1;
|
1010
|
+
if (itemKind == ARRAY_ITERATOR_KIND_VALUES)
|
1011
|
+
return createIteratorResultObject(array[index], false);
|
1012
|
+
if (itemKind == ARRAY_ITERATOR_KIND_ENTRIES)
|
1013
|
+
return createIteratorResultObject([index, array[index]], false);
|
1014
|
+
return createIteratorResultObject(index, false);
|
1015
|
+
},
|
1016
|
+
configurable: true,
|
1017
|
+
enumerable: true,
|
1018
|
+
writable: true
|
1019
|
+
}), Object.defineProperty($__5, Symbol.iterator, {
|
1020
|
+
value: function() {
|
1021
|
+
return this;
|
1022
|
+
},
|
1023
|
+
configurable: true,
|
1024
|
+
enumerable: true,
|
1025
|
+
writable: true
|
1026
|
+
}), $__5), {});
|
1027
|
+
function createArrayIterator(array, kind) {
|
1028
|
+
var object = toObject(array);
|
1029
|
+
var iterator = new ArrayIterator;
|
1030
|
+
iterator.iteratorObject_ = object;
|
1031
|
+
iterator.arrayIteratorNextIndex_ = 0;
|
1032
|
+
iterator.arrayIterationKind_ = kind;
|
1033
|
+
return iterator;
|
1034
|
+
}
|
1035
|
+
function createIteratorResultObject(value, done) {
|
1036
|
+
return {
|
1037
|
+
value: value,
|
1038
|
+
done: done
|
1039
|
+
};
|
1040
|
+
}
|
1041
|
+
function entries() {
|
1042
|
+
return createArrayIterator(this, ARRAY_ITERATOR_KIND_ENTRIES);
|
1043
|
+
}
|
1044
|
+
function keys() {
|
1045
|
+
return createArrayIterator(this, ARRAY_ITERATOR_KIND_KEYS);
|
1046
|
+
}
|
1047
|
+
function values() {
|
1048
|
+
return createArrayIterator(this, ARRAY_ITERATOR_KIND_VALUES);
|
1049
|
+
}
|
1050
|
+
return {
|
1051
|
+
get entries() {
|
1052
|
+
return entries;
|
1053
|
+
},
|
1054
|
+
get keys() {
|
1055
|
+
return keys;
|
1056
|
+
},
|
1057
|
+
get values() {
|
1058
|
+
return values;
|
1059
|
+
}
|
1060
|
+
};
|
1061
|
+
});
|
1062
|
+
System.register("traceur-runtime@0.0.43/src/runtime/polyfills/Map", [], function() {
|
1063
|
+
"use strict";
|
1064
|
+
var __moduleName = "traceur-runtime@0.0.43/src/runtime/polyfills/Map";
|
1065
|
+
var isObject = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.43/src/runtime/polyfills/utils")).isObject;
|
1066
|
+
var getOwnHashObject = $traceurRuntime.getOwnHashObject;
|
1067
|
+
var $hasOwnProperty = Object.prototype.hasOwnProperty;
|
1068
|
+
var deletedSentinel = {};
|
1069
|
+
function lookupIndex(map, key) {
|
1070
|
+
if (isObject(key)) {
|
1071
|
+
var hashObject = getOwnHashObject(key);
|
1072
|
+
return hashObject && map.objectIndex_[hashObject.hash];
|
1073
|
+
}
|
1074
|
+
if (typeof key === 'string')
|
1075
|
+
return map.stringIndex_[key];
|
1076
|
+
return map.primitiveIndex_[key];
|
1077
|
+
}
|
1078
|
+
function initMap(map) {
|
1079
|
+
map.entries_ = [];
|
1080
|
+
map.objectIndex_ = Object.create(null);
|
1081
|
+
map.stringIndex_ = Object.create(null);
|
1082
|
+
map.primitiveIndex_ = Object.create(null);
|
1083
|
+
map.deletedCount_ = 0;
|
1084
|
+
}
|
1085
|
+
var Map = function Map() {
|
1086
|
+
var iterable = arguments[0];
|
1087
|
+
if (!isObject(this))
|
1088
|
+
throw new TypeError('Map called on incompatible type');
|
1089
|
+
if ($hasOwnProperty.call(this, 'entries_')) {
|
1090
|
+
throw new TypeError('Map can not be reentrantly initialised');
|
1091
|
+
}
|
1092
|
+
initMap(this);
|
1093
|
+
if (iterable !== null && iterable !== undefined) {
|
1094
|
+
for (var $__8 = iterable[Symbol.iterator](),
|
1095
|
+
$__9; !($__9 = $__8.next()).done; ) {
|
1096
|
+
var $__10 = $traceurRuntime.assertObject($__9.value),
|
1097
|
+
key = $__10[0],
|
1098
|
+
value = $__10[1];
|
1099
|
+
{
|
1100
|
+
this.set(key, value);
|
1101
|
+
}
|
1102
|
+
}
|
1103
|
+
}
|
1104
|
+
};
|
1105
|
+
($traceurRuntime.createClass)(Map, {
|
1106
|
+
get size() {
|
1107
|
+
return this.entries_.length / 2 - this.deletedCount_;
|
1108
|
+
},
|
1109
|
+
get: function(key) {
|
1110
|
+
var index = lookupIndex(this, key);
|
1111
|
+
if (index !== undefined)
|
1112
|
+
return this.entries_[index + 1];
|
1113
|
+
},
|
1114
|
+
set: function(key, value) {
|
1115
|
+
var objectMode = isObject(key);
|
1116
|
+
var stringMode = typeof key === 'string';
|
1117
|
+
var index = lookupIndex(this, key);
|
1118
|
+
if (index !== undefined) {
|
1119
|
+
this.entries_[index + 1] = value;
|
1120
|
+
} else {
|
1121
|
+
index = this.entries_.length;
|
1122
|
+
this.entries_[index] = key;
|
1123
|
+
this.entries_[index + 1] = value;
|
1124
|
+
if (objectMode) {
|
1125
|
+
var hashObject = getOwnHashObject(key);
|
1126
|
+
var hash = hashObject.hash;
|
1127
|
+
this.objectIndex_[hash] = index;
|
1128
|
+
} else if (stringMode) {
|
1129
|
+
this.stringIndex_[key] = index;
|
1130
|
+
} else {
|
1131
|
+
this.primitiveIndex_[key] = index;
|
1132
|
+
}
|
1133
|
+
}
|
1134
|
+
return this;
|
1135
|
+
},
|
1136
|
+
has: function(key) {
|
1137
|
+
return lookupIndex(this, key) !== undefined;
|
1138
|
+
},
|
1139
|
+
delete: function(key) {
|
1140
|
+
var objectMode = isObject(key);
|
1141
|
+
var stringMode = typeof key === 'string';
|
1142
|
+
var index;
|
1143
|
+
var hash;
|
1144
|
+
if (objectMode) {
|
1145
|
+
var hashObject = getOwnHashObject(key);
|
1146
|
+
if (hashObject) {
|
1147
|
+
index = this.objectIndex_[hash = hashObject.hash];
|
1148
|
+
delete this.objectIndex_[hash];
|
1149
|
+
}
|
1150
|
+
} else if (stringMode) {
|
1151
|
+
index = this.stringIndex_[key];
|
1152
|
+
delete this.stringIndex_[key];
|
1153
|
+
} else {
|
1154
|
+
index = this.primitiveIndex_[key];
|
1155
|
+
delete this.primitiveIndex_[key];
|
1156
|
+
}
|
1157
|
+
if (index !== undefined) {
|
1158
|
+
this.entries_[index] = deletedSentinel;
|
1159
|
+
this.entries_[index + 1] = undefined;
|
1160
|
+
this.deletedCount_++;
|
1161
|
+
}
|
1162
|
+
},
|
1163
|
+
clear: function() {
|
1164
|
+
initMap(this);
|
1165
|
+
},
|
1166
|
+
forEach: function(callbackFn) {
|
1167
|
+
var thisArg = arguments[1];
|
1168
|
+
for (var i = 0,
|
1169
|
+
len = this.entries_.length; i < len; i += 2) {
|
1170
|
+
var key = this.entries_[i];
|
1171
|
+
var value = this.entries_[i + 1];
|
1172
|
+
if (key === deletedSentinel)
|
1173
|
+
continue;
|
1174
|
+
callbackFn.call(thisArg, value, key, this);
|
1175
|
+
}
|
1176
|
+
},
|
1177
|
+
entries: $traceurRuntime.initGeneratorFunction(function $__11() {
|
1178
|
+
var i,
|
1179
|
+
len,
|
1180
|
+
key,
|
1181
|
+
value;
|
1182
|
+
return $traceurRuntime.createGeneratorInstance(function($ctx) {
|
1183
|
+
while (true)
|
1184
|
+
switch ($ctx.state) {
|
1185
|
+
case 0:
|
1186
|
+
i = 0, len = this.entries_.length;
|
1187
|
+
$ctx.state = 12;
|
1188
|
+
break;
|
1189
|
+
case 12:
|
1190
|
+
$ctx.state = (i < len) ? 8 : -2;
|
1191
|
+
break;
|
1192
|
+
case 4:
|
1193
|
+
i += 2;
|
1194
|
+
$ctx.state = 12;
|
1195
|
+
break;
|
1196
|
+
case 8:
|
1197
|
+
key = this.entries_[i];
|
1198
|
+
value = this.entries_[i + 1];
|
1199
|
+
$ctx.state = 9;
|
1200
|
+
break;
|
1201
|
+
case 9:
|
1202
|
+
$ctx.state = (key === deletedSentinel) ? 4 : 6;
|
1203
|
+
break;
|
1204
|
+
case 6:
|
1205
|
+
$ctx.state = 2;
|
1206
|
+
return [key, value];
|
1207
|
+
case 2:
|
1208
|
+
$ctx.maybeThrow();
|
1209
|
+
$ctx.state = 4;
|
1210
|
+
break;
|
1211
|
+
default:
|
1212
|
+
return $ctx.end();
|
1213
|
+
}
|
1214
|
+
}, $__11, this);
|
1215
|
+
}),
|
1216
|
+
keys: $traceurRuntime.initGeneratorFunction(function $__12() {
|
1217
|
+
var i,
|
1218
|
+
len,
|
1219
|
+
key,
|
1220
|
+
value;
|
1221
|
+
return $traceurRuntime.createGeneratorInstance(function($ctx) {
|
1222
|
+
while (true)
|
1223
|
+
switch ($ctx.state) {
|
1224
|
+
case 0:
|
1225
|
+
i = 0, len = this.entries_.length;
|
1226
|
+
$ctx.state = 12;
|
1227
|
+
break;
|
1228
|
+
case 12:
|
1229
|
+
$ctx.state = (i < len) ? 8 : -2;
|
1230
|
+
break;
|
1231
|
+
case 4:
|
1232
|
+
i += 2;
|
1233
|
+
$ctx.state = 12;
|
1234
|
+
break;
|
1235
|
+
case 8:
|
1236
|
+
key = this.entries_[i];
|
1237
|
+
value = this.entries_[i + 1];
|
1238
|
+
$ctx.state = 9;
|
1239
|
+
break;
|
1240
|
+
case 9:
|
1241
|
+
$ctx.state = (key === deletedSentinel) ? 4 : 6;
|
1242
|
+
break;
|
1243
|
+
case 6:
|
1244
|
+
$ctx.state = 2;
|
1245
|
+
return key;
|
1246
|
+
case 2:
|
1247
|
+
$ctx.maybeThrow();
|
1248
|
+
$ctx.state = 4;
|
1249
|
+
break;
|
1250
|
+
default:
|
1251
|
+
return $ctx.end();
|
1252
|
+
}
|
1253
|
+
}, $__12, this);
|
1254
|
+
}),
|
1255
|
+
values: $traceurRuntime.initGeneratorFunction(function $__13() {
|
1256
|
+
var i,
|
1257
|
+
len,
|
1258
|
+
key,
|
1259
|
+
value;
|
1260
|
+
return $traceurRuntime.createGeneratorInstance(function($ctx) {
|
1261
|
+
while (true)
|
1262
|
+
switch ($ctx.state) {
|
1263
|
+
case 0:
|
1264
|
+
i = 0, len = this.entries_.length;
|
1265
|
+
$ctx.state = 12;
|
1266
|
+
break;
|
1267
|
+
case 12:
|
1268
|
+
$ctx.state = (i < len) ? 8 : -2;
|
1269
|
+
break;
|
1270
|
+
case 4:
|
1271
|
+
i += 2;
|
1272
|
+
$ctx.state = 12;
|
1273
|
+
break;
|
1274
|
+
case 8:
|
1275
|
+
key = this.entries_[i];
|
1276
|
+
value = this.entries_[i + 1];
|
1277
|
+
$ctx.state = 9;
|
1278
|
+
break;
|
1279
|
+
case 9:
|
1280
|
+
$ctx.state = (key === deletedSentinel) ? 4 : 6;
|
1281
|
+
break;
|
1282
|
+
case 6:
|
1283
|
+
$ctx.state = 2;
|
1284
|
+
return value;
|
1285
|
+
case 2:
|
1286
|
+
$ctx.maybeThrow();
|
1287
|
+
$ctx.state = 4;
|
1288
|
+
break;
|
1289
|
+
default:
|
1290
|
+
return $ctx.end();
|
1291
|
+
}
|
1292
|
+
}, $__13, this);
|
1293
|
+
})
|
1294
|
+
}, {});
|
1295
|
+
Object.defineProperty(Map.prototype, Symbol.iterator, {
|
1296
|
+
configurable: true,
|
1297
|
+
writable: true,
|
1298
|
+
value: Map.prototype.entries
|
1299
|
+
});
|
1300
|
+
return {get Map() {
|
1301
|
+
return Map;
|
1302
|
+
}};
|
1303
|
+
});
|
1304
|
+
System.register("traceur-runtime@0.0.43/src/runtime/polyfills/Object", [], function() {
|
1305
|
+
"use strict";
|
1306
|
+
var __moduleName = "traceur-runtime@0.0.43/src/runtime/polyfills/Object";
|
1307
|
+
var $__14 = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.43/src/runtime/polyfills/utils")),
|
1308
|
+
toInteger = $__14.toInteger,
|
1309
|
+
toLength = $__14.toLength,
|
1310
|
+
toObject = $__14.toObject,
|
1311
|
+
isCallable = $__14.isCallable;
|
1312
|
+
var $__14 = $traceurRuntime.assertObject($traceurRuntime),
|
1313
|
+
defineProperty = $__14.defineProperty,
|
1314
|
+
getOwnPropertyDescriptor = $__14.getOwnPropertyDescriptor,
|
1315
|
+
getOwnPropertyNames = $__14.getOwnPropertyNames,
|
1316
|
+
keys = $__14.keys,
|
1317
|
+
privateNames = $__14.privateNames;
|
1318
|
+
function is(left, right) {
|
1319
|
+
if (left === right)
|
1320
|
+
return left !== 0 || 1 / left === 1 / right;
|
1321
|
+
return left !== left && right !== right;
|
1322
|
+
}
|
1323
|
+
function assign(target) {
|
1324
|
+
for (var i = 1; i < arguments.length; i++) {
|
1325
|
+
var source = arguments[i];
|
1326
|
+
var props = keys(source);
|
1327
|
+
var p,
|
1328
|
+
length = props.length;
|
1329
|
+
for (p = 0; p < length; p++) {
|
1330
|
+
var name = props[p];
|
1331
|
+
if (privateNames[name])
|
1332
|
+
continue;
|
1333
|
+
target[name] = source[name];
|
1334
|
+
}
|
1335
|
+
}
|
1336
|
+
return target;
|
1337
|
+
}
|
1338
|
+
function mixin(target, source) {
|
1339
|
+
var props = getOwnPropertyNames(source);
|
1340
|
+
var p,
|
1341
|
+
descriptor,
|
1342
|
+
length = props.length;
|
1343
|
+
for (p = 0; p < length; p++) {
|
1344
|
+
var name = props[p];
|
1345
|
+
if (privateNames[name])
|
1346
|
+
continue;
|
1347
|
+
descriptor = getOwnPropertyDescriptor(source, props[p]);
|
1348
|
+
defineProperty(target, props[p], descriptor);
|
1349
|
+
}
|
1350
|
+
return target;
|
1351
|
+
}
|
1352
|
+
return {
|
1353
|
+
get is() {
|
1354
|
+
return is;
|
1355
|
+
},
|
1356
|
+
get assign() {
|
1357
|
+
return assign;
|
1358
|
+
},
|
1359
|
+
get mixin() {
|
1360
|
+
return mixin;
|
1361
|
+
}
|
1362
|
+
};
|
1363
|
+
});
|
1364
|
+
System.register("traceur-runtime@0.0.43/node_modules/rsvp/lib/rsvp/asap", [], function() {
|
1365
|
+
"use strict";
|
1366
|
+
var __moduleName = "traceur-runtime@0.0.43/node_modules/rsvp/lib/rsvp/asap";
|
1367
|
+
var $__default = function asap(callback, arg) {
|
1368
|
+
var length = queue.push([callback, arg]);
|
1369
|
+
if (length === 1) {
|
1370
|
+
scheduleFlush();
|
1371
|
+
}
|
1372
|
+
};
|
1373
|
+
var browserGlobal = (typeof window !== 'undefined') ? window : {};
|
1374
|
+
var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
|
1375
|
+
function useNextTick() {
|
1376
|
+
return function() {
|
1377
|
+
process.nextTick(flush);
|
1378
|
+
};
|
1379
|
+
}
|
1380
|
+
function useMutationObserver() {
|
1381
|
+
var iterations = 0;
|
1382
|
+
var observer = new BrowserMutationObserver(flush);
|
1383
|
+
var node = document.createTextNode('');
|
1384
|
+
observer.observe(node, {characterData: true});
|
1385
|
+
return function() {
|
1386
|
+
node.data = (iterations = ++iterations % 2);
|
1387
|
+
};
|
1388
|
+
}
|
1389
|
+
function useSetTimeout() {
|
1390
|
+
return function() {
|
1391
|
+
setTimeout(flush, 1);
|
1392
|
+
};
|
1393
|
+
}
|
1394
|
+
var queue = [];
|
1395
|
+
function flush() {
|
1396
|
+
for (var i = 0; i < queue.length; i++) {
|
1397
|
+
var tuple = queue[i];
|
1398
|
+
var callback = tuple[0],
|
1399
|
+
arg = tuple[1];
|
1400
|
+
callback(arg);
|
1401
|
+
}
|
1402
|
+
queue = [];
|
1403
|
+
}
|
1404
|
+
var scheduleFlush;
|
1405
|
+
if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') {
|
1406
|
+
scheduleFlush = useNextTick();
|
1407
|
+
} else if (BrowserMutationObserver) {
|
1408
|
+
scheduleFlush = useMutationObserver();
|
1409
|
+
} else {
|
1410
|
+
scheduleFlush = useSetTimeout();
|
1411
|
+
}
|
1412
|
+
return {get default() {
|
1413
|
+
return $__default;
|
1414
|
+
}};
|
1415
|
+
});
|
1416
|
+
System.register("traceur-runtime@0.0.43/src/runtime/polyfills/Promise", [], function() {
|
1417
|
+
"use strict";
|
1418
|
+
var __moduleName = "traceur-runtime@0.0.43/src/runtime/polyfills/Promise";
|
1419
|
+
var async = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.43/node_modules/rsvp/lib/rsvp/asap")).default;
|
1420
|
+
var promiseRaw = {};
|
1421
|
+
function isPromise(x) {
|
1422
|
+
return x && typeof x === 'object' && x.status_ !== undefined;
|
1423
|
+
}
|
1424
|
+
function idResolveHandler(x) {
|
1425
|
+
return x;
|
1426
|
+
}
|
1427
|
+
function idRejectHandler(x) {
|
1428
|
+
throw x;
|
1429
|
+
}
|
1430
|
+
function chain(promise) {
|
1431
|
+
var onResolve = arguments[1] !== (void 0) ? arguments[1] : idResolveHandler;
|
1432
|
+
var onReject = arguments[2] !== (void 0) ? arguments[2] : idRejectHandler;
|
1433
|
+
var deferred = getDeferred(promise.constructor);
|
1434
|
+
switch (promise.status_) {
|
1435
|
+
case undefined:
|
1436
|
+
throw TypeError;
|
1437
|
+
case 0:
|
1438
|
+
promise.onResolve_.push(onResolve, deferred);
|
1439
|
+
promise.onReject_.push(onReject, deferred);
|
1440
|
+
break;
|
1441
|
+
case +1:
|
1442
|
+
promiseEnqueue(promise.value_, [onResolve, deferred]);
|
1443
|
+
break;
|
1444
|
+
case -1:
|
1445
|
+
promiseEnqueue(promise.value_, [onReject, deferred]);
|
1446
|
+
break;
|
1447
|
+
}
|
1448
|
+
return deferred.promise;
|
1449
|
+
}
|
1450
|
+
function getDeferred(C) {
|
1451
|
+
if (this === $Promise) {
|
1452
|
+
var promise = promiseInit(new $Promise(promiseRaw));
|
1453
|
+
return {
|
1454
|
+
promise: promise,
|
1455
|
+
resolve: (function(x) {
|
1456
|
+
promiseResolve(promise, x);
|
1457
|
+
}),
|
1458
|
+
reject: (function(r) {
|
1459
|
+
promiseReject(promise, r);
|
1460
|
+
})
|
1461
|
+
};
|
1462
|
+
} else {
|
1463
|
+
var result = {};
|
1464
|
+
result.promise = new C((function(resolve, reject) {
|
1465
|
+
result.resolve = resolve;
|
1466
|
+
result.reject = reject;
|
1467
|
+
}));
|
1468
|
+
return result;
|
1469
|
+
}
|
1470
|
+
}
|
1471
|
+
function promiseSet(promise, status, value, onResolve, onReject) {
|
1472
|
+
promise.status_ = status;
|
1473
|
+
promise.value_ = value;
|
1474
|
+
promise.onResolve_ = onResolve;
|
1475
|
+
promise.onReject_ = onReject;
|
1476
|
+
return promise;
|
1477
|
+
}
|
1478
|
+
function promiseInit(promise) {
|
1479
|
+
return promiseSet(promise, 0, undefined, [], []);
|
1480
|
+
}
|
1481
|
+
var Promise = function Promise(resolver) {
|
1482
|
+
if (resolver === promiseRaw)
|
1483
|
+
return;
|
1484
|
+
if (typeof resolver !== 'function')
|
1485
|
+
throw new TypeError;
|
1486
|
+
var promise = promiseInit(this);
|
1487
|
+
try {
|
1488
|
+
resolver((function(x) {
|
1489
|
+
promiseResolve(promise, x);
|
1490
|
+
}), (function(r) {
|
1491
|
+
promiseReject(promise, r);
|
1492
|
+
}));
|
1493
|
+
} catch (e) {
|
1494
|
+
promiseReject(promise, e);
|
1495
|
+
}
|
1496
|
+
};
|
1497
|
+
($traceurRuntime.createClass)(Promise, {
|
1498
|
+
catch: function(onReject) {
|
1499
|
+
return this.then(undefined, onReject);
|
1500
|
+
},
|
1501
|
+
then: function(onResolve, onReject) {
|
1502
|
+
if (typeof onResolve !== 'function')
|
1503
|
+
onResolve = idResolveHandler;
|
1504
|
+
if (typeof onReject !== 'function')
|
1505
|
+
onReject = idRejectHandler;
|
1506
|
+
var that = this;
|
1507
|
+
var constructor = this.constructor;
|
1508
|
+
return chain(this, function(x) {
|
1509
|
+
x = promiseCoerce(constructor, x);
|
1510
|
+
return x === that ? onReject(new TypeError) : isPromise(x) ? x.then(onResolve, onReject) : onResolve(x);
|
1511
|
+
}, onReject);
|
1512
|
+
}
|
1513
|
+
}, {
|
1514
|
+
resolve: function(x) {
|
1515
|
+
if (this === $Promise) {
|
1516
|
+
return promiseSet(new $Promise(promiseRaw), +1, x);
|
1517
|
+
} else {
|
1518
|
+
return new this(function(resolve, reject) {
|
1519
|
+
resolve(x);
|
1520
|
+
});
|
1521
|
+
}
|
1522
|
+
},
|
1523
|
+
reject: function(r) {
|
1524
|
+
if (this === $Promise) {
|
1525
|
+
return promiseSet(new $Promise(promiseRaw), -1, r);
|
1526
|
+
} else {
|
1527
|
+
return new this((function(resolve, reject) {
|
1528
|
+
reject(r);
|
1529
|
+
}));
|
1530
|
+
}
|
1531
|
+
},
|
1532
|
+
cast: function(x) {
|
1533
|
+
if (x instanceof this)
|
1534
|
+
return x;
|
1535
|
+
if (isPromise(x)) {
|
1536
|
+
var result = getDeferred(this);
|
1537
|
+
chain(x, result.resolve, result.reject);
|
1538
|
+
return result.promise;
|
1539
|
+
}
|
1540
|
+
return this.resolve(x);
|
1541
|
+
},
|
1542
|
+
all: function(values) {
|
1543
|
+
var deferred = getDeferred(this);
|
1544
|
+
var resolutions = [];
|
1545
|
+
try {
|
1546
|
+
var count = values.length;
|
1547
|
+
if (count === 0) {
|
1548
|
+
deferred.resolve(resolutions);
|
1549
|
+
} else {
|
1550
|
+
for (var i = 0; i < values.length; i++) {
|
1551
|
+
this.resolve(values[i]).then(function(i, x) {
|
1552
|
+
resolutions[i] = x;
|
1553
|
+
if (--count === 0)
|
1554
|
+
deferred.resolve(resolutions);
|
1555
|
+
}.bind(undefined, i), (function(r) {
|
1556
|
+
deferred.reject(r);
|
1557
|
+
}));
|
1558
|
+
}
|
1559
|
+
}
|
1560
|
+
} catch (e) {
|
1561
|
+
deferred.reject(e);
|
1562
|
+
}
|
1563
|
+
return deferred.promise;
|
1564
|
+
},
|
1565
|
+
race: function(values) {
|
1566
|
+
var deferred = getDeferred(this);
|
1567
|
+
try {
|
1568
|
+
for (var i = 0; i < values.length; i++) {
|
1569
|
+
this.resolve(values[i]).then((function(x) {
|
1570
|
+
deferred.resolve(x);
|
1571
|
+
}), (function(r) {
|
1572
|
+
deferred.reject(r);
|
1573
|
+
}));
|
1574
|
+
}
|
1575
|
+
} catch (e) {
|
1576
|
+
deferred.reject(e);
|
1577
|
+
}
|
1578
|
+
return deferred.promise;
|
1579
|
+
}
|
1580
|
+
});
|
1581
|
+
var $Promise = Promise;
|
1582
|
+
var $PromiseReject = $Promise.reject;
|
1583
|
+
function promiseResolve(promise, x) {
|
1584
|
+
promiseDone(promise, +1, x, promise.onResolve_);
|
1585
|
+
}
|
1586
|
+
function promiseReject(promise, r) {
|
1587
|
+
promiseDone(promise, -1, r, promise.onReject_);
|
1588
|
+
}
|
1589
|
+
function promiseDone(promise, status, value, reactions) {
|
1590
|
+
if (promise.status_ !== 0)
|
1591
|
+
return;
|
1592
|
+
promiseEnqueue(value, reactions);
|
1593
|
+
promiseSet(promise, status, value);
|
1594
|
+
}
|
1595
|
+
function promiseEnqueue(value, tasks) {
|
1596
|
+
async((function() {
|
1597
|
+
for (var i = 0; i < tasks.length; i += 2) {
|
1598
|
+
promiseHandle(value, tasks[i], tasks[i + 1]);
|
1599
|
+
}
|
1600
|
+
}));
|
1601
|
+
}
|
1602
|
+
function promiseHandle(value, handler, deferred) {
|
1603
|
+
try {
|
1604
|
+
var result = handler(value);
|
1605
|
+
if (result === deferred.promise)
|
1606
|
+
throw new TypeError;
|
1607
|
+
else if (isPromise(result))
|
1608
|
+
chain(result, deferred.resolve, deferred.reject);
|
1609
|
+
else
|
1610
|
+
deferred.resolve(result);
|
1611
|
+
} catch (e) {
|
1612
|
+
try {
|
1613
|
+
deferred.reject(e);
|
1614
|
+
} catch (e) {}
|
1615
|
+
}
|
1616
|
+
}
|
1617
|
+
var thenableSymbol = '@@thenable';
|
1618
|
+
function isObject(x) {
|
1619
|
+
return x && (typeof x === 'object' || typeof x === 'function');
|
1620
|
+
}
|
1621
|
+
function promiseCoerce(constructor, x) {
|
1622
|
+
if (!isPromise(x) && isObject(x)) {
|
1623
|
+
var then;
|
1624
|
+
try {
|
1625
|
+
then = x.then;
|
1626
|
+
} catch (r) {
|
1627
|
+
var promise = $PromiseReject.call(constructor, r);
|
1628
|
+
x[thenableSymbol] = promise;
|
1629
|
+
return promise;
|
1630
|
+
}
|
1631
|
+
if (typeof then === 'function') {
|
1632
|
+
var p = x[thenableSymbol];
|
1633
|
+
if (p) {
|
1634
|
+
return p;
|
1635
|
+
} else {
|
1636
|
+
var deferred = getDeferred(constructor);
|
1637
|
+
x[thenableSymbol] = deferred.promise;
|
1638
|
+
try {
|
1639
|
+
then.call(x, deferred.resolve, deferred.reject);
|
1640
|
+
} catch (r) {
|
1641
|
+
deferred.reject(r);
|
1642
|
+
}
|
1643
|
+
return deferred.promise;
|
1644
|
+
}
|
1645
|
+
}
|
1646
|
+
}
|
1647
|
+
return x;
|
1648
|
+
}
|
1649
|
+
return {get Promise() {
|
1650
|
+
return Promise;
|
1651
|
+
}};
|
1652
|
+
});
|
1653
|
+
System.register("traceur-runtime@0.0.43/src/runtime/polyfills/Set", [], function() {
|
1654
|
+
"use strict";
|
1655
|
+
var __moduleName = "traceur-runtime@0.0.43/src/runtime/polyfills/Set";
|
1656
|
+
var isObject = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.43/src/runtime/polyfills/utils")).isObject;
|
1657
|
+
var Map = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.43/src/runtime/polyfills/Map")).Map;
|
1658
|
+
var getOwnHashObject = $traceurRuntime.getOwnHashObject;
|
1659
|
+
var $hasOwnProperty = Object.prototype.hasOwnProperty;
|
1660
|
+
function initSet(set) {
|
1661
|
+
set.map_ = new Map();
|
1662
|
+
}
|
1663
|
+
var Set = function Set() {
|
1664
|
+
var iterable = arguments[0];
|
1665
|
+
if (!isObject(this))
|
1666
|
+
throw new TypeError('Set called on incompatible type');
|
1667
|
+
if ($hasOwnProperty.call(this, 'map_')) {
|
1668
|
+
throw new TypeError('Set can not be reentrantly initialised');
|
1669
|
+
}
|
1670
|
+
initSet(this);
|
1671
|
+
if (iterable !== null && iterable !== undefined) {
|
1672
|
+
for (var $__19 = iterable[Symbol.iterator](),
|
1673
|
+
$__20; !($__20 = $__19.next()).done; ) {
|
1674
|
+
var item = $__20.value;
|
1675
|
+
{
|
1676
|
+
this.add(item);
|
1677
|
+
}
|
1678
|
+
}
|
1679
|
+
}
|
1680
|
+
};
|
1681
|
+
($traceurRuntime.createClass)(Set, {
|
1682
|
+
get size() {
|
1683
|
+
return this.map_.size;
|
1684
|
+
},
|
1685
|
+
has: function(key) {
|
1686
|
+
return this.map_.has(key);
|
1687
|
+
},
|
1688
|
+
add: function(key) {
|
1689
|
+
return this.map_.set(key, true);
|
1690
|
+
},
|
1691
|
+
delete: function(key) {
|
1692
|
+
return this.map_.delete(key);
|
1693
|
+
},
|
1694
|
+
clear: function() {
|
1695
|
+
return this.map_.clear();
|
1696
|
+
},
|
1697
|
+
forEach: function(callbackFn) {
|
1698
|
+
var thisArg = arguments[1];
|
1699
|
+
var $__17 = this;
|
1700
|
+
return this.map_.forEach((function(value, key) {
|
1701
|
+
callbackFn.call(thisArg, key, key, $__17);
|
1702
|
+
}));
|
1703
|
+
},
|
1704
|
+
values: $traceurRuntime.initGeneratorFunction(function $__22() {
|
1705
|
+
var $__23,
|
1706
|
+
$__24;
|
1707
|
+
return $traceurRuntime.createGeneratorInstance(function($ctx) {
|
1708
|
+
while (true)
|
1709
|
+
switch ($ctx.state) {
|
1710
|
+
case 0:
|
1711
|
+
$__23 = this.map_.keys()[Symbol.iterator]();
|
1712
|
+
$ctx.sent = void 0;
|
1713
|
+
$ctx.action = 'next';
|
1714
|
+
$ctx.state = 12;
|
1715
|
+
break;
|
1716
|
+
case 12:
|
1717
|
+
$__24 = $__23[$ctx.action]($ctx.sentIgnoreThrow);
|
1718
|
+
$ctx.state = 9;
|
1719
|
+
break;
|
1720
|
+
case 9:
|
1721
|
+
$ctx.state = ($__24.done) ? 3 : 2;
|
1722
|
+
break;
|
1723
|
+
case 3:
|
1724
|
+
$ctx.sent = $__24.value;
|
1725
|
+
$ctx.state = -2;
|
1726
|
+
break;
|
1727
|
+
case 2:
|
1728
|
+
$ctx.state = 12;
|
1729
|
+
return $__24.value;
|
1730
|
+
default:
|
1731
|
+
return $ctx.end();
|
1732
|
+
}
|
1733
|
+
}, $__22, this);
|
1734
|
+
}),
|
1735
|
+
keys: $traceurRuntime.initGeneratorFunction(function $__25() {
|
1736
|
+
var $__26,
|
1737
|
+
$__27;
|
1738
|
+
return $traceurRuntime.createGeneratorInstance(function($ctx) {
|
1739
|
+
while (true)
|
1740
|
+
switch ($ctx.state) {
|
1741
|
+
case 0:
|
1742
|
+
$__26 = this.map_.keys()[Symbol.iterator]();
|
1743
|
+
$ctx.sent = void 0;
|
1744
|
+
$ctx.action = 'next';
|
1745
|
+
$ctx.state = 12;
|
1746
|
+
break;
|
1747
|
+
case 12:
|
1748
|
+
$__27 = $__26[$ctx.action]($ctx.sentIgnoreThrow);
|
1749
|
+
$ctx.state = 9;
|
1750
|
+
break;
|
1751
|
+
case 9:
|
1752
|
+
$ctx.state = ($__27.done) ? 3 : 2;
|
1753
|
+
break;
|
1754
|
+
case 3:
|
1755
|
+
$ctx.sent = $__27.value;
|
1756
|
+
$ctx.state = -2;
|
1757
|
+
break;
|
1758
|
+
case 2:
|
1759
|
+
$ctx.state = 12;
|
1760
|
+
return $__27.value;
|
1761
|
+
default:
|
1762
|
+
return $ctx.end();
|
1763
|
+
}
|
1764
|
+
}, $__25, this);
|
1765
|
+
})
|
1766
|
+
}, {});
|
1767
|
+
Object.defineProperty(Set.prototype, Symbol.iterator, {
|
1768
|
+
configurable: true,
|
1769
|
+
writable: true,
|
1770
|
+
value: Set.prototype.values
|
1771
|
+
});
|
1772
|
+
return {get Set() {
|
1773
|
+
return Set;
|
1774
|
+
}};
|
1775
|
+
});
|
1776
|
+
System.register("traceur-runtime@0.0.43/src/runtime/polyfills/String", [], function() {
|
1777
|
+
"use strict";
|
1778
|
+
var __moduleName = "traceur-runtime@0.0.43/src/runtime/polyfills/String";
|
1779
|
+
var $toString = Object.prototype.toString;
|
1780
|
+
var $indexOf = String.prototype.indexOf;
|
1781
|
+
var $lastIndexOf = String.prototype.lastIndexOf;
|
1782
|
+
function startsWith(search) {
|
1783
|
+
var string = String(this);
|
1784
|
+
if (this == null || $toString.call(search) == '[object RegExp]') {
|
1785
|
+
throw TypeError();
|
1786
|
+
}
|
1787
|
+
var stringLength = string.length;
|
1788
|
+
var searchString = String(search);
|
1789
|
+
var searchLength = searchString.length;
|
1790
|
+
var position = arguments.length > 1 ? arguments[1] : undefined;
|
1791
|
+
var pos = position ? Number(position) : 0;
|
1792
|
+
if (isNaN(pos)) {
|
1793
|
+
pos = 0;
|
1794
|
+
}
|
1795
|
+
var start = Math.min(Math.max(pos, 0), stringLength);
|
1796
|
+
return $indexOf.call(string, searchString, pos) == start;
|
1797
|
+
}
|
1798
|
+
function endsWith(search) {
|
1799
|
+
var string = String(this);
|
1800
|
+
if (this == null || $toString.call(search) == '[object RegExp]') {
|
1801
|
+
throw TypeError();
|
1802
|
+
}
|
1803
|
+
var stringLength = string.length;
|
1804
|
+
var searchString = String(search);
|
1805
|
+
var searchLength = searchString.length;
|
1806
|
+
var pos = stringLength;
|
1807
|
+
if (arguments.length > 1) {
|
1808
|
+
var position = arguments[1];
|
1809
|
+
if (position !== undefined) {
|
1810
|
+
pos = position ? Number(position) : 0;
|
1811
|
+
if (isNaN(pos)) {
|
1812
|
+
pos = 0;
|
1813
|
+
}
|
1814
|
+
}
|
1815
|
+
}
|
1816
|
+
var end = Math.min(Math.max(pos, 0), stringLength);
|
1817
|
+
var start = end - searchLength;
|
1818
|
+
if (start < 0) {
|
1819
|
+
return false;
|
1820
|
+
}
|
1821
|
+
return $lastIndexOf.call(string, searchString, start) == start;
|
1822
|
+
}
|
1823
|
+
function contains(search) {
|
1824
|
+
if (this == null) {
|
1825
|
+
throw TypeError();
|
1826
|
+
}
|
1827
|
+
var string = String(this);
|
1828
|
+
var stringLength = string.length;
|
1829
|
+
var searchString = String(search);
|
1830
|
+
var searchLength = searchString.length;
|
1831
|
+
var position = arguments.length > 1 ? arguments[1] : undefined;
|
1832
|
+
var pos = position ? Number(position) : 0;
|
1833
|
+
if (isNaN(pos)) {
|
1834
|
+
pos = 0;
|
1835
|
+
}
|
1836
|
+
var start = Math.min(Math.max(pos, 0), stringLength);
|
1837
|
+
return $indexOf.call(string, searchString, pos) != -1;
|
1838
|
+
}
|
1839
|
+
function repeat(count) {
|
1840
|
+
if (this == null) {
|
1841
|
+
throw TypeError();
|
1842
|
+
}
|
1843
|
+
var string = String(this);
|
1844
|
+
var n = count ? Number(count) : 0;
|
1845
|
+
if (isNaN(n)) {
|
1846
|
+
n = 0;
|
1847
|
+
}
|
1848
|
+
if (n < 0 || n == Infinity) {
|
1849
|
+
throw RangeError();
|
1850
|
+
}
|
1851
|
+
if (n == 0) {
|
1852
|
+
return '';
|
1853
|
+
}
|
1854
|
+
var result = '';
|
1855
|
+
while (n--) {
|
1856
|
+
result += string;
|
1857
|
+
}
|
1858
|
+
return result;
|
1859
|
+
}
|
1860
|
+
function codePointAt(position) {
|
1861
|
+
if (this == null) {
|
1862
|
+
throw TypeError();
|
1863
|
+
}
|
1864
|
+
var string = String(this);
|
1865
|
+
var size = string.length;
|
1866
|
+
var index = position ? Number(position) : 0;
|
1867
|
+
if (isNaN(index)) {
|
1868
|
+
index = 0;
|
1869
|
+
}
|
1870
|
+
if (index < 0 || index >= size) {
|
1871
|
+
return undefined;
|
1872
|
+
}
|
1873
|
+
var first = string.charCodeAt(index);
|
1874
|
+
var second;
|
1875
|
+
if (first >= 0xD800 && first <= 0xDBFF && size > index + 1) {
|
1876
|
+
second = string.charCodeAt(index + 1);
|
1877
|
+
if (second >= 0xDC00 && second <= 0xDFFF) {
|
1878
|
+
return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
|
1879
|
+
}
|
1880
|
+
}
|
1881
|
+
return first;
|
1882
|
+
}
|
1883
|
+
function raw(callsite) {
|
1884
|
+
var raw = callsite.raw;
|
1885
|
+
var len = raw.length >>> 0;
|
1886
|
+
if (len === 0)
|
1887
|
+
return '';
|
1888
|
+
var s = '';
|
1889
|
+
var i = 0;
|
1890
|
+
while (true) {
|
1891
|
+
s += raw[i];
|
1892
|
+
if (i + 1 === len)
|
1893
|
+
return s;
|
1894
|
+
s += arguments[++i];
|
1895
|
+
}
|
1896
|
+
}
|
1897
|
+
function fromCodePoint() {
|
1898
|
+
var codeUnits = [];
|
1899
|
+
var floor = Math.floor;
|
1900
|
+
var highSurrogate;
|
1901
|
+
var lowSurrogate;
|
1902
|
+
var index = -1;
|
1903
|
+
var length = arguments.length;
|
1904
|
+
if (!length) {
|
1905
|
+
return '';
|
1906
|
+
}
|
1907
|
+
while (++index < length) {
|
1908
|
+
var codePoint = Number(arguments[index]);
|
1909
|
+
if (!isFinite(codePoint) || codePoint < 0 || codePoint > 0x10FFFF || floor(codePoint) != codePoint) {
|
1910
|
+
throw RangeError('Invalid code point: ' + codePoint);
|
1911
|
+
}
|
1912
|
+
if (codePoint <= 0xFFFF) {
|
1913
|
+
codeUnits.push(codePoint);
|
1914
|
+
} else {
|
1915
|
+
codePoint -= 0x10000;
|
1916
|
+
highSurrogate = (codePoint >> 10) + 0xD800;
|
1917
|
+
lowSurrogate = (codePoint % 0x400) + 0xDC00;
|
1918
|
+
codeUnits.push(highSurrogate, lowSurrogate);
|
1919
|
+
}
|
1920
|
+
}
|
1921
|
+
return String.fromCharCode.apply(null, codeUnits);
|
1922
|
+
}
|
1923
|
+
return {
|
1924
|
+
get startsWith() {
|
1925
|
+
return startsWith;
|
1926
|
+
},
|
1927
|
+
get endsWith() {
|
1928
|
+
return endsWith;
|
1929
|
+
},
|
1930
|
+
get contains() {
|
1931
|
+
return contains;
|
1932
|
+
},
|
1933
|
+
get repeat() {
|
1934
|
+
return repeat;
|
1935
|
+
},
|
1936
|
+
get codePointAt() {
|
1937
|
+
return codePointAt;
|
1938
|
+
},
|
1939
|
+
get raw() {
|
1940
|
+
return raw;
|
1941
|
+
},
|
1942
|
+
get fromCodePoint() {
|
1943
|
+
return fromCodePoint;
|
1944
|
+
}
|
1945
|
+
};
|
1946
|
+
});
|
1947
|
+
System.register("traceur-runtime@0.0.43/src/runtime/polyfills/polyfills", [], function() {
|
1948
|
+
"use strict";
|
1949
|
+
var __moduleName = "traceur-runtime@0.0.43/src/runtime/polyfills/polyfills";
|
1950
|
+
var Map = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.43/src/runtime/polyfills/Map")).Map;
|
1951
|
+
var Set = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.43/src/runtime/polyfills/Set")).Set;
|
1952
|
+
var Promise = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.43/src/runtime/polyfills/Promise")).Promise;
|
1953
|
+
var $__28 = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.43/src/runtime/polyfills/String")),
|
1954
|
+
codePointAt = $__28.codePointAt,
|
1955
|
+
contains = $__28.contains,
|
1956
|
+
endsWith = $__28.endsWith,
|
1957
|
+
fromCodePoint = $__28.fromCodePoint,
|
1958
|
+
repeat = $__28.repeat,
|
1959
|
+
raw = $__28.raw,
|
1960
|
+
startsWith = $__28.startsWith;
|
1961
|
+
var $__28 = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.43/src/runtime/polyfills/Array")),
|
1962
|
+
fill = $__28.fill,
|
1963
|
+
find = $__28.find,
|
1964
|
+
findIndex = $__28.findIndex;
|
1965
|
+
var $__28 = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.43/src/runtime/polyfills/ArrayIterator")),
|
1966
|
+
entries = $__28.entries,
|
1967
|
+
keys = $__28.keys,
|
1968
|
+
values = $__28.values;
|
1969
|
+
var $__28 = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.43/src/runtime/polyfills/Object")),
|
1970
|
+
assign = $__28.assign,
|
1971
|
+
is = $__28.is,
|
1972
|
+
mixin = $__28.mixin;
|
1973
|
+
function maybeDefineMethod(object, name, value) {
|
1974
|
+
if (!(name in object)) {
|
1975
|
+
Object.defineProperty(object, name, {
|
1976
|
+
value: value,
|
1977
|
+
configurable: true,
|
1978
|
+
enumerable: false,
|
1979
|
+
writable: true
|
1980
|
+
});
|
1981
|
+
}
|
1982
|
+
}
|
1983
|
+
function maybeAddFunctions(object, functions) {
|
1984
|
+
for (var i = 0; i < functions.length; i += 2) {
|
1985
|
+
var name = functions[i];
|
1986
|
+
var value = functions[i + 1];
|
1987
|
+
maybeDefineMethod(object, name, value);
|
1988
|
+
}
|
1989
|
+
}
|
1990
|
+
function polyfillPromise(global) {
|
1991
|
+
if (!global.Promise)
|
1992
|
+
global.Promise = Promise;
|
1993
|
+
}
|
1994
|
+
function polyfillCollections(global) {
|
1995
|
+
if (!global.Map)
|
1996
|
+
global.Map = Map;
|
1997
|
+
if (!global.Set)
|
1998
|
+
global.Set = Set;
|
1999
|
+
}
|
2000
|
+
function polyfillString(String) {
|
2001
|
+
maybeAddFunctions(String.prototype, ['codePointAt', codePointAt, 'contains', contains, 'endsWith', endsWith, 'startsWith', startsWith, 'repeat', repeat]);
|
2002
|
+
maybeAddFunctions(String, ['fromCodePoint', fromCodePoint, 'raw', raw]);
|
2003
|
+
}
|
2004
|
+
function polyfillArray(Array, Symbol) {
|
2005
|
+
maybeAddFunctions(Array.prototype, ['entries', entries, 'keys', keys, 'values', values, 'fill', fill, 'find', find, 'findIndex', findIndex]);
|
2006
|
+
if (Symbol && Symbol.iterator) {
|
2007
|
+
Object.defineProperty(Array.prototype, Symbol.iterator, {
|
2008
|
+
value: values,
|
2009
|
+
configurable: true,
|
2010
|
+
enumerable: false,
|
2011
|
+
writable: true
|
2012
|
+
});
|
2013
|
+
}
|
2014
|
+
}
|
2015
|
+
function polyfillObject(Object) {
|
2016
|
+
maybeAddFunctions(Object, ['assign', assign, 'is', is, 'mixin', mixin]);
|
2017
|
+
}
|
2018
|
+
function polyfill(global) {
|
2019
|
+
polyfillPromise(global);
|
2020
|
+
polyfillCollections(global);
|
2021
|
+
polyfillString(global.String);
|
2022
|
+
polyfillArray(global.Array, global.Symbol);
|
2023
|
+
polyfillObject(global.Object);
|
2024
|
+
}
|
2025
|
+
polyfill(this);
|
2026
|
+
var setupGlobals = $traceurRuntime.setupGlobals;
|
2027
|
+
$traceurRuntime.setupGlobals = function(global) {
|
2028
|
+
setupGlobals(global);
|
2029
|
+
polyfill(global);
|
2030
|
+
};
|
2031
|
+
return {};
|
2032
|
+
});
|
2033
|
+
System.register("traceur-runtime@0.0.43/src/runtime/polyfill-import", [], function() {
|
2034
|
+
"use strict";
|
2035
|
+
var __moduleName = "traceur-runtime@0.0.43/src/runtime/polyfill-import";
|
2036
|
+
var $__30 = $traceurRuntime.assertObject(System.get("traceur-runtime@0.0.43/src/runtime/polyfills/polyfills"));
|
2037
|
+
return {};
|
2038
|
+
});
|
2039
|
+
System.get("traceur-runtime@0.0.43/src/runtime/polyfill-import" + '');
|