-
Notifications
You must be signed in to change notification settings - Fork 0
/
ChatClient.dart.js_
4030 lines (4001 loc) · 148 KB
/
ChatClient.dart.js_
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env node
function $defProp(obj, prop, value) {
Object.defineProperty(obj, prop,
{value: value, enumerable: false, writable: true, configurable: true});
}
function $throw(e) {
// If e is not a value, we can use V8's captureStackTrace utility method.
// TODO(jmesserly): capture the stack trace on other JS engines.
if (e && (typeof e == 'object') && Error.captureStackTrace) {
// TODO(jmesserly): this will clobber the e.stack property
Error.captureStackTrace(e, $throw);
}
throw e;
}
$defProp(Object.prototype, '$index', function(i) {
$throw(new NoSuchMethodException(this, "operator []", [i]));
});
$defProp(Array.prototype, '$index', function(index) {
var i = index | 0;
if (i !== index) {
throw new IllegalArgumentException('index is not int');
} else if (i < 0 || i >= this.length) {
throw new IndexOutOfRangeException(index);
}
return this[i];
});
$defProp(String.prototype, '$index', function(i) {
return this[i];
});
$defProp(Object.prototype, '$setindex', function(i, value) {
$throw(new NoSuchMethodException(this, "operator []=", [i, value]));
});
$defProp(Array.prototype, '$setindex', function(index, value) {
var i = index | 0;
if (i !== index) {
throw new IllegalArgumentException('index is not int');
} else if (i < 0 || i >= this.length) {
throw new IndexOutOfRangeException(index);
}
return this[i] = value;
});
function $wrap_call$0(fn) { return fn; }
function $wrap_call$1(fn) { return fn; };
function $wrap_call$2(fn) { return fn; };
function $add$complex$(x, y) {
if (typeof(x) == 'number') {
$throw(new IllegalArgumentException(y));
} else if (typeof(x) == 'string') {
var str = (y == null) ? 'null' : y.toString();
if (typeof(str) != 'string') {
throw new Error("calling toString() on right hand operand of operator " +
"+ did not return a String");
}
return x + str;
} else if (typeof(x) == 'object') {
return x.$add(y);
} else {
$throw(new NoSuchMethodException(x, "operator +", [y]));
}
}
function $add$(x, y) {
if (typeof(x) == 'number' && typeof(y) == 'number') return x + y;
return $add$complex$(x, y);
}
function $eq$(x, y) {
if (x == null) return y == null;
return (typeof(x) != 'object') ? x === y : x.$eq(y);
}
// TODO(jimhug): Should this or should it not match equals?
$defProp(Object.prototype, '$eq', function(other) {
return this === other;
});
function $ne$(x, y) {
if (x == null) return y != null;
return (typeof(x) != 'object') ? x !== y : !x.$eq(y);
}
function $truncdiv$(x, y) {
if (typeof(x) == 'number') {
if (typeof(y) == 'number') {
if (y == 0) $throw(new IntegerDivisionByZeroException());
var tmp = x / y;
return (tmp < 0) ? Math.ceil(tmp) : Math.floor(tmp);
} else {
$throw(new IllegalArgumentException(y));
}
} else if (typeof(x) == 'object') {
return x.$truncdiv(y);
} else {
$throw(new NoSuchMethodException(x, "operator ~/", [y]));
}
}
$defProp(Object.prototype, '$typeNameOf', (function() {
function constructorNameWithFallback(obj) {
var constructor = obj.constructor;
if (typeof(constructor) == 'function') {
// The constructor isn't null or undefined at this point. Try
// to grab hold of its name.
var name = constructor.name;
// If the name is a non-empty string, we use that as the type
// name of this object. On Firefox, we often get 'Object' as
// the constructor name even for more specialized objects so
// we have to fall through to the toString() based implementation
// below in that case.
if (typeof(name) == 'string' && name && name != 'Object') return name;
}
var string = Object.prototype.toString.call(obj);
return string.substring(8, string.length - 1);
}
function chrome$typeNameOf() {
var name = this.constructor.name;
if (name == 'Window') return 'DOMWindow';
if (name == 'CanvasPixelArray') return 'Uint8ClampedArray';
return name;
}
function firefox$typeNameOf() {
var name = constructorNameWithFallback(this);
if (name == 'Window') return 'DOMWindow';
if (name == 'Document') return 'HTMLDocument';
if (name == 'XMLDocument') return 'Document';
if (name == 'WorkerMessageEvent') return 'MessageEvent';
return name;
}
function ie$typeNameOf() {
var name = constructorNameWithFallback(this);
if (name == 'Window') return 'DOMWindow';
// IE calls both HTML and XML documents 'Document', so we check for the
// xmlVersion property, which is the empty string on HTML documents.
if (name == 'Document' && this.xmlVersion) return 'Document';
if (name == 'Document') return 'HTMLDocument';
if (name == 'HTMLTableDataCellElement') return 'HTMLTableCellElement';
if (name == 'HTMLTableHeaderCellElement') return 'HTMLTableCellElement';
if (name == 'MSStyleCSSProperties') return 'CSSStyleDeclaration';
if (name == 'CanvasPixelArray') return 'Uint8ClampedArray';
if (name == 'HTMLPhraseElement') return 'HTMLElement';
return name;
}
// If we're not in the browser, we're almost certainly running on v8.
if (typeof(navigator) != 'object') return chrome$typeNameOf;
var userAgent = navigator.userAgent;
if (/Chrome|DumpRenderTree/.test(userAgent)) return chrome$typeNameOf;
if (/Firefox/.test(userAgent)) return firefox$typeNameOf;
if (/MSIE/.test(userAgent)) return ie$typeNameOf;
return function() { return constructorNameWithFallback(this); };
})());
$defProp(Object.prototype, "get$typeName", Object.prototype.$typeNameOf);
/** Implements extends for Dart classes on JavaScript prototypes. */
function $inherits(child, parent) {
if (child.prototype.__proto__) {
child.prototype.__proto__ = parent.prototype;
} else {
function tmp() {};
tmp.prototype = parent.prototype;
child.prototype = new tmp();
child.prototype.constructor = child;
}
}
Function.prototype.bind = Function.prototype.bind ||
function(thisObj) {
var func = this;
var funcLength = func.$length || func.length;
var argsLength = arguments.length;
if (argsLength > 1) {
var boundArgs = Array.prototype.slice.call(arguments, 1);
var bound = function() {
// Prepend the bound arguments to the current arguments.
var newArgs = Array.prototype.slice.call(arguments);
Array.prototype.unshift.apply(newArgs, boundArgs);
return func.apply(thisObj, newArgs);
};
bound.$length = Math.max(0, funcLength - (argsLength - 1));
return bound;
} else {
var bound = function() {
return func.apply(thisObj, arguments);
};
bound.$length = funcLength;
return bound;
}
};
function $dynamic(name) {
var f = Object.prototype[name];
if (f && f.methods) return f.methods;
var methods = {};
if (f) methods.Object = f;
function $dynamicBind() {
// Find the target method
var obj = this;
var tag = obj.$typeNameOf();
var method = methods[tag];
if (!method) {
var table = $dynamicMetadata;
for (var i = 0; i < table.length; i++) {
var entry = table[i];
if (entry.map.hasOwnProperty(tag)) {
method = methods[entry.tag];
if (method) break;
}
}
}
method = method || methods.Object;
var proto = Object.getPrototypeOf(obj);
if (method == null) {
// Trampoline to throw NoSuchMethodException (TODO: call noSuchMethod).
method = function(){
// Exact type check to prevent this code shadowing the dispatcher from a
// subclass.
if (Object.getPrototypeOf(this) === proto) {
// TODO(sra): 'name' is the jsname, should be the Dart name.
$throw(new NoSuchMethodException(
obj, name, Array.prototype.slice.call(arguments)));
}
return Object.prototype[name].apply(this, arguments);
};
}
if (!proto.hasOwnProperty(name)) {
$defProp(proto, name, method);
}
return method.apply(this, Array.prototype.slice.call(arguments));
};
$dynamicBind.methods = methods;
$defProp(Object.prototype, name, $dynamicBind);
return methods;
}
if (typeof $dynamicMetadata == 'undefined') $dynamicMetadata = [];
function $dynamicSetMetadata(inputTable) {
// TODO: Deal with light isolates.
var table = [];
for (var i = 0; i < inputTable.length; i++) {
var tag = inputTable[i][0];
var tags = inputTable[i][1];
var map = {};
var tagNames = tags.split('|');
for (var j = 0; j < tagNames.length; j++) {
map[tagNames[j]] = true;
}
table.push({tag: tag, tags: tags, map: map});
}
$dynamicMetadata = table;
}
$defProp(Object.prototype, "get$dynamic", function() {
"use strict"; return this;
});
$defProp(Object.prototype, "noSuchMethod", function(name, args) {
$throw(new NoSuchMethodException(this, name, args));
});
$defProp(Object.prototype, "$dom_addEventListener$3", function($0, $1, $2) {
return this.noSuchMethod("$dom_addEventListener", [$0, $1, $2]);
});
$defProp(Object.prototype, "add$1", function($0) {
return this.noSuchMethod("add", [$0]);
});
$defProp(Object.prototype, "addParticipant$1", function($0) {
return this.noSuchMethod("addParticipant", [$0]);
});
$defProp(Object.prototype, "clear$0", function() {
return this.noSuchMethod("clear", []);
});
$defProp(Object.prototype, "end$0", function() {
return this.noSuchMethod("end", []);
});
$defProp(Object.prototype, "filter$1", function($0) {
return this.noSuchMethod("filter", [$0]);
});
$defProp(Object.prototype, "forEach$1", function($0) {
return this.noSuchMethod("forEach", [$0]);
});
$defProp(Object.prototype, "is$Collection", function() {
return false;
});
$defProp(Object.prototype, "is$List", function() {
return false;
});
$defProp(Object.prototype, "is$Map", function() {
return false;
});
$defProp(Object.prototype, "is$Map_dart_core_String$Dynamic", function() {
return false;
});
$defProp(Object.prototype, "is$RegExp", function() {
return false;
});
$defProp(Object.prototype, "is$html_Element", function() {
return false;
});
$defProp(Object.prototype, "query$1", function($0) {
return this.noSuchMethod("query", [$0]);
});
$defProp(Object.prototype, "remove$0", function() {
return this.noSuchMethod("remove", []);
});
$defProp(Object.prototype, "removeParticipant$1", function($0) {
return this.noSuchMethod("removeParticipant", [$0]);
});
$defProp(Object.prototype, "setParticipants$1", function($0) {
return this.noSuchMethod("setParticipants", [$0]);
});
$defProp(Object.prototype, "start$0", function() {
return this.noSuchMethod("start", []);
});
function IndexOutOfRangeException(_index) {
this._index = _index;
}
IndexOutOfRangeException.prototype.is$IndexOutOfRangeException = function(){return true};
IndexOutOfRangeException.prototype.toString = function() {
return ("IndexOutOfRangeException: " + this._index);
}
function NoSuchMethodException(_receiver, _functionName, _arguments, _existingArgumentNames) {
this._receiver = _receiver;
this._functionName = _functionName;
this._arguments = _arguments;
this._existingArgumentNames = _existingArgumentNames;
}
NoSuchMethodException.prototype.is$NoSuchMethodException = function(){return true};
NoSuchMethodException.prototype.toString = function() {
var sb = new StringBufferImpl("");
for (var i = (0);
i < this._arguments.get$length(); i++) {
if (i > (0)) {
sb.add(", ");
}
sb.add(this._arguments.$index(i));
}
if (null == this._existingArgumentNames) {
return (("NoSuchMethodException : method not found: '" + this._functionName + "'\n") + ("Receiver: " + this._receiver + "\n") + ("Arguments: [" + sb + "]"));
}
else {
var actualParameters = sb.toString();
sb = new StringBufferImpl("");
for (var i = (0);
i < this._existingArgumentNames.get$length(); i++) {
if (i > (0)) {
sb.add(", ");
}
sb.add(this._existingArgumentNames.$index(i));
}
var formalParameters = sb.toString();
return ("NoSuchMethodException: incorrect number of arguments passed to " + ("method named '" + this._functionName + "'\nReceiver: " + this._receiver + "\n") + ("Tried calling: " + this._functionName + "(" + actualParameters + ")\n") + ("Found: " + this._functionName + "(" + formalParameters + ")"));
}
}
function ClosureArgumentMismatchException() {
}
ClosureArgumentMismatchException.prototype.toString = function() {
return "Closure argument mismatch";
}
function ObjectNotClosureException() {
}
ObjectNotClosureException.prototype.toString = function() {
return "Object is not closure";
}
function IllegalArgumentException(arg) {
this._arg = arg;
}
IllegalArgumentException.prototype.is$IllegalArgumentException = function(){return true};
IllegalArgumentException.prototype.toString = function() {
return ("Illegal argument(s): " + this._arg);
}
function StackOverflowException() {
}
StackOverflowException.prototype.toString = function() {
return "Stack Overflow";
}
function NullPointerException(functionName, arguments) {
this.functionName = functionName;
this.arguments = arguments;
}
NullPointerException.prototype.toString = function() {
if (this.functionName == null) {
return this.get$exceptionName();
}
else {
return (("" + this.get$exceptionName() + " : method: '" + this.functionName + "'\n") + "Receiver: null\n" + ("Arguments: " + this.arguments));
}
}
NullPointerException.prototype.get$exceptionName = function() {
return "NullPointerException";
}
function NoMoreElementsException() {
}
NoMoreElementsException.prototype.toString = function() {
return "NoMoreElementsException";
}
function EmptyQueueException() {
}
EmptyQueueException.prototype.toString = function() {
return "EmptyQueueException";
}
function UnsupportedOperationException(_message) {
this._message = _message;
}
UnsupportedOperationException.prototype.toString = function() {
return ("UnsupportedOperationException: " + this._message);
}
function IntegerDivisionByZeroException() {
}
IntegerDivisionByZeroException.prototype.is$IntegerDivisionByZeroException = function(){return true};
IntegerDivisionByZeroException.prototype.toString = function() {
return "IntegerDivisionByZeroException";
}
Function.prototype.to$call$0 = function() {
this.call$0 = this._genStub(0);
this.to$call$0 = function() { return this.call$0; };
return this.call$0;
};
Function.prototype.call$0 = function() {
return this.to$call$0()();
};
function to$call$0(f) { return f && f.to$call$0(); }
Function.prototype.to$call$1 = function() {
this.call$1 = this._genStub(1);
this.to$call$1 = function() { return this.call$1; };
return this.call$1;
};
Function.prototype.call$1 = function($0) {
return this.to$call$1()($0);
};
function to$call$1(f) { return f && f.to$call$1(); }
Function.prototype.to$call$2 = function() {
this.call$2 = this._genStub(2);
this.to$call$2 = function() { return this.call$2; };
return this.call$2;
};
Function.prototype.call$2 = function($0, $1) {
return this.to$call$2()($0, $1);
};
function to$call$2(f) { return f && f.to$call$2(); }
function Strings() {}
Strings.join = function(strings, separator) {
return StringBase.join(strings, separator);
}
function print$(obj) {
return _print(obj);
}
function _print(obj) {
if (typeof console == 'object') {
if (obj) obj = obj.toString();
console.log(obj);
} else if (typeof write === 'function') {
write(obj);
write('\n');
}
}
function _toDartException(e) {
function attachStack(dartEx) {
// TODO(jmesserly): setting the stack property is not a long term solution.
var stack = e.stack;
// The stack contains the error message, and the stack is all that is
// printed (the exception's toString() is never called). Make the Dart
// exception's toString() be the dominant message.
if (typeof stack == 'string') {
var message = dartEx.toString();
if (/^(Type|Range)Error:/.test(stack)) {
// Indent JS message (it can be helpful) so new message stands out.
stack = ' (' + stack.substring(0, stack.indexOf('\n')) + ')\n' +
stack.substring(stack.indexOf('\n') + 1);
}
stack = message + '\n' + stack;
}
dartEx.stack = stack;
return dartEx;
}
if (e instanceof TypeError) {
switch(e.type) {
case 'property_not_function':
case 'called_non_callable':
if (e.arguments[0] == null) {
return attachStack(new NullPointerException(null, []));
} else {
return attachStack(new ObjectNotClosureException());
}
break;
case 'non_object_property_call':
case 'non_object_property_load':
return attachStack(new NullPointerException(null, []));
break;
case 'undefined_method':
var mname = e.arguments[0];
if (typeof(mname) == 'string' && (mname.indexOf('call$') == 0
|| mname == 'call' || mname == 'apply')) {
return attachStack(new ObjectNotClosureException());
} else {
// TODO(jmesserly): fix noSuchMethod on operators so we don't hit this
return attachStack(new NoSuchMethodException('', e.arguments[0], []));
}
break;
}
} else if (e instanceof RangeError) {
if (e.message.indexOf('call stack') >= 0) {
return attachStack(new StackOverflowException());
}
}
return e;
}
var ListFactory = Array;
$defProp(ListFactory.prototype, "is$List", function(){return true});
$defProp(ListFactory.prototype, "is$Collection", function(){return true});
ListFactory.ListFactory$from$factory = function(other) {
var list = [];
for (var $$i = other.iterator(); $$i.hasNext(); ) {
var e = $$i.next();
list.add$1(e);
}
return list;
}
$defProp(ListFactory.prototype, "get$length", function() { return this.length; });
$defProp(ListFactory.prototype, "set$length", function(value) { return this.length = value; });
$defProp(ListFactory.prototype, "add", function(value) {
this.push(value);
});
$defProp(ListFactory.prototype, "addAll", function(collection) {
for (var $$i = collection.iterator(); $$i.hasNext(); ) {
var item = $$i.next();
this.add(item);
}
});
$defProp(ListFactory.prototype, "clear$_", function() {
this.set$length((0));
});
$defProp(ListFactory.prototype, "removeLast", function() {
return this.pop();
});
$defProp(ListFactory.prototype, "last", function() {
return this.$index(this.get$length() - (1));
});
$defProp(ListFactory.prototype, "iterator", function() {
return new ListIterator(this);
});
$defProp(ListFactory.prototype, "toString", function() {
return Collections.collectionToString(this);
});
$defProp(ListFactory.prototype, "add$1", ListFactory.prototype.add);
$defProp(ListFactory.prototype, "clear$0", ListFactory.prototype.clear$_);
$defProp(ListFactory.prototype, "filter$1", function($0) {
return this.filter(to$call$1($0));
});
$defProp(ListFactory.prototype, "forEach$1", function($0) {
return this.forEach(to$call$1($0));
});
function ListIterator(array) {
this._array = array;
this._pos = (0);
}
ListIterator.prototype.hasNext = function() {
return this._array.get$length() > this._pos;
}
ListIterator.prototype.next = function() {
if (!this.hasNext()) {
$throw(const$0001);
}
return this._array.$index(this._pos++);
}
function JSSyntaxRegExp(pattern, multiLine, ignoreCase) {
JSSyntaxRegExp._create$ctor.call(this, pattern, $add$(($eq$(multiLine, true) ? "m" : ""), ($eq$(ignoreCase, true) ? "i" : "")));
}
JSSyntaxRegExp._create$ctor = function(pattern, flags) {
this.re = new RegExp(pattern, flags);
this.pattern = pattern;
this.multiLine = this.re.multiline;
this.ignoreCase = this.re.ignoreCase;
}
JSSyntaxRegExp._create$ctor.prototype = JSSyntaxRegExp.prototype;
JSSyntaxRegExp.prototype.is$RegExp = function(){return true};
JSSyntaxRegExp.prototype.firstMatch = function(str) {
var m = this._exec(str);
return m == null ? null : new MatchImplementation(this.pattern, str, this._matchStart(m), this.get$_lastIndex(), m);
}
JSSyntaxRegExp.prototype._exec = function(str) {
return this.re.exec(str);
}
JSSyntaxRegExp.prototype._matchStart = function(m) {
return m.index;
}
JSSyntaxRegExp.prototype.get$_lastIndex = function() {
return this.re.lastIndex;
}
JSSyntaxRegExp.prototype.hasMatch = function(str) {
return this.re.test(str);
}
JSSyntaxRegExp.prototype.allMatches = function(str) {
return new _AllMatchesIterable(this, str);
}
JSSyntaxRegExp.prototype.get$_global = function() {
return new JSSyntaxRegExp._create$ctor(this.pattern, $add$($add$("g", (this.multiLine ? "m" : "")), (this.ignoreCase ? "i" : "")));
}
function MatchImplementation(pattern, str, _start, _end, _groups) {
this.pattern = pattern;
this.str = str;
this._start = _start;
this._end = _end;
this._groups = _groups;
}
MatchImplementation.prototype.start = function() {
return this._start;
}
MatchImplementation.prototype.end = function() {
return this._end;
}
MatchImplementation.prototype.$index = function(groupIndex) {
return this._groups.$index(groupIndex);
}
MatchImplementation.prototype.end$0 = MatchImplementation.prototype.end;
MatchImplementation.prototype.start$0 = MatchImplementation.prototype.start;
function _AllMatchesIterable(_re, _str) {
this._re = _re;
this._str = _str;
}
_AllMatchesIterable.prototype.iterator = function() {
return new _AllMatchesIterator(this._re, this._str);
}
function _AllMatchesIterator(re, _str) {
this._str = _str;
this._done = false;
this._re = re.get$_global();
}
_AllMatchesIterator.prototype.next = function() {
if (!this.hasNext()) {
$throw(const$0001);
}
var result = this._next;
this._next = null;
return result;
}
_AllMatchesIterator.prototype.hasNext = function() {
if (this._done) {
return false;
}
else if (this._next != null) {
return true;
}
this._next = this._re.firstMatch(this._str);
if (this._next == null) {
this._done = true;
return false;
}
else {
return true;
}
}
var NumImplementation = Number;
NumImplementation.prototype.abs = function() {
'use strict'; return Math.abs(this);
}
NumImplementation.prototype.hashCode = function() {
'use strict'; return this & 0x1FFFFFFF;
}
function Collections() {}
Collections.collectionToString = function(c) {
var result = new StringBufferImpl("");
Collections._emitCollection(c, result, new Array());
return result.toString();
}
Collections._emitCollection = function(c, result, visiting) {
visiting.add(c);
var isList = !!(c && c.is$List());
result.add(isList ? "[" : "{");
var first = true;
for (var $$i = c.iterator(); $$i.hasNext(); ) {
var e = $$i.next();
if (!first) {
result.add(", ");
}
first = false;
Collections._emitObject(e, result, visiting);
}
result.add(isList ? "]" : "}");
visiting.removeLast();
}
Collections._emitObject = function(o, result, visiting) {
if (!!(o && o.is$Collection())) {
if (Collections._containsRef(visiting, o)) {
result.add(!!(o && o.is$List()) ? "[...]" : "{...}");
}
else {
Collections._emitCollection(o, result, visiting);
}
}
else if (!!(o && o.is$Map())) {
if (Collections._containsRef(visiting, o)) {
result.add("{...}");
}
else {
Maps._emitMap(o, result, visiting);
}
}
else {
result.add($eq$(o) ? "null" : o);
}
}
Collections._containsRef = function(c, ref) {
for (var $$i = c.iterator(); $$i.hasNext(); ) {
var e = $$i.next();
if ((null == e ? null == (ref) : e === ref)) return true;
}
return false;
}
function HashMapImplementation() {
this._numberOfEntries = (0);
this._numberOfDeleted = (0);
this._loadLimit = HashMapImplementation._computeLoadLimit((8));
this._keys = new Array((8));
this._values = new Array((8));
}
HashMapImplementation.prototype.is$Map = function(){return true};
HashMapImplementation.prototype.is$Map_dart_core_String$Dynamic = function(){return true};
HashMapImplementation._computeLoadLimit = function(capacity) {
return $truncdiv$((capacity * (3)), (4));
}
HashMapImplementation._firstProbe = function(hashCode, length) {
return hashCode & (length - (1));
}
HashMapImplementation._nextProbe = function(currentProbe, numberOfProbes, length) {
return (currentProbe + numberOfProbes) & (length - (1));
}
HashMapImplementation.prototype._probeForAdding = function(key) {
var hash = HashMapImplementation._firstProbe(key.hashCode(), this._keys.get$length());
var numberOfProbes = (1);
var initialHash = hash;
var insertionIndex = (-1);
while (true) {
var existingKey = this._keys.$index(hash);
if (null == existingKey) {
if (insertionIndex < (0)) return hash;
return insertionIndex;
}
else if ($eq$(existingKey, key)) {
return hash;
}
else if ((insertionIndex < (0)) && ((null == const$0000 ? null == (existingKey) : const$0000 === existingKey))) {
insertionIndex = hash;
}
hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.get$length());
}
}
HashMapImplementation.prototype._probeForLookup = function(key) {
var hash = HashMapImplementation._firstProbe(key.hashCode(), this._keys.get$length());
var numberOfProbes = (1);
var initialHash = hash;
while (true) {
var existingKey = this._keys.$index(hash);
if (null == existingKey) return (-1);
if ($eq$(existingKey, key)) return hash;
hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.get$length());
}
}
HashMapImplementation.prototype._ensureCapacity = function() {
var newNumberOfEntries = this._numberOfEntries + (1);
if (newNumberOfEntries >= this._loadLimit) {
this._grow(this._keys.get$length() * (2));
return;
}
var capacity = this._keys.get$length();
var numberOfFreeOrDeleted = capacity - newNumberOfEntries;
var numberOfFree = numberOfFreeOrDeleted - this._numberOfDeleted;
if (this._numberOfDeleted > numberOfFree) {
this._grow(this._keys.get$length());
}
}
HashMapImplementation._isPowerOfTwo = function(x) {
return ((x & (x - (1))) == (0));
}
HashMapImplementation.prototype._grow = function(newCapacity) {
var capacity = this._keys.get$length();
this._loadLimit = HashMapImplementation._computeLoadLimit(newCapacity);
var oldKeys = this._keys;
var oldValues = this._values;
this._keys = new Array(newCapacity);
this._values = new Array(newCapacity);
for (var i = (0);
i < capacity; i++) {
var key = oldKeys.$index(i);
if (null == key || (null == key ? null == (const$0000) : key === const$0000)) {
continue;
}
var value = oldValues.$index(i);
var newIndex = this._probeForAdding(key);
this._keys.$setindex(newIndex, key);
this._values.$setindex(newIndex, value);
}
this._numberOfDeleted = (0);
}
HashMapImplementation.prototype.clear$_ = function() {
this._numberOfEntries = (0);
this._numberOfDeleted = (0);
var length = this._keys.get$length();
for (var i = (0);
i < length; i++) {
this._keys.$setindex(i);
this._values.$setindex(i);
}
}
HashMapImplementation.prototype.$setindex = function(key, value) {
var $0;
this._ensureCapacity();
var index = this._probeForAdding(key);
if ((null == this._keys.$index(index)) || ((($0 = this._keys.$index(index)) == null ? null == (const$0000) : $0 === const$0000))) {
this._numberOfEntries++;
}
this._keys.$setindex(index, key);
this._values.$setindex(index, value);
}
HashMapImplementation.prototype.$index = function(key) {
var index = this._probeForLookup(key);
if (index < (0)) return null;
return this._values.$index(index);
}
HashMapImplementation.prototype.remove = function(key) {
var index = this._probeForLookup(key);
if (index >= (0)) {
this._numberOfEntries--;
var value = this._values.$index(index);
this._values.$setindex(index);
this._keys.$setindex(index, const$0000);
this._numberOfDeleted++;
return value;
}
return null;
}
HashMapImplementation.prototype.get$length = function() {
return this._numberOfEntries;
}
HashMapImplementation.prototype.forEach = function(f) {
var length = this._keys.get$length();
for (var i = (0);
i < length; i++) {
var key = this._keys.$index(i);
if ((null != key) && ((null == key ? null != (const$0000) : key !== const$0000))) {
f(key, this._values.$index(i));
}
}
}
HashMapImplementation.prototype.getKeys = function() {
var list = new Array(this.get$length());
var i = (0);
this.forEach(function _(key, value) {
list.$setindex(i++, key);
}
);
return list;
}
HashMapImplementation.prototype.containsKey = function(key) {
return (this._probeForLookup(key) != (-1));
}
HashMapImplementation.prototype.toString = function() {
return Maps.mapToString(this);
}
HashMapImplementation.prototype.clear$0 = HashMapImplementation.prototype.clear$_;
HashMapImplementation.prototype.forEach$1 = function($0) {
return this.forEach(to$call$2($0));
};
$inherits(HashMapImplementation_Dynamic$DoubleLinkedQueueEntry_KeyValuePair, HashMapImplementation);
function HashMapImplementation_Dynamic$DoubleLinkedQueueEntry_KeyValuePair() {
this._numberOfEntries = (0);
this._numberOfDeleted = (0);
this._loadLimit = HashMapImplementation._computeLoadLimit((8));
this._keys = new Array((8));
this._values = new Array((8));
}
HashMapImplementation_Dynamic$DoubleLinkedQueueEntry_KeyValuePair.prototype.clear$0 = HashMapImplementation_Dynamic$DoubleLinkedQueueEntry_KeyValuePair.prototype.clear$_;
HashMapImplementation_Dynamic$DoubleLinkedQueueEntry_KeyValuePair.prototype.forEach$1 = function($0) {
return this.forEach(to$call$2($0));
};
$inherits(HashMapImplementation_dart_core_String$View, HashMapImplementation);
function HashMapImplementation_dart_core_String$View() {
this._numberOfEntries = (0);
this._numberOfDeleted = (0);
this._loadLimit = HashMapImplementation._computeLoadLimit((8));
this._keys = new Array((8));
this._values = new Array((8));
}
HashMapImplementation_dart_core_String$View.prototype.clear$0 = HashMapImplementation_dart_core_String$View.prototype.clear$_;
HashMapImplementation_dart_core_String$View.prototype.forEach$1 = function($0) {
return this.forEach(to$call$2($0));
};
$inherits(HashMapImplementation_dart_core_String$dart_core_String, HashMapImplementation);
function HashMapImplementation_dart_core_String$dart_core_String() {
this._numberOfEntries = (0);
this._numberOfDeleted = (0);
this._loadLimit = HashMapImplementation._computeLoadLimit((8));
this._keys = new Array((8));
this._values = new Array((8));
}
HashMapImplementation_dart_core_String$dart_core_String.prototype.clear$0 = HashMapImplementation_dart_core_String$dart_core_String.prototype.clear$_;
HashMapImplementation_dart_core_String$dart_core_String.prototype.forEach$1 = function($0) {
return this.forEach(to$call$2($0));
};
$inherits(HashMapImplementation_dart_core_String$DivElement, HashMapImplementation);
function HashMapImplementation_dart_core_String$DivElement() {
this._numberOfEntries = (0);
this._numberOfDeleted = (0);
this._loadLimit = HashMapImplementation._computeLoadLimit((8));
this._keys = new Array((8));
this._values = new Array((8));
}
HashMapImplementation_dart_core_String$DivElement.prototype.clear$0 = HashMapImplementation_dart_core_String$DivElement.prototype.clear$_;
HashMapImplementation_dart_core_String$DivElement.prototype.forEach$1 = function($0) {
return this.forEach(to$call$2($0));
};
function HashSetImplementation() {
this._backingMap = new HashMapImplementation();
}
HashSetImplementation.prototype.is$Collection = function(){return true};
HashSetImplementation.prototype.clear$_ = function() {
this._backingMap.clear$_();
}
HashSetImplementation.prototype.add = function(value) {
this._backingMap.$setindex(value, value);
}
HashSetImplementation.prototype.addAll = function(collection) {
var $this = this;
collection.forEach$1(function _(value) {
$this.add(value);
}
);
}
HashSetImplementation.prototype.forEach = function(f) {
this._backingMap.forEach(function _(key, value) {
f(key);
}
);
}
HashSetImplementation.prototype.filter = function(f) {
var result = new HashSetImplementation();
this._backingMap.forEach(function _(key, value) {
if (f(key)) result.add(key);
}
);
return result;
}
HashSetImplementation.prototype.get$length = function() {
return this._backingMap.get$length();
}
HashSetImplementation.prototype.iterator = function() {
return new HashSetIterator(this);
}
HashSetImplementation.prototype.toString = function() {
return Collections.collectionToString(this);
}
HashSetImplementation.prototype.add$1 = HashSetImplementation.prototype.add;
HashSetImplementation.prototype.clear$0 = HashSetImplementation.prototype.clear$_;
HashSetImplementation.prototype.filter$1 = function($0) {
return this.filter(to$call$1($0));
};
HashSetImplementation.prototype.forEach$1 = function($0) {
return this.forEach(to$call$1($0));
};
$inherits(HashSetImplementation_dart_core_String, HashSetImplementation);
function HashSetImplementation_dart_core_String() {
this._backingMap = new HashMapImplementation_dart_core_String$dart_core_String();
}
HashSetImplementation_dart_core_String.prototype.add$1 = HashSetImplementation_dart_core_String.prototype.add;
function HashSetIterator(set_) {
this._nextValidIndex = (-1);
this._entries = set_._backingMap._keys;
this._advance();
}
HashSetIterator.prototype.hasNext = function() {
var $0;
if (this._nextValidIndex >= this._entries.get$length()) return false;
if ((($0 = this._entries.$index(this._nextValidIndex)) == null ? null == (const$0000) : $0 === const$0000)) {
this._advance();
}
return this._nextValidIndex < this._entries.get$length();
}
HashSetIterator.prototype.next = function() {
if (!this.hasNext()) {
$throw(const$0001);
}
var res = this._entries.$index(this._nextValidIndex);
this._advance();
return res;
}
HashSetIterator.prototype._advance = function() {
var length = this._entries.get$length();
var entry;
var deletedKey = const$0000;
do {
if (++this._nextValidIndex >= length) break;
entry = this._entries.$index(this._nextValidIndex);
}
while ((null == entry) || ((null == entry ? null == (deletedKey) : entry === deletedKey)))
}
function _DeletedKeySentinel() {