Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(235)

Unified Diff: src/site/codelabs/darrrt/examples/6-piratebadge_json/piratebadge.dart.js

Issue 35913002: Try Dart 1 hour experience first draft (Closed) Base URL: https://github.com/dart-lang/dartlang.org.git@master
Patch Set: updated image of dart editor with new directory name Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/site/codelabs/darrrt/examples/6-piratebadge_json/piratebadge.dart.js
diff --git a/src/site/samples/geolocation/example/trip_meter.dart.js b/src/site/codelabs/darrrt/examples/6-piratebadge_json/piratebadge.dart.js
similarity index 78%
copy from src/site/samples/geolocation/example/trip_meter.dart.js
copy to src/site/codelabs/darrrt/examples/6-piratebadge_json/piratebadge.dart.js
index 54ce7bf4a7cf4497d4c7b3aa6ca45f1808c09a5c..ec9e052829a1514ed0f5331eb805f65174bb947b 100644
--- a/src/site/samples/geolocation/example/trip_meter.dart.js
+++ b/src/site/codelabs/darrrt/examples/6-piratebadge_json/piratebadge.dart.js
@@ -65,19 +65,33 @@ var $$ = {};
// Native classes
// Method closures
-$$.BoundClosure$2 = [P, {"": "BoundClosure;_self,_target,_receiver,__js_helper$_name",
+$$.BoundClosure$i0 = [H, {"": "BoundClosure;_self,__js_helper$_target,_receiver,__js_helper$_name",
+ call$0: function() {
+ return this.__js_helper$_target.call(this._self, this._receiver);
+ }
+}];
+
+$$.BoundClosure$1 = [H, {"": "BoundClosure;_self,__js_helper$_target,_receiver,__js_helper$_name",
+ call$1: function(p0) {
+ return this.__js_helper$_target.call(this._self, p0);
+ },
+ $is_args1: true
+}];
+
+$$.BoundClosure$2 = [P, {"": "BoundClosure;_self,__js_helper$_target,_receiver,__js_helper$_name",
call$2: function(p0, p1) {
- return this._target.call(this._self, p0, p1);
+ return this.__js_helper$_target.call(this._self, p0, p1);
},
call$1: function(p0) {
return this.call$2(p0, null);
},
- $is_args2: true
+ $is_args2: true,
+ $is_args1: true
}];
-$$.BoundClosure$0 = [P, {"": "BoundClosure;_self,_target,_receiver,__js_helper$_name",
+$$.BoundClosure$0 = [P, {"": "BoundClosure;_self,__js_helper$_target,_receiver,__js_helper$_name",
call$0: function() {
- return this._target.call(this._self);
+ return this.__js_helper$_target.call(this._self);
}
}];
@@ -87,13 +101,14 @@ $$.Closure$0 = [H, {"": "Closure;call$0,$name"}];
$$.Closure$7 = [H, {"": "Closure;call$7,$name"}];
-$$.Closure$1 = [H, {"": "Closure;call$1,$name"}];
+$$.Closure$1 = [H, {"": "Closure;call$1,$name", $is_args1: true}];
$$.Closure$21 = [P, {"": "Closure;call$2,$name",
call$1: function(p0) {
return this.call$2(p0, null);
},
- $is_args2: true
+ $is_args2: true,
+ $is_args1: true
}];
(function (reflectionData) {
@@ -181,7 +196,7 @@ $$.Closure$21 = [P, {"": "Closure;call$2,$name",
}
})([
["_foreign_helper", "dart:_foreign_helper", , H, {
-JS_CONST: {"": "Object;code>"}}],
+JS_CONST: {"": "Object;code"}}],
["_interceptors", "dart:_interceptors", , J, {
getInterceptor: function(object) {
return void 0;
@@ -194,6 +209,11 @@ makeDispatchRecord: function(interceptor, proto, extension, indexability) {
getNativeInterceptor: function(object) {
var record, proto, objectProto;
record = object[init.dispatchPropertyName];
+ if (record == null)
+ if ($.initNativeDispatchFlag == null) {
+ H.initNativeDispatch();
+ record = object[init.dispatchPropertyName];
+ }
if (record != null) {
proto = record.p;
if (false === proto)
@@ -258,18 +278,6 @@ PlainJavaScriptObject: {"": "JavaScriptObject;"},
UnknownJavaScriptObject: {"": "JavaScriptObject;"},
JSArray: {"": "List/Interceptor;",
- add$1: function(receiver, value) {
- if (!!receiver.fixed$length)
- H.throwExpression(P.UnsupportedError$("add"));
- receiver.push(value);
- },
- removeLast$0: function(receiver) {
- if (!!receiver.fixed$length)
- H.throwExpression(P.UnsupportedError$("removeLast"));
- if (receiver.length === 0)
- throw H.wrapException(P.RangeError$value(-1));
- return receiver.pop();
- },
forEach$1: function(receiver, f) {
return H.IterableMixinWorkaround_forEach(receiver, f);
},
@@ -278,9 +286,18 @@ JSArray: {"": "List/Interceptor;",
throw H.ioore(receiver, index);
return receiver[index];
},
+ get$isEmpty: function(receiver) {
+ return receiver.length === 0;
+ },
toString$0: function(receiver) {
return H.IterableMixinWorkaround_toStringIterable(receiver, "[", "]");
},
+ toList$1$growable: function(receiver, growable) {
+ return P.List_List$from(receiver, growable, H.getRuntimeTypeArgument(receiver, "JSArray", 0));
+ },
+ toList$0: function($receiver) {
+ return this.toList$1$growable($receiver, true);
+ },
get$iterator: function(receiver) {
return new H.ListIterator(receiver, receiver.length, 0, null);
},
@@ -323,7 +340,7 @@ JSMutableArray: {"": "JSArray;", $isJSMutableArray: true,
JSFixedArray: {"": "JSMutableArray;"},
-JSExtendableArray: {"": "JSMutableArray;", $isJSExtendableArray: true},
+JSExtendableArray: {"": "JSMutableArray;"},
JSNumber: {"": "num/Interceptor;",
remainder$1: function(receiver, b) {
@@ -331,6 +348,8 @@ JSNumber: {"": "num/Interceptor;",
},
toInt$0: function(receiver) {
var t1;
+ if (receiver >= -2147483648 && receiver <= 2147483647)
+ return receiver | 0;
if (isFinite(receiver)) {
t1 = receiver < 0 ? Math.ceil(receiver) : Math.floor(receiver);
return t1 + 0;
@@ -347,11 +366,17 @@ JSNumber: {"": "num/Interceptor;",
return receiver & 0x1FFFFFFF;
},
$tdiv: function(receiver, other) {
+ if ((receiver | 0) === receiver && (other | 0) === other && 0 !== other && -1 !== other)
+ return receiver / other | 0;
+ else
+ return this._slowTdiv$1(receiver, other);
+ },
+ _slowTdiv$1: function(receiver, other) {
return this.toInt$0(receiver / other);
},
$shr: function(receiver, other) {
if (other < 0)
- throw H.wrapException(P.ArgumentError$(other));
+ throw H.wrapException(new P.ArgumentError(other));
if (receiver > 0) {
if (other > 31)
return 0;
@@ -363,7 +388,7 @@ JSNumber: {"": "num/Interceptor;",
},
$lt: function(receiver, other) {
if (typeof other !== "number")
- throw H.wrapException(P.ArgumentError$(other));
+ throw H.wrapException(new P.ArgumentError(other));
return receiver < other;
},
$gt: function(receiver, other) {
@@ -373,10 +398,14 @@ JSNumber: {"": "num/Interceptor;",
},
$ge: function(receiver, other) {
if (typeof other !== "number")
- throw H.wrapException(P.ArgumentError$(other));
+ throw H.wrapException(new P.ArgumentError(other));
return receiver >= other;
},
- $isnum: true
+ $isnum: true,
+ static: {
+"": "JSNumber__MIN_INT32,JSNumber__MAX_INT32",
+}
+
},
JSInt: {"": "int/JSNumber;", $isdouble: true, $isnum: true, $isint: true},
@@ -409,6 +438,35 @@ JSString: {"": "String/Interceptor;",
substring$1: function($receiver, startIndex) {
return this.substring$2($receiver, startIndex, null);
},
+ trim$0: function(receiver) {
+ var endIndex, startIndex, codeUnit, endIndex0, endIndex1;
+ for (endIndex = receiver.length, startIndex = 0; startIndex < endIndex;) {
+ if (startIndex >= endIndex)
+ H.throwExpression(P.RangeError$value(startIndex));
+ codeUnit = receiver.charCodeAt(startIndex);
+ if (codeUnit === 32 || codeUnit === 13 || J.JSString__isWhitespace(codeUnit))
+ ++startIndex;
+ else
+ break;
+ }
+ if (startIndex === endIndex)
+ return "";
+ for (endIndex0 = endIndex; true; endIndex0 = endIndex1) {
+ endIndex1 = endIndex0 - 1;
+ if (endIndex1 < 0)
+ H.throwExpression(P.RangeError$value(endIndex1));
+ if (endIndex1 >= endIndex)
+ H.throwExpression(P.RangeError$value(endIndex1));
+ codeUnit = receiver.charCodeAt(endIndex1);
+ if (codeUnit === 32 || codeUnit === 13 || J.JSString__isWhitespace(codeUnit))
+ ;
+ else
+ break;
+ }
+ if (startIndex === 0 && endIndex0 === endIndex)
+ return receiver;
+ return receiver.substring(startIndex, endIndex0);
+ },
get$isEmpty: function(receiver) {
return receiver.length === 0;
},
@@ -436,7 +494,49 @@ JSString: {"": "String/Interceptor;",
throw H.wrapException(P.RangeError$value(index));
return receiver[index];
},
- $isString: true
+ $isString: true,
+ static: {
+JSString__isWhitespace: function(codeUnit) {
+ if (codeUnit < 256)
+ switch (codeUnit) {
+ case 9:
+ case 10:
+ case 11:
+ case 12:
+ case 13:
+ case 32:
+ case 133:
+ case 160:
+ return true;
+ default:
+ return false;
+ }
+ switch (codeUnit) {
+ case 5760:
+ case 6158:
+ case 8192:
+ case 8193:
+ case 8194:
+ case 8195:
+ case 8196:
+ case 8197:
+ case 8198:
+ case 8199:
+ case 8200:
+ case 8201:
+ case 8202:
+ case 8232:
+ case 8233:
+ case 8239:
+ case 8287:
+ case 12288:
+ case 65279:
+ return true;
+ default:
+ return false;
+ }
+}}
+
}}],
["_isolate_helper", "dart:_isolate_helper", , H, {
_callInIsolate: function(isolate, $function) {
@@ -446,14 +546,20 @@ _callInIsolate: function(isolate, $function) {
},
startRootIsolate: function(entry) {
- var rootContext;
+ var rootContext, t1;
$globalState = H._Manager$(entry);
if ($globalState.isWorker === true)
return;
rootContext = H._IsolateContext$();
$globalState.rootContext = rootContext;
$globalState.currentContext = rootContext;
- rootContext.eval$1(entry);
+ t1 = J.getInterceptor(entry);
+ if (!!t1.$is_args1)
+ rootContext.eval$1(new H.startRootIsolate_closure(entry));
+ else if (!!t1.$is_args2)
+ rootContext.eval$1(new H.startRootIsolate_closure0(entry));
+ else
+ rootContext.eval$1(entry);
$globalState.topEventLoop.run$0();
},
@@ -486,7 +592,7 @@ IsolateNatives_computeThisScriptD8: function() {
},
IsolateNatives__processWorkerMessage: function(sender, e) {
- var msg, t1, functionName, entryPoint, replyTo, context, t2;
+ var msg, t1, functionName, entryPoint, args, message, isSpawnUri, replyTo, context, t2;
msg = H._deserializeMessage(e.data);
t1 = J.getInterceptor$asx(msg);
switch (t1.$index(msg, "command")) {
@@ -494,18 +600,21 @@ IsolateNatives__processWorkerMessage: function(sender, e) {
$globalState.currentManagerId = t1.$index(msg, "id");
functionName = t1.$index(msg, "functionName");
entryPoint = functionName == null ? $globalState.entry : init.globalFunctions[functionName];
+ args = t1.$index(msg, "args");
+ message = H._deserializeMessage(t1.$index(msg, "msg"));
+ isSpawnUri = t1.$index(msg, "isSpawnUri");
replyTo = H._deserializeMessage(t1.$index(msg, "replyTo"));
context = H._IsolateContext$();
- $globalState.topEventLoop.events._add$1(new H._IsolateEvent(context, new H.IsolateNatives__processWorkerMessage_closure(entryPoint, replyTo), "worker-start"));
+ $globalState.topEventLoop.events._add$1(new H._IsolateEvent(context, new H.IsolateNatives__processWorkerMessage_closure(entryPoint, args, message, isSpawnUri, replyTo), "worker-start"));
$globalState.currentContext = context;
$globalState.topEventLoop.run$0();
break;
case "spawn-worker":
- H.IsolateNatives__spawnWorker(t1.$index(msg, "functionName"), t1.$index(msg, "uri"), t1.$index(msg, "replyPort"));
+ H.IsolateNatives__spawnWorker(t1.$index(msg, "functionName"), t1.$index(msg, "uri"), t1.$index(msg, "args"), t1.$index(msg, "msg"), t1.$index(msg, "isSpawnUri"), t1.$index(msg, "replyPort"));
break;
case "message":
if (t1.$index(msg, "port") != null)
- t1.$index(msg, "port").send$2(t1.$index(msg, "msg"), t1.$index(msg, "replyTo"));
+ J.send$1$x(t1.$index(msg, "port"), t1.$index(msg, "msg"));
$globalState.topEventLoop.run$0();
break;
case "close":
@@ -551,17 +660,27 @@ IsolateNatives__log: function(msg) {
},
-IsolateNatives__startIsolate: function(topLevel, replyTo) {
+IsolateNatives__startIsolate: function(topLevel, args, message, isSpawnUri, replyTo) {
var t1;
H.Primitives_initializeStatics($globalState.currentContext.id);
$.lazyPort = H.ReceivePortImpl$();
- t1 = P._Isolate_port();
+ t1 = $.lazyPort;
t1.toString;
- replyTo.send$2("spawned", new H._NativeJsSendPort(t1, $globalState.currentContext.id));
- topLevel.call$0();
+ J.send$1$x(replyTo, ["spawned", new H._NativeJsSendPort(t1, $globalState.currentContext.id)]);
+ if (isSpawnUri !== true)
+ topLevel.call$1(message);
+ else {
+ t1 = J.getInterceptor(topLevel);
+ if (!!t1.$is_args2)
+ topLevel.call$2(args, message);
+ else if (!!t1.$is_args1)
+ topLevel.call$1(args);
+ else
+ topLevel.call$0();
+ }
},
-IsolateNatives__spawnWorker: function(functionName, uri, replyPort) {
+IsolateNatives__spawnWorker: function(functionName, uri, args, message, isSpawnUri, replyPort) {
var worker, t1, workerId;
if (uri == null)
uri = $.get$IsolateNatives_thisScript();
@@ -574,7 +693,7 @@ IsolateNatives__spawnWorker: function(functionName, uri, replyPort) {
t1.$indexSet(t1, worker, workerId);
t1 = $globalState.managers;
t1.$indexSet(t1, workerId, worker);
- worker.postMessage(H._serializeMessage(H.fillLiteralMap(["command", "start", "id", workerId, "replyTo", H._serializeMessage(replyPort), "functionName", functionName], P.LinkedHashMap_LinkedHashMap(null, null, null, null, null))));
+ worker.postMessage(H._serializeMessage(H.fillLiteralMap(["command", "start", "id", workerId, "replyTo", H._serializeMessage(replyPort), "args", args, "msg", H._serializeMessage(message), "isSpawnUri", isSpawnUri, "functionName", functionName], P.LinkedHashMap_LinkedHashMap(null, null, null, null, null))));
},
_waitForPendingPorts: function(message, callback) {
@@ -611,24 +730,16 @@ _Deserializer_isPrimitive: function(x) {
return x == null || typeof x === "string" || typeof x === "number" || typeof x === "boolean";
},
-CloseToken: {"": "Object;", $isCloseToken: true},
+startRootIsolate_closure: {"": "Closure;entry_0",
+ call$0: function() {
+ this.entry_0.call$1([]);
+ }
+},
-JsIsolateSink: {"": "EventSink;_isClosed,_port<",
- add$1: function(_, message) {
- this._port.send$1(message);
- },
- $eq: function(_, other) {
- var t1;
- if (other == null)
- return false;
- t1 = J.getInterceptor(other);
- return typeof other === "object" && other !== null && !!t1.$isIsolateSink && J.$eq(this._port, other.get$_port());
- },
- get$hashCode: function(_) {
- return J.get$hashCode$(this._port) + 499;
- },
- $isJsIsolateSink: true,
- $isIsolateSink: true
+startRootIsolate_closure0: {"": "Closure;entry_1",
+ call$0: function() {
+ this.entry_1.call$2([], null);
+ }
},
_Manager: {"": "Object;nextIsolateId,currentManagerId,nextManagerId,currentContext,rootContext,topEventLoop,fromCommandLine,isWorker,supportsWorkers,isolates,mainManager,managers,entry",
@@ -689,8 +800,8 @@ _IsolateContext: {"": "Object;id,ports,isolateStatics<",
return t1.$index(t1, portId);
},
register$2: function(_, portId, port) {
- var t1;
- if (this.ports.containsKey$1(portId))
+ var t1 = this.ports;
+ if (t1.containsKey$1(t1, portId))
throw H.wrapException(P.Exception_Exception("Registry: ports must be registered only once."));
t1 = this.ports;
t1.$indexSet(t1, portId, port);
@@ -731,7 +842,12 @@ _EventLoop: {"": "Object;events,activeTimerCount",
return t1.removeFirst$0();
},
checkOpenReceivePortsFromCommandLine$0: function() {
- if ($globalState.rootContext != null && $globalState.isolates.containsKey$1($globalState.rootContext.id) && $globalState.fromCommandLine === true && $globalState.rootContext.ports._collection$_length === 0)
+ if ($globalState.rootContext != null) {
+ var t1 = $globalState.isolates;
+ t1 = t1.containsKey$1(t1, $globalState.rootContext.id) && $globalState.fromCommandLine === true && $globalState.rootContext.ports._collection$_length === 0;
+ } else
+ t1 = false;
+ if (t1)
throw H.wrapException(P.Exception_Exception("Program exited with open ReceivePorts."));
},
runIteration$0: function() {
@@ -794,65 +910,20 @@ _IsolateEvent: {"": "Object;isolate,fn,message",
_MainManagerStub: {"": "Object;"},
-IsolateNatives__processWorkerMessage_closure: {"": "Closure;entryPoint_0,replyTo_1",
+IsolateNatives__processWorkerMessage_closure: {"": "Closure;entryPoint_0,args_1,message_2,isSpawnUri_3,replyTo_4",
call$0: function() {
- H.IsolateNatives__startIsolate(this.entryPoint_0, this.replyTo_1);
+ H.IsolateNatives__startIsolate(this.entryPoint_0, this.args_1, this.message_2, this.isSpawnUri_3, this.replyTo_4);
}
},
-_BaseSendPort: {"": "Object;",
- _checkReplyTo$1: function(replyTo) {
- var t1;
- if (replyTo != null) {
- t1 = J.getInterceptor(replyTo);
- t1 = (typeof replyTo !== "object" || replyTo === null || !t1.$is_NativeJsSendPort) && (typeof replyTo !== "object" || replyTo === null || !t1.$is_WorkerSendPort) && true;
- } else
- t1 = false;
- if (t1)
- throw H.wrapException(P.Exception_Exception("SendPort.send: Illegal replyTo port type"));
- },
- call$1: function(message) {
- var t1, completer, port;
- t1 = null;
- completer = new P._AsyncCompleter(P._Future$(t1));
- H.setRuntimeTypeInfo(completer, [t1]);
- port = H.ReceivePortImpl$();
- this.send$2(message, new H._NativeJsSendPort(port, $globalState.currentContext.id));
- port._callback = new H._BaseSendPort_call_closure(completer, port);
- return completer.future;
- },
- $isSendPort: true
-},
-
-_BaseSendPort_call_closure: {"": "Closure;completer_0,port_1",
- call$2: function(value, ignoreReplyTo) {
- var t1, t2;
- t1 = this.port_1;
- t1._callback = null;
- $globalState.currentContext.unregister$1(t1._id);
- t1 = J.getInterceptor(value);
- t2 = this.completer_0;
- if (typeof value === "object" && value !== null && !!t1.$isException) {
- t1 = t2.future;
- if (t1._state !== 0)
- H.throwExpression(new P.StateError("Future already completed"));
- t1._asyncCompleteError$2(value, null);
- } else {
- t1 = t2.future;
- if (t1._state !== 0)
- H.throwExpression(new P.StateError("Future already completed"));
- t1._asyncComplete$1(value);
- }
- },
- $is_args2: true
-},
+_BaseSendPort: {"": "Object;", $isSendPort: true},
_NativeJsSendPort: {"": "_BaseSendPort;_receivePort,_isolateId",
- send$2: function(message, replyTo) {
- H._waitForPendingPorts([message, replyTo], new H._NativeJsSendPort_send_closure(this, message, replyTo));
+ send$2: function(_, message, replyTo) {
+ H._waitForPendingPorts(message, new H._NativeJsSendPort_send_closure(this, message));
},
- send$1: function(message) {
- return this.send$2(message, null);
+ send$1: function($receiver, message) {
+ return this.send$2($receiver, message, null);
},
$eq: function(_, other) {
var t1;
@@ -868,56 +939,53 @@ _NativeJsSendPort: {"": "_BaseSendPort;_receivePort,_isolateId",
$isSendPort: true
},
-_NativeJsSendPort_send_closure: {"": "Closure;this_1,message_2,replyTo_3",
+_NativeJsSendPort_send_closure: {"": "Closure;this_1,message_2",
call$0: function() {
- var t1, t2, t3, t4, t5, isolate, shouldSerialize, msg;
+ var t1, t2, t3, t4, isolate, shouldSerialize, msg;
t1 = {};
- t2 = this.this_1;
- t3 = this.replyTo_3;
- t2._checkReplyTo$1(t3);
- t4 = $globalState.isolates;
- t5 = t2._isolateId;
- isolate = t4.$index(t4, t5);
+ t2 = $globalState.isolates;
+ t3 = this.this_1;
+ t4 = t3._isolateId;
+ isolate = t2.$index(t2, t4);
if (isolate == null)
return;
- if (t2._receivePort.get$_callback() == null)
+ if ((t3._receivePort.get$_controller()._state & 4) !== 0)
return;
- shouldSerialize = $globalState.currentContext != null && $globalState.currentContext.id !== t5;
+ shouldSerialize = $globalState.currentContext != null && $globalState.currentContext.id !== t4;
msg = this.message_2;
t1.msg_0 = msg;
- t1.reply_1 = t3;
- if (shouldSerialize) {
+ if (shouldSerialize)
t1.msg_0 = H._serializeMessage(t1.msg_0);
- t1.reply_1 = H._serializeMessage(t1.reply_1);
- }
- t3 = $globalState.topEventLoop;
+ t2 = $globalState.topEventLoop;
t4 = "receive " + H.S(msg);
- t3.events._add$1(new H._IsolateEvent(isolate, new H._NativeJsSendPort_send__closure(t1, t2, shouldSerialize), t4));
+ t2.events._add$1(new H._IsolateEvent(isolate, new H._NativeJsSendPort_send__closure(t1, t3, shouldSerialize), t4));
}
},
-_NativeJsSendPort_send__closure: {"": "Closure;box_0,this_4,shouldSerialize_5",
+_NativeJsSendPort_send__closure: {"": "Closure;box_0,this_3,shouldSerialize_4",
call$0: function() {
var t1, t2;
- t1 = this.this_4._receivePort;
- if (t1.get$_callback() != null) {
- if (this.shouldSerialize_5) {
+ t1 = this.this_3._receivePort;
+ if ((t1.get$_controller()._state & 4) === 0) {
+ if (this.shouldSerialize_4) {
t2 = this.box_0;
t2.msg_0 = H._deserializeMessage(t2.msg_0);
- t2.reply_1 = H._deserializeMessage(t2.reply_1);
}
- t2 = this.box_0;
- t1._callback$2(t2.msg_0, t2.reply_1);
+ t1 = t1.get$_controller();
+ t2 = this.box_0.msg_0;
+ if (t1._state >= 4)
+ H.throwExpression(t1._badEventState$0());
+ t1._async$_add$1(t2);
}
}
},
_WorkerSendPort: {"": "_BaseSendPort;_workerId,_receivePortId,_isolateId",
- send$2: function(message, replyTo) {
- H._waitForPendingPorts([message, replyTo], new H._WorkerSendPort_send_closure(this, message, replyTo));
+ send$2: function(_, message, replyTo) {
+ H._waitForPendingPorts(message, new H._WorkerSendPort_send_closure(this, message));
},
- send$1: function(message) {
- return this.send$2(message, null);
+ send$1: function($receiver, message) {
+ return this.send$2($receiver, message, null);
},
$eq: function(_, other) {
var t1;
@@ -947,13 +1015,11 @@ _WorkerSendPort: {"": "_BaseSendPort;_workerId,_receivePortId,_isolateId",
$isSendPort: true
},
-_WorkerSendPort_send_closure: {"": "Closure;this_0,message_1,replyTo_2",
+_WorkerSendPort_send_closure: {"": "Closure;this_0,message_1",
call$0: function() {
- var t1, t2, workerMessage, manager;
+ var t1, workerMessage, t2, manager;
t1 = this.this_0;
- t2 = this.replyTo_2;
- t1._checkReplyTo$1(t2);
- workerMessage = H._serializeMessage(H.fillLiteralMap(["command", "message", "port", t1, "msg", this.message_1, "replyTo", t2], P.LinkedHashMap_LinkedHashMap(null, null, null, null, null)));
+ workerMessage = H._serializeMessage(H.fillLiteralMap(["command", "message", "port", t1, "msg", this.message_1], P.LinkedHashMap_LinkedHashMap(null, null, null, null, null)));
if ($globalState.isWorker === true) {
$globalState.mainManager.toString;
self.postMessage(workerMessage);
@@ -966,11 +1032,26 @@ _WorkerSendPort_send_closure: {"": "Closure;this_0,message_1,replyTo_2",
}
},
-ReceivePortImpl: {"": "Object;_id<,_callback<",
- _callback$2: function(arg0, arg1) {
- return this._callback.call$2(arg0, arg1);
+ReceivePortImpl: {"": "Stream;_id<,_controller<",
+ listen$4$cancelOnError$onDone$onError: function(onData, cancelOnError, onDone, onError) {
+ var t1 = this._controller;
+ t1.toString;
+ t1 = new P._ControllerStream(t1);
+ H.setRuntimeTypeInfo(t1, [null]);
+ return t1.listen$4$cancelOnError$onDone$onError(onData, cancelOnError, onDone, onError);
+ },
+ close$0: function(_) {
+ var t1 = this._controller;
+ if ((t1._state & 4) !== 0)
+ return;
+ t1.close$0(t1);
+ $globalState.currentContext.unregister$1(this._id);
+ },
+ get$close: function(_receiver) {
+ return new H.BoundClosure$i0(this, H.ReceivePortImpl.prototype.close$0, _receiver, "close$0");
},
ReceivePortImpl$0: function() {
+ this._controller = P.StreamController_StreamController(this.get$close(this), null, null, null, true, null);
var t1 = $globalState.currentContext;
t1.register$2(t1, this._id, this);
},
@@ -989,7 +1070,8 @@ ReceivePortImpl$: function() {
_waitForPendingPorts_closure: {"": "Closure;callback_0",
call$1: function(_) {
return this.callback_0.call$0();
- }
+ },
+ $is_args1: true
},
_PendingSendPortFinder: {"": "_MessageTraverser;ports,_visited",
@@ -1001,7 +1083,7 @@ _PendingSendPortFinder: {"": "_MessageTraverser;ports,_visited",
return;
t1 = this._visited;
t1.$indexSet(t1, list, true);
- J.forEach$1$ax(list, new H._PendingSendPortFinder_visitList_closure(this));
+ J.forEach$1$ax(list, this.get$_dispatch());
},
visitMap$1: function(map) {
var t1 = this._visited;
@@ -1009,16 +1091,10 @@ _PendingSendPortFinder: {"": "_MessageTraverser;ports,_visited",
return;
t1 = this._visited;
t1.$indexSet(t1, map, true);
- t1 = map.get$values(map);
- t1.forEach$1(t1, new H._PendingSendPortFinder_visitMap_closure(this));
+ J.forEach$1$ax(J.get$values$x(map), this.get$_dispatch());
},
visitSendPort$1: function(port) {
},
- visitIsolateSink$1: function(sink) {
- this.visitSendPort$1(sink._port);
- },
- visitCloseToken$1: function(token) {
- },
_PendingSendPortFinder$0: function() {
this._visited = new H._JsVisitedMap(null);
},
@@ -1031,52 +1107,23 @@ _PendingSendPortFinder$: function() {
},
-_PendingSendPortFinder_visitList_closure: {"": "Closure;this_0",
- call$1: function(e) {
- return this.this_0._dispatch$1(e);
- }
-},
-
-_PendingSendPortFinder_visitMap_closure: {"": "Closure;this_0",
- call$1: function(e) {
- return this.this_0._dispatch$1(e);
- }
-},
-
_JsSerializer: {"": "_Serializer;_nextFreeRefId,_visited",
visitSendPort$1: function(x) {
- var t1 = J.getInterceptor(x);
- if (typeof x === "object" && x !== null && !!t1.$is_NativeJsSendPort)
+ if (!!x.$is_NativeJsSendPort)
return ["sendport", $globalState.currentManagerId, x._isolateId, x._receivePort.get$_id()];
- if (typeof x === "object" && x !== null && !!t1.$is_WorkerSendPort)
+ if (!!x.$is_WorkerSendPort)
return ["sendport", x._workerId, x._isolateId, x._receivePortId];
throw H.wrapException("Illegal underlying port " + H.S(x));
- },
- visitIsolateSink$1: function(sink) {
- var isClosed = sink._isClosed;
- return ["isolateSink", this.visitSendPort$1(sink._port), isClosed];
- },
- visitCloseToken$1: function(token) {
- return ["closeToken"];
}
},
_JsCopier: {"": "_Copier;_visited",
visitSendPort$1: function(x) {
- var t1 = J.getInterceptor(x);
- if (typeof x === "object" && x !== null && !!t1.$is_NativeJsSendPort)
+ if (!!x.$is_NativeJsSendPort)
return new H._NativeJsSendPort(x._receivePort, x._isolateId);
- if (typeof x === "object" && x !== null && !!t1.$is_WorkerSendPort)
+ if (!!x.$is_WorkerSendPort)
return new H._WorkerSendPort(x._workerId, x._receivePortId, x._isolateId);
throw H.wrapException("Illegal underlying port " + H.S(x));
- },
- visitIsolateSink$1: function(sink) {
- var result = new H.JsIsolateSink(false, this.visitSendPort$1(sink._port));
- result._isClosed = sink._isClosed;
- return result;
- },
- visitCloseToken$1: function(token) {
- return token;
}
},
@@ -1098,17 +1145,6 @@ _JsDeserializer: {"": "_Deserializer;_deserialized",
return new H._NativeJsSendPort(receivePort, isolateId);
} else
return new H._WorkerSendPort(managerId, receivePortId, isolateId);
- },
- deserializeIsolateSink$1: function(list) {
- var t1, port, result;
- t1 = J.getInterceptor$asx(list);
- port = this.deserializeSendPort$1(t1.$index(list, 1));
- result = new H.JsIsolateSink(false, port);
- result._isClosed = t1.$index(list, 2);
- return result;
- },
- deserializeCloseToken$1: function(list) {
- return C.C_CloseToken;
}
},
@@ -1173,12 +1209,11 @@ _MessageTraverser: {"": "Object;",
return this.visitMap$1(x);
if (typeof x === "object" && x !== null && !!t1.$isSendPort)
return this.visitSendPort$1(x);
- if (typeof x === "object" && x !== null && !!t1.$isJsIsolateSink)
- return this.visitIsolateSink$1(x);
- if (typeof x === "object" && x !== null && !!t1.$isCloseToken)
- return this.visitCloseToken$1(x);
return this.visitObject$1(x);
},
+ get$_dispatch: function() {
+ return new H.BoundClosure$1(this, H._MessageTraverser.prototype._dispatch$1, null, "_dispatch$1");
+ },
visitObject$1: function(x) {
throw H.wrapException("Message serialization: Illegal value " + H.S(x) + " passed");
}
@@ -1189,28 +1224,6 @@ _Copier: {"": "_MessageTraverser;",
return x;
},
visitList$1: function(list) {
- var t1, copy, len, i, t2;
- if (typeof list !== "string" && (typeof list !== "object" || list === null || list.constructor !== Array && !H.isJsIndexable(list, list[init.dispatchPropertyName])))
- return this.visitList$1$bailout1(1, list);
- t1 = this._visited;
- copy = t1.$index(t1, list);
- if (copy != null)
- return copy;
- len = list.length;
- copy = P.List_List(len, null);
- t1 = this._visited;
- t1.$indexSet(t1, list, copy);
- for (t1 = copy.length, i = 0; i < len; ++i) {
- if (i >= list.length)
- throw H.ioore(list, i);
- t2 = this._dispatch$1(list[i]);
- if (i >= t1)
- throw H.ioore(copy, i);
- copy[i] = t2;
- }
- return copy;
- },
- visitList$1$bailout1: function(state0, list) {
var t1, copy, len, t2, i, t3;
t1 = this._visited;
copy = t1.$index(t1, list);
@@ -1240,7 +1253,7 @@ _Copier: {"": "_MessageTraverser;",
t1.copy_0 = P.LinkedHashMap_LinkedHashMap(null, null, null, null, null);
t2 = this._visited;
t2.$indexSet(t2, map, t1.copy_0);
- map.forEach$1(map, new H._Copier_visitMap_closure(t1, this));
+ J.forEach$1$ax(map, new H._Copier_visitMap_closure(t1, this));
return t1.copy_0;
}
},
@@ -1270,7 +1283,7 @@ _Serializer: {"": "_MessageTraverser;",
return ["list", id, this._serializeList$1(list)];
},
visitMap$1: function(map) {
- var t1, copyId, id, keys;
+ var t1, copyId, id;
t1 = this._visited;
copyId = t1.$index(t1, map);
if (copyId != null)
@@ -1279,28 +1292,10 @@ _Serializer: {"": "_MessageTraverser;",
this._nextFreeRefId = id + 1;
t1 = this._visited;
t1.$indexSet(t1, map, id);
- t1 = map.get$keys();
- keys = this._serializeList$1(P.List_List$from(t1, true, H.getRuntimeTypeArgument(t1, "IterableBase", 0)));
- t1 = map.get$values(map);
- return ["map", id, keys, this._serializeList$1(P.List_List$from(t1, true, H.getRuntimeTypeArgument(t1, "IterableBase", 0)))];
+ t1 = J.getInterceptor$x(map);
+ return ["map", id, this._serializeList$1(J.toList$0$ax(t1.get$keys(map))), this._serializeList$1(J.toList$0$ax(t1.get$values(map)))];
},
_serializeList$1: function(list) {
- var len, result, t1, i, t2;
- if (typeof list !== "string" && (typeof list !== "object" || list === null || list.constructor !== Array && !H.isJsIndexable(list, list[init.dispatchPropertyName])))
- return this._serializeList$1$bailout(1, list);
- len = list.length;
- result = P.List_List(len, null);
- for (t1 = result.length, i = 0; i < len; ++i) {
- if (i >= list.length)
- throw H.ioore(list, i);
- t2 = this._dispatch$1(list[i]);
- if (i >= t1)
- throw H.ioore(result, i);
- result[i] = t2;
- }
- return result;
- },
- _serializeList$1$bailout: function(state0, list) {
var t1, len, result, t2, i, t3;
t1 = J.getInterceptor$asx(list);
len = t1.get$length(list);
@@ -1338,10 +1333,6 @@ _Deserializer: {"": "Object;",
return this._deserializeMap$1(x);
case "sendport":
return this.deserializeSendPort$1(x);
- case "isolateSink":
- return this.deserializeIsolateSink$1(x);
- case "closeToken":
- return this.deserializeCloseToken$1(x);
default:
return this.deserializeObject$1(x);
}
@@ -1351,23 +1342,6 @@ _Deserializer: {"": "Object;",
t1 = J.getInterceptor$asx(x);
id = t1.$index(x, 1);
dartList = t1.$index(x, 2);
- if (typeof dartList !== "object" || dartList === null || (dartList.constructor !== Array || !!dartList.immutable$list) && !H.isJsIndexable(dartList, dartList[init.dispatchPropertyName]))
- return this._deserializeList$1$bailout(1, dartList, id);
- t1 = this._deserialized;
- t1.$indexSet(t1, id, dartList);
- len = dartList.length;
- for (i = 0; i < len; ++i) {
- if (i >= dartList.length)
- throw H.ioore(dartList, i);
- t1 = this._deserializeHelper$1(dartList[i]);
- if (i >= dartList.length)
- throw H.ioore(dartList, i);
- dartList[i] = t1;
- }
- return dartList;
- },
- _deserializeList$1$bailout: function(state0, dartList, id) {
- var t1, len, i;
t1 = this._deserialized;
t1.$indexSet(t1, id, dartList);
t1 = J.getInterceptor$asx(dartList);
@@ -1380,55 +1354,24 @@ _Deserializer: {"": "Object;",
return dartList;
},
_deserializeMap$1: function(x) {
- var result, t1, id, t2, keys, values, len, i, key;
+ var result, t1, id, t2, keys, values, len, i;
result = P.LinkedHashMap_LinkedHashMap(null, null, null, null, null);
t1 = J.getInterceptor$asx(x);
id = t1.$index(x, 1);
t2 = this._deserialized;
t2.$indexSet(t2, id, result);
keys = t1.$index(x, 2);
- if (typeof keys !== "string" && (typeof keys !== "object" || keys === null || keys.constructor !== Array && !H.isJsIndexable(keys, keys[init.dispatchPropertyName])))
- return this._deserializeMap$1$bailout(1, result, keys, t1, x);
values = t1.$index(x, 3);
- if (typeof values !== "string" && (typeof values !== "object" || values === null || values.constructor !== Array && !H.isJsIndexable(values, values[init.dispatchPropertyName])))
- return this._deserializeMap$1$bailout(2, result, keys, 0, 0, values);
- len = keys.length;
- for (i = 0; i < len; ++i) {
- if (i >= keys.length)
- throw H.ioore(keys, i);
- key = this._deserializeHelper$1(keys[i]);
- if (i >= values.length)
- throw H.ioore(values, i);
- result.$indexSet(result, key, this._deserializeHelper$1(values[i]));
- }
+ t1 = J.getInterceptor$asx(keys);
+ len = t1.get$length(keys);
+ if (typeof len !== "number")
+ throw H.iae(len);
+ t2 = J.getInterceptor$asx(values);
+ i = 0;
+ for (; i < len; ++i)
+ result.$indexSet(result, this._deserializeHelper$1(t1.$index(keys, i)), this._deserializeHelper$1(t2.$index(values, i)));
return result;
},
- _deserializeMap$1$bailout: function(state0, result, keys, t1, x, values) {
- switch (state0) {
- case 0:
- result = P.LinkedHashMap_LinkedHashMap(null, null, null, null, null);
- t1 = J.getInterceptor$asx(x);
- id = t1.$index(x, 1);
- t2 = this._deserialized;
- t2.$indexSet(t2, id, result);
- keys = t1.$index(x, 2);
- case 1:
- state0 = 0;
- values = t1.$index(x, 3);
- case 2:
- var id, t2, len, i;
- state0 = 0;
- t1 = J.getInterceptor$asx(keys);
- len = t1.get$length(keys);
- if (typeof len !== "number")
- throw H.iae(len);
- t2 = J.getInterceptor$asx(values);
- i = 0;
- for (; i < len; ++i)
- result.$indexSet(result, this._deserializeHelper$1(t1.$index(keys, i)), this._deserializeHelper$1(t2.$index(values, i)));
- return result;
- }
- },
deserializeObject$1: function(x) {
throw H.wrapException("Unexpected serialized object");
}
@@ -1570,14 +1513,14 @@ Primitives_stringFromCodePoints: function(codePoints) {
for (t1 = new H.ListIterator(codePoints, codePoints.length, 0, null); t1.moveNext$0();) {
i = t1._current;
if (typeof i !== "number" || Math.floor(i) !== i)
- throw H.wrapException(P.ArgumentError$(i));
+ throw H.wrapException(new P.ArgumentError(i));
if (i <= 65535)
a.push(i);
else if (i <= 1114111) {
a.push(55296 + (C.JSInt_methods.$shr(i - 65536, 10) & 1023));
a.push(56320 + (i & 1023));
} else
- throw H.wrapException(P.ArgumentError$(i));
+ throw H.wrapException(new P.ArgumentError(i));
}
return H.Primitives__fromCharCodeApply(a);
},
@@ -1587,9 +1530,9 @@ Primitives_stringFromCharCodes: function(charCodes) {
for (t1 = new H.ListIterator(charCodes, charCodes.length, 0, null); t1.moveNext$0();) {
i = t1._current;
if (typeof i !== "number" || Math.floor(i) !== i)
- throw H.wrapException(P.ArgumentError$(i));
+ throw H.wrapException(new P.ArgumentError(i));
if (i < 0)
- throw H.wrapException(P.ArgumentError$(i));
+ throw H.wrapException(new P.ArgumentError(i));
if (i > 65535)
return H.Primitives_stringFromCodePoints(charCodes);
}
@@ -1784,6 +1727,22 @@ convertDartClosureToJS: function(closure, arity) {
return $function;
},
+propertyTypeCastError: function(value, property) {
+ var t1 = J.getInterceptor$asx(property);
+ throw H.wrapException(H.CastErrorImplementation$(H.Primitives_objectTypeName(value), t1.substring$2(property, 3, t1.get$length(property))));
+},
+
+interceptedTypeCast: function(value, property) {
+ var t1;
+ if (value != null)
+ t1 = typeof value === "object" && J.getInterceptor(value)[property];
+ else
+ t1 = true;
+ if (t1)
+ return value;
+ H.propertyTypeCastError(value, property);
+},
+
throwCyclicInit: function(staticName) {
throw H.wrapException(P.CyclicInitializationError$("Cyclic initialization for static " + H.S(staticName)));
},
@@ -1816,6 +1775,8 @@ runtimeTypeToString: function(type) {
return type[0].builtin$cls + H.joinArguments(type, 1);
else if (typeof type == "function")
return type.builtin$cls;
+ else if (typeof type === "number" && Math.floor(type) === type)
+ return C.JSInt_methods.toString$0(type);
else
return;
},
@@ -1853,6 +1814,10 @@ substitute: function(substitution, $arguments) {
return $arguments;
},
+computeSignature: function(signature, context, contextName) {
+ return H.invokeOn(signature, context, H.getRuntimeTypeArguments(context, contextName));
+},
+
invokeOn: function($function, receiver, $arguments) {
return $function.apply(receiver, $arguments);
},
@@ -2002,7 +1967,6 @@ lookupDispatchRecord: function(obj) {
if (interceptorClass == null)
return;
interceptor = interceptorClass.prototype;
- init.leafTags;
if (init.leafTags[tag] === true)
return H.makeLeafDispatchRecord(interceptor);
else
@@ -2013,6 +1977,35 @@ makeLeafDispatchRecord: function(interceptor) {
return J.makeDispatchRecord(interceptor, false, null, !!interceptor.$isJavaScriptIndexingBehavior);
},
+makeDefaultDispatchRecord: function(tag, interceptorClass, proto) {
+ var interceptor = interceptorClass.prototype;
+ if (init.leafTags[tag] === true)
+ return J.makeDispatchRecord(interceptor, false, null, !!interceptor.$isJavaScriptIndexingBehavior);
+ else
+ return J.makeDispatchRecord(interceptor, proto, null, null);
+},
+
+initNativeDispatch: function() {
+ var context, map, tags, i, tag, proto, record;
+ $.initNativeDispatchFlag = true;
+ if (typeof window != "undefined") {
+ context = window;
+ map = init.interceptorsByTag;
+ tags = Object.getOwnPropertyNames(map);
+ for (i = 0; i < tags.length; ++i) {
+ tag = tags[i];
+ if (typeof context[tag] == "function") {
+ proto = context[tag].prototype;
+ if (proto != null) {
+ record = H.makeDefaultDispatchRecord(tag, map[tag], proto);
+ if (record != null)
+ Object.defineProperty(proto, init.dispatchPropertyName, {value: record, enumerable: false, writable: true, configurable: true});
+ }
+ }
+ }
+ }
+},
+
TypeErrorDecoder: {"": "Object;_pattern,_arguments,_argumentsExpr,_expr,_method,_receiver",
matchTypeError$1: function(message) {
var match, result, t1;
@@ -2165,7 +2158,8 @@ unwrapException_saveStackTrace: {"": "Closure;ex_0",
if (error.$thrownJsError == null)
error.$thrownJsError = this.ex_0;
return error;
- }
+ },
+ $is_args1: true
},
_StackTrace: {"": "Object;_exception,_trace",
@@ -2218,7 +2212,7 @@ Closure: {"": "Object;",
}
},
-BoundClosure: {"": "Closure;_self,_target,_receiver,__js_helper$_name",
+BoundClosure: {"": "Closure;_self,__js_helper$_target,_receiver,__js_helper$_name",
$eq: function(_, other) {
var t1;
if (other == null)
@@ -2228,7 +2222,7 @@ BoundClosure: {"": "Closure;_self,_target,_receiver,__js_helper$_name",
t1 = J.getInterceptor(other);
if (typeof other !== "object" || other === null || !t1.$isBoundClosure)
return false;
- return this._self === other._self && this._target === other._target && this._receiver === other._receiver;
+ return this._self === other._self && this.__js_helper$_target === other.__js_helper$_target && this._receiver === other._receiver;
},
get$hashCode: function(_) {
var t1, receiverHashCode;
@@ -2237,42 +2231,31 @@ BoundClosure: {"": "Closure;_self,_target,_receiver,__js_helper$_name",
receiverHashCode = H.Primitives_objectHashCode(this._self);
else
receiverHashCode = typeof t1 !== "object" ? J.get$hashCode$(t1) : H.Primitives_objectHashCode(t1);
- return (receiverHashCode ^ H.Primitives_objectHashCode(this._target)) >>> 0;
+ return (receiverHashCode ^ H.Primitives_objectHashCode(this.__js_helper$_target)) >>> 0;
},
$isBoundClosure: true
},
+CastErrorImplementation: {"": "Error;message",
+ toString$0: function(_) {
+ return this.message;
+ },
+ $isError: true,
+ static: {
+CastErrorImplementation$: function(actualType, expectedType) {
+ return new H.CastErrorImplementation("CastError: Casting value of type " + actualType + " to incompatible type " + H.S(expectedType));
+}}
+
+},
+
applyExperimentalFixup_newGetTagDartFunction: {"": "Closure;newGetTagJSFunction_0",
call$1: function(object) {
return this.newGetTagJSFunction_0(object);
- }
+ },
+ $is_args1: true
}}],
["dart._collection.dev", "dart:_collection-dev", , H, {
Arrays_copy: function(src, srcStart, dst, dstStart, count) {
- var i, j, t1, t2, t3, t4;
- if (typeof dst !== "object" || dst === null || (dst.constructor !== Array || !!dst.immutable$list) && !H.isJsIndexable(dst, dst[init.dispatchPropertyName]))
- return H.Arrays_copy$bailout(1, dst, src, srcStart, dstStart, count);
- if (srcStart < dstStart)
- for (i = srcStart + count - 1, j = dstStart + count - 1, t1 = src.length, t2 = dst.length; i >= srcStart; --i, --j) {
- if (i < 0 || i >= t1)
- throw H.ioore(src, i);
- t3 = src[i];
- if (j < 0 || j >= t2)
- throw H.ioore(dst, j);
- dst[j] = t3;
- }
- else
- for (t1 = srcStart + count, t2 = src.length, t3 = dst.length, j = dstStart, i = srcStart; i < t1; ++i, ++j) {
- if (i < 0 || i >= t2)
- throw H.ioore(src, i);
- t4 = src[i];
- if (j < 0 || j >= t3)
- throw H.ioore(dst, j);
- dst[j] = t4;
- }
-},
-
-Arrays_copy$bailout: function(state0, dst, src, srcStart, dstStart, count) {
var i, j, t1;
if (srcStart < dstStart)
for (i = srcStart + count - 1, j = dstStart + count - 1; i >= srcStart; --i, --j) {
@@ -2394,6 +2377,10 @@ MappedIterable: {"": "IterableBase;_iterable,_f",
var t1 = this._iterable;
return t1.get$length(t1);
},
+ get$isEmpty: function(_) {
+ var t1 = this._iterable;
+ return t1.get$isEmpty(t1);
+ },
$asIterableBase: function($S, $T) {
return [$T];
},
@@ -2435,17 +2422,7 @@ MappedIterator: {"": "Iterator;_current,_iterator,_f",
}
},
-FixedLengthListMixin: {"": "Object;",
- set$length: function(receiver, newLength) {
- throw H.wrapException(P.UnsupportedError$("Cannot change the length of a fixed-length list"));
- },
- add$1: function(receiver, value) {
- throw H.wrapException(P.UnsupportedError$("Cannot add to a fixed-length list"));
- },
- removeLast$0: function(receiver) {
- throw H.wrapException(P.UnsupportedError$("Cannot remove from a fixed-length list"));
- }
-}}],
+FixedLengthListMixin: {"": "Object;"}}],
["dart.async", "dart:async", , P, {
_attachStackTrace: function(o, st) {
var t1;
@@ -2560,11 +2537,16 @@ StreamController_StreamController: function(onCancel, onListen, onPause, onResum
},
_runGuarded: function(notificationHandler) {
- var e, s, exception, t1, t2;
+ var result, e, s, t1, t2, exception;
if (notificationHandler == null)
return;
try {
- notificationHandler.call$0();
+ result = notificationHandler.call$0();
+ t1 = result;
+ t2 = J.getInterceptor(t1);
+ if (typeof t1 === "object" && t1 !== null && !!t2.$isFuture)
+ return result;
+ return;
} catch (exception) {
t1 = H.unwrapException(exception);
e = t1;
@@ -2611,8 +2593,28 @@ _runUserCode: function(userCode, onSuccess, onError) {
},
-_cancelAndError: function(subscription, future) {
- return new P._cancelAndError_closure(subscription, future);
+_cancelAndError: function(subscription, future, error, stackTrace) {
+ var cancelFuture, t1;
+ cancelFuture = subscription.cancel$0();
+ t1 = J.getInterceptor(cancelFuture);
+ if (typeof cancelFuture === "object" && cancelFuture !== null && !!t1.$isFuture)
+ cancelFuture.whenComplete$1(new P._cancelAndError_closure(future, error, stackTrace));
+ else
+ future._completeError$2(error, stackTrace);
+},
+
+_cancelAndErrorClosure: function(subscription, future) {
+ return new P._cancelAndErrorClosure_closure(subscription, future);
+},
+
+_cancelAndValue: function(subscription, future, value) {
+ var cancelFuture, t1;
+ cancelFuture = subscription.cancel$0();
+ t1 = J.getInterceptor(cancelFuture);
+ if (typeof cancelFuture === "object" && cancelFuture !== null && !!t1.$isFuture)
+ cancelFuture.whenComplete$1(new P._cancelAndValue_closure(future, value));
+ else
+ future._complete$1(value);
},
Timer_Timer: function(duration, callback) {
@@ -2633,7 +2635,7 @@ _createTimer: function(duration, callback) {
},
_rootHandleUncaughtError: function($self, $parent, zone, error, stackTrace) {
- P._scheduleAsyncCallback(new P._rootHandleUncaughtError_closure(error, stackTrace));
+ P._rootRun($self, null, $self, new P._rootHandleUncaughtError_closure(error, stackTrace));
},
_rootRun: function($self, $parent, zone, f) {
@@ -2668,22 +2670,6 @@ _rootRunUnary: function($self, $parent, zone, f, arg) {
}
},
-_rootRunBinary: function($self, $parent, zone, f, arg1, arg2) {
- var old, t1, t2;
- t1 = $.Zone__current;
- t2 = zone;
- if (t1 == null ? t2 == null : t1 === t2)
- return f.call$2(arg1, arg2);
- old = t1;
- try {
- $.Zone__current = zone;
- t1 = f.call$2(arg1, arg2);
- return t1;
- } finally {
- $.Zone__current = old;
- }
-},
-
_AsyncError: {"": "Object;error>,stackTrace<", $isError: true},
Future: {"": "Object;", $isFuture: true},
@@ -2695,11 +2681,12 @@ Future_wait_handleError: {"": "Closure;box_0",
t1.values_1 = null;
t1 = t1.completer_0.future;
if (t1._state !== 0)
- H.throwExpression(new P.StateError("Future already completed"));
+ H.throwExpression(P.StateError$("Future already completed"));
t1._asyncCompleteError$2(error, null);
}
return;
- }
+ },
+ $is_args1: true
},
Future_wait_closure: {"": "Closure;box_0,pos_1",
@@ -2719,15 +2706,27 @@ Future_wait_closure: {"": "Closure;box_0,pos_1",
t1 = t1.values_1;
t2 = t2.future;
if (t2._state !== 0)
- H.throwExpression(new P.StateError("Future already completed"));
+ H.throwExpression(P.StateError$("Future already completed"));
t2._asyncComplete$1(t1);
}
- }
+ },
+ $is_args1: true
},
-_Completer: {"": "Object;future<"},
+_Completer: {"": "Object;"},
-_AsyncCompleter: {"": "_Completer;future", $as_Completer: null},
+_AsyncCompleter: {"": "_Completer;future",
+ completeError$2: function(error, stackTrace) {
+ var t1 = this.future;
+ if (t1._state !== 0)
+ throw H.wrapException(P.StateError$("Future already completed"));
+ t1._asyncCompleteError$2(error, stackTrace);
+ },
+ get$completeError: function() {
+ return new P.BoundClosure$2(this, P._AsyncCompleter.prototype.completeError$2, null, "completeError$2");
+ },
+ $as_Completer: null
+},
_Future: {"": "Object;_state,_zone<,_resultOrListeners,_nextListener@,_onValueCallback,_errorTestCallback,_onErrorCallback,_whenCompleteActionCallback",
get$_isComplete: function() {
@@ -2770,6 +2769,11 @@ _Future: {"": "Object;_state,_zone<,_resultOrListeners,_nextListener@,_onValueCa
catchError$1: function(onError) {
return this.catchError$2$test(onError, null);
},
+ whenComplete$1: function(action) {
+ var result = P._Future$_whenComplete(action, H.getRuntimeTypeArgument(this, "_Future", 0));
+ this._addListener$1(result);
+ return result;
+ },
get$_value: function() {
return this._resultOrListeners;
},
@@ -2826,19 +2830,6 @@ _Future: {"": "Object;_state,_zone<,_resultOrListeners,_nextListener@,_onValueCa
return new P.BoundClosure$2(this, P._Future.prototype._completeError$2, null, "_completeError$2");
},
_asyncComplete$1: function(value) {
- var t1, t2;
- t1 = J.getInterceptor(value);
- t2 = typeof value === "object" && value !== null && !!t1.$isFuture;
- if (t2)
- ;
- if (t2)
- t1 = !t1.$is_Future || value._state < 4;
- else
- t1 = false;
- if (t1) {
- this._complete$1(value);
- return;
- }
if (this._state !== 0)
H.throwExpression(P.StateError$("Future already completed"));
this._state = 1;
@@ -2847,7 +2838,7 @@ _Future: {"": "Object;_state,_zone<,_resultOrListeners,_nextListener@,_onValueCa
},
_asyncCompleteError$2: function(error, stackTrace) {
if (this._state !== 0)
- H.throwExpression(new P.StateError("Future already completed"));
+ H.throwExpression(P.StateError$("Future already completed"));
this._state = 1;
this._zone.toString;
P._scheduleAsyncCallback(new P._Future__asyncCompleteError_closure(this, error, stackTrace));
@@ -2890,6 +2881,14 @@ _Future$_catchError: function(onErrorCallback, errorTestCallback, $T) {
return t2;
},
+_Future$_whenComplete: function(whenCompleteActionCallback, $T) {
+ var t1 = $.Zone__current;
+ t1.toString;
+ t1 = new P._Future(0, t1, null, null, null, null, null, whenCompleteActionCallback);
+ H.setRuntimeTypeInfo(t1, [$T]);
+ return t1;
+},
+
_Future__chainFutures: function(source, target) {
var t1;
target._state = 2;
@@ -3022,7 +3021,8 @@ _Future__addListener_closure: {"": "Closure;this_0,listener_1",
_Future__chainFutures_closure: {"": "Closure;target_0",
call$1: function(value) {
this.target_0._complete$1(value);
- }
+ },
+ $is_args1: true
},
_Future__chainFutures_closure0: {"": "Closure;target_1",
@@ -3032,7 +3032,8 @@ _Future__chainFutures_closure0: {"": "Closure;target_1",
call$1: function(error) {
return this.call$2(error, null);
},
- $is_args2: true
+ $is_args2: true,
+ $is_args1: true
},
_Future__asyncComplete_closure: {"": "Closure;this_0,value_1",
@@ -3129,7 +3130,8 @@ _Future__propagateToListeners_closure0: {"": "Closure;box_2,box_1,hasError_4,lis
_Future__propagateToListeners__closure: {"": "Closure;box_2,listener_6",
call$1: function(ignored) {
P._Future__propagateToListeners(this.box_2.source_4, this.listener_6);
- }
+ },
+ $is_args1: true
},
_Future__propagateToListeners__closure0: {"": "Closure;box_0,listener_7",
@@ -3147,7 +3149,8 @@ _Future__propagateToListeners__closure0: {"": "Closure;box_0,listener_7",
call$1: function(error) {
return this.call$2(error, null);
},
- $is_args2: true
+ $is_args2: true,
+ $is_args1: true
},
Stream: {"": "Object;",
@@ -3166,13 +3169,22 @@ Stream: {"": "Object;",
t1.count_0 = 0;
this.listen$4$cancelOnError$onDone$onError(new P.Stream_length_closure(t1), true, new P.Stream_length_closure0(t1, future), future.get$_completeError());
return future;
+ },
+ get$isEmpty: function(_) {
+ var t1, future;
+ t1 = {};
+ future = P._Future$(J.JSBool);
+ t1.subscription_0 = null;
+ t1.subscription_0 = this.listen$4$cancelOnError$onDone$onError(new P.Stream_isEmpty_closure(t1, future), true, new P.Stream_isEmpty_closure0(future), future.get$_completeError());
+ return future;
}
},
Stream_forEach_closure: {"": "Closure;box_0,this_1,action_2,future_3",
call$1: function(element) {
- P._runUserCode(new P.Stream_forEach__closure(this.action_2, element), new P.Stream_forEach__closure0(), P._cancelAndError(this.box_0.subscription_0, this.future_3));
- }
+ P._runUserCode(new P.Stream_forEach__closure(this.action_2, element), new P.Stream_forEach__closure0(), P._cancelAndErrorClosure(this.box_0.subscription_0, this.future_3));
+ },
+ $is_args1: true
},
Stream_forEach__closure: {"": "Closure;action_4,element_5",
@@ -3183,7 +3195,8 @@ Stream_forEach__closure: {"": "Closure;action_4,element_5",
Stream_forEach__closure0: {"": "Closure;",
call$1: function(_) {
- }
+ },
+ $is_args1: true
},
Stream_forEach_closure0: {"": "Closure;future_6",
@@ -3196,7 +3209,8 @@ Stream_length_closure: {"": "Closure;box_0",
call$1: function(_) {
var t1 = this.box_0;
t1.count_0 = t1.count_0 + 1;
- }
+ },
+ $is_args1: true
},
Stream_length_closure0: {"": "Closure;box_0,future_1",
@@ -3205,9 +3219,20 @@ Stream_length_closure0: {"": "Closure;box_0,future_1",
}
},
-StreamSubscription: {"": "Object;"},
-
-EventSink: {"": "Object;"},
+Stream_isEmpty_closure: {"": "Closure;box_0,future_1",
+ call$1: function(_) {
+ P._cancelAndValue(this.box_0.subscription_0, this.future_1, false);
+ },
+ $is_args1: true
+},
+
+Stream_isEmpty_closure0: {"": "Closure;future_2",
+ call$0: function() {
+ this.future_2._complete$1(true);
+ }
+},
+
+StreamSubscription: {"": "Object;"},
_StreamController: {"": "Object;",
get$_pendingEvents: function() {
@@ -3234,35 +3259,38 @@ _StreamController: {"": "Object;",
return new P.StateError("Cannot add event after closing");
return new P.StateError("Cannot add event while adding a stream");
},
- add$1: function(_, value) {
- if (this._state >= 4)
- throw H.wrapException(this._badEventState$0());
- this._async$_add$1(value);
- },
- addError$2: function(error, stackTrace) {
- if (this._state >= 4)
- throw H.wrapException(this._badEventState$0());
- this._addError$2(error, stackTrace);
- },
- addError$1: function(error) {
- return this.addError$2(error, null);
+ _ensureDoneFuture$0: function() {
+ if (this._doneFuture == null) {
+ this._doneFuture = P._Future$(null);
+ if ((this._state & 2) !== 0)
+ this._doneFuture._complete$1(null);
+ }
+ return this._doneFuture;
},
- _async$_add$1: function(value) {
+ close$0: function(_) {
var t1 = this._state;
+ if ((t1 & 4) !== 0)
+ return this._doneFuture;
+ if (t1 >= 4)
+ throw H.wrapException(this._badEventState$0());
+ this._state = (t1 | 4) >>> 0;
+ this._ensureDoneFuture$0();
+ t1 = this._state;
if ((t1 & 1) !== 0)
- this._sendData$1(value);
+ this._sendDone$0();
else if ((t1 & 3) === 0) {
t1 = this._ensurePendingEvents$0();
- t1.add$1(t1, new P._DelayedData(value, null));
+ t1.add$1(t1, C.C__DelayedDone);
}
+ return this._doneFuture;
},
- _addError$2: function(error, stackTrace) {
+ _async$_add$1: function(value) {
var t1 = this._state;
if ((t1 & 1) !== 0)
- this._sendError$2(error, stackTrace);
+ this._sendData$1(value);
else if ((t1 & 3) === 0) {
t1 = this._ensurePendingEvents$0();
- t1.add$1(t1, new P._DelayedError(error, stackTrace, null));
+ t1.add$1(t1, new P._DelayedData(value, null));
}
},
_subscribe$1: function(cancelOnError) {
@@ -3271,7 +3299,7 @@ _StreamController: {"": "Object;",
throw H.wrapException(P.StateError$("Stream has already been listened to."));
t1 = $.Zone__current;
t2 = cancelOnError ? 1 : 0;
- subscription = new P._ControllerSubscription(this, null, null, null, t1, t2, null);
+ subscription = new P._ControllerSubscription(this, null, null, null, t1, t2, null, null);
H.setRuntimeTypeInfo(subscription, [null]);
pendingEvents = this.get$_pendingEvents();
this._state = (this._state | 1) >>> 0;
@@ -3284,15 +3312,18 @@ _StreamController: {"": "Object;",
return subscription;
},
_recordCancel$1: function(subscription) {
- var t1;
+ var t1, future;
if ((this._state & 8) !== 0)
this._varData.cancel$0();
this._varData = null;
this._state = (this._state & 4294967286 | 2) >>> 0;
- P._runGuarded(this.get$_onCancel());
- t1 = this._doneFuture;
- if (t1 != null && t1._state === 0)
- t1._asyncComplete$1(null);
+ t1 = new P._StreamController__recordCancel_complete(this);
+ future = P._runGuarded(this.get$_onCancel());
+ if (future != null)
+ future = future.whenComplete$1(t1);
+ else
+ t1.call$0();
+ return future;
}
},
@@ -3302,12 +3333,20 @@ _StreamController__subscribe_closure: {"": "Closure;this_0",
}
},
+_StreamController__recordCancel_complete: {"": "Closure;this_0",
+ call$0: function() {
+ var t1 = this.this_0._doneFuture;
+ if (t1 != null && t1._state === 0)
+ t1._asyncComplete$1(null);
+ }
+},
+
_SyncStreamControllerDispatch: {"": "Object;",
_sendData$1: function(data) {
this.get$_subscription()._async$_add$1(data);
},
- _sendError$2: function(error, stackTrace) {
- this.get$_subscription()._addError$2(error, stackTrace);
+ _sendDone$0: function() {
+ this.get$_subscription()._close$0();
}
},
@@ -3315,8 +3354,8 @@ _AsyncStreamControllerDispatch: {"": "Object;",
_sendData$1: function(data) {
this.get$_subscription()._addPending$1(new P._DelayedData(data, null));
},
- _sendError$2: function(error, stackTrace) {
- this.get$_subscription()._addPending$1(new P._DelayedError(error, stackTrace, null));
+ _sendDone$0: function() {
+ this.get$_subscription()._addPending$1(C.C__DelayedDone);
}
},
@@ -3328,12 +3367,12 @@ _SyncStreamController: {"": "_StreamController__SyncStreamControllerDispatch;_on
_StreamController__SyncStreamControllerDispatch: {"": "_StreamController+_SyncStreamControllerDispatch;"},
-_ControllerStream: {"": "_StreamImpl;_controller",
+_ControllerStream: {"": "_StreamImpl;_async$_controller",
_createSubscription$1: function(cancelOnError) {
- return this._controller._subscribe$1(cancelOnError);
+ return this._async$_controller._subscribe$1(cancelOnError);
},
get$hashCode: function(_) {
- return (H.Primitives_objectHashCode(this._controller) ^ 892482866) >>> 0;
+ return (H.Primitives_objectHashCode(this._async$_controller) ^ 892482866) >>> 0;
},
$eq: function(_, other) {
var t1;
@@ -3344,19 +3383,19 @@ _ControllerStream: {"": "_StreamImpl;_controller",
t1 = J.getInterceptor(other);
if (typeof other !== "object" || other === null || !t1.$is_ControllerStream)
return false;
- return other._controller === this._controller;
+ return other._async$_controller === this._async$_controller;
},
$is_ControllerStream: true,
$as_StreamImpl: null
},
-_ControllerSubscription: {"": "_BufferingStreamSubscription;_controller,_onData,_onError,_onDone,_zone,_state,_pending",
+_ControllerSubscription: {"": "_BufferingStreamSubscription;_async$_controller,_async$_onData,_onError,_onDone,_zone,_state,_cancelFuture,_pending",
_onCancel$0: function() {
- this._controller._recordCancel$1(this);
+ return this._async$_controller._recordCancel$1(this);
},
_onPause$0: function() {
var t1, addState;
- t1 = this._controller;
+ t1 = this._async$_controller;
if ((t1._state & 8) !== 0) {
addState = t1._varData;
addState.pause$0(addState);
@@ -3367,7 +3406,7 @@ _ControllerSubscription: {"": "_BufferingStreamSubscription;_controller,_onData,
return new P.BoundClosure$0(this, P._ControllerSubscription.prototype._onPause$0, null, "_onPause$0");
},
_onResume$0: function() {
- var t1 = this._controller;
+ var t1 = this._async$_controller;
if ((t1._state & 8) !== 0)
t1._varData.resume$0();
P._runGuarded(t1.get$_onResume());
@@ -3380,26 +3419,24 @@ _ControllerSubscription: {"": "_BufferingStreamSubscription;_controller,_onData,
_EventSink: {"": "Object;"},
-_BufferingStreamSubscription: {"": "Object;_onData,_onError,_onDone,_zone<,_state,_pending",
+_BufferingStreamSubscription: {"": "Object;_async$_onData,_onError,_onDone,_zone<,_state,_cancelFuture,_pending",
_setPendingEvents$1: function(pendingEvents) {
if (pendingEvents == null)
return;
this._pending = pendingEvents;
if (!pendingEvents.get$isEmpty(pendingEvents)) {
- this._state = (this._state | 32) >>> 0;
+ this._state = (this._state | 64) >>> 0;
this._pending.schedule$1(this);
}
},
onData$1: function(handleData) {
$.Zone__current.toString;
- this._onData = handleData;
+ this._async$_onData = handleData;
},
onError$1: function(_, handleError) {
this._onError = P._registerErrorHandler(handleError, $.Zone__current);
},
onDone$1: function(handleDone) {
- if (handleDone == null)
- handleDone = P._nullDoneHandler$closure;
$.Zone__current.toString;
this._onDone = handleDone;
},
@@ -3407,10 +3444,10 @@ _BufferingStreamSubscription: {"": "Object;_onData,_onError,_onDone,_zone<,_stat
var t1 = this._state;
if ((t1 & 8) !== 0)
return;
- this._state = (t1 + 64 | 4) >>> 0;
- if (t1 < 64 && this._pending != null)
+ this._state = (t1 + 128 | 4) >>> 0;
+ if (t1 < 128 && this._pending != null)
this._pending.cancelSchedule$0();
- if ((t1 & 4) === 0 && (this._state & 16) === 0)
+ if ((t1 & 4) === 0 && (this._state & 32) === 0)
this._guardCallback$1(this.get$_onPause());
},
pause$0: function($receiver) {
@@ -3421,11 +3458,11 @@ _BufferingStreamSubscription: {"": "Object;_onData,_onError,_onDone,_zone<,_stat
t1 = this._state;
if ((t1 & 8) !== 0)
return;
- if (t1 >= 64) {
- this._state = t1 - 64;
+ if (t1 >= 128) {
+ this._state = t1 - 128;
t1 = this._state;
- if (t1 < 64) {
- if ((t1 & 32) !== 0) {
+ if (t1 < 128) {
+ if ((t1 & 64) !== 0) {
t2 = this._pending;
t2 = !t2.get$isEmpty(t2);
} else
@@ -3434,26 +3471,21 @@ _BufferingStreamSubscription: {"": "Object;_onData,_onError,_onDone,_zone<,_stat
this._pending.schedule$1(this);
else {
this._state = (t1 & 4294967291) >>> 0;
- if ((this._state & 16) === 0)
+ if ((this._state & 32) === 0)
this._guardCallback$1(this.get$_onResume());
}
}
}
},
cancel$0: function() {
+ this._state = (this._state & 4294967279) >>> 0;
if ((this._state & 8) !== 0)
- return;
+ return this._cancelFuture;
this._cancel$0();
- var t1 = this._state;
- if ((t1 & 16) === 0) {
- this._state = (t1 | 16) >>> 0;
- this._onCancel$0();
- this._pending = null;
- this._state = (this._state & 4294967279) >>> 0;
- }
+ return this._cancelFuture;
},
get$_mayResumeInput: function() {
- if (this._state < 64) {
+ if (this._state < 128) {
var t1 = this._pending;
t1 = t1 == null || t1.get$isEmpty(t1);
} else
@@ -3462,26 +3494,30 @@ _BufferingStreamSubscription: {"": "Object;_onData,_onError,_onDone,_zone<,_stat
},
_cancel$0: function() {
this._state = (this._state | 8) >>> 0;
- if ((this._state & 32) !== 0)
+ if ((this._state & 64) !== 0)
this._pending.cancelSchedule$0();
+ if ((this._state & 32) === 0)
+ this._pending = null;
+ this._cancelFuture = this._onCancel$0();
},
_async$_add$1: function(data) {
var t1 = this._state;
if ((t1 & 8) !== 0)
return;
- if (t1 < 16)
+ if (t1 < 32)
this._sendData$1(data);
else
this._addPending$1(new P._DelayedData(data, null));
},
- _addError$2: function(error, stackTrace) {
+ _close$0: function() {
var t1 = this._state;
if ((t1 & 8) !== 0)
return;
- if (t1 < 16)
- this._sendError$2(error, stackTrace);
+ this._state = (t1 | 2) >>> 0;
+ if (this._state < 32)
+ this._sendDone$0();
else
- this._addPending$1(new P._DelayedError(error, stackTrace, null));
+ this._addPending$1(C.C__DelayedDone);
},
_onPause$0: function() {
},
@@ -3504,89 +3540,90 @@ _BufferingStreamSubscription: {"": "Object;_onData,_onError,_onDone,_zone<,_stat
}
pending.add$1(pending, $event);
t1 = this._state;
- if ((t1 & 32) === 0) {
- this._state = (t1 | 32) >>> 0;
- if (this._state < 64)
+ if ((t1 & 64) === 0) {
+ this._state = (t1 | 64) >>> 0;
+ if (this._state < 128)
this._pending.schedule$1(this);
}
},
_sendData$1: function(data) {
var t1 = this._state;
- this._state = (t1 | 16) >>> 0;
- this._zone.runUnaryGuarded$2(this._onData, data);
- this._state = (this._state & 4294967279) >>> 0;
+ this._state = (t1 | 32) >>> 0;
+ this._zone.runUnaryGuarded$2(this._async$_onData, data);
+ this._state = (this._state & 4294967263) >>> 0;
this._checkState$1((t1 & 4) !== 0);
},
- _sendError$2: function(error, stackTrace) {
- var t1, t2, t3, t4;
- t1 = this._state;
- this._state = (t1 | 16) >>> 0;
- t2 = this._zone;
- t3 = $.Zone__current;
- t2.toString;
- t3.toString;
- if (t3 == null ? t2 != null : t3 !== t2)
- P._rootHandleUncaughtError(t3, null, t3, error, stackTrace);
- else {
- t3 = this._onError;
- t4 = J.getInterceptor(t3);
- if (!!t4.$is_args2)
- t2.runBinaryGuarded$3(t3, error, stackTrace);
- else
- t2.runUnaryGuarded$2(t3, error);
- }
- this._state = (this._state & 4294967279) >>> 0;
- if ((this._state & 1) !== 0)
- this._cancel$0();
- this._checkState$1((t1 & 4) !== 0);
+ _sendDone$0: function() {
+ var t1, t2, t3;
+ t1 = new P._BufferingStreamSubscription__sendDone_sendDone(this);
+ this._cancel$0();
+ this._state = (this._state | 16) >>> 0;
+ t2 = this._cancelFuture;
+ t3 = J.getInterceptor(t2);
+ if (typeof t2 === "object" && t2 !== null && !!t3.$isFuture)
+ t2.whenComplete$1(t1);
+ else
+ t1.call$0();
},
_guardCallback$1: function(callback) {
var t1 = this._state;
- this._state = (t1 | 16) >>> 0;
+ this._state = (t1 | 32) >>> 0;
callback.call$0();
- this._state = (this._state & 4294967279) >>> 0;
+ this._state = (this._state & 4294967263) >>> 0;
this._checkState$1((t1 & 4) !== 0);
},
_checkState$1: function(wasInputPaused) {
var t1, t2, isInputPaused;
t1 = this._state;
- if ((t1 & 32) !== 0) {
+ if ((t1 & 64) !== 0) {
t2 = this._pending;
t2 = t2.get$isEmpty(t2);
} else
t2 = false;
if (t2) {
- this._state = (t1 & 4294967263) >>> 0;
+ this._state = (t1 & 4294967231) >>> 0;
if ((this._state & 4) !== 0 && this.get$_mayResumeInput())
this._state = (this._state & 4294967291) >>> 0;
}
for (; true; wasInputPaused = isInputPaused) {
t1 = this._state;
if ((t1 & 8) !== 0) {
- this._onCancel$0();
this._pending = null;
return;
}
isInputPaused = (t1 & 4) !== 0;
if (wasInputPaused === isInputPaused)
break;
- this._state = (t1 ^ 16) >>> 0;
+ this._state = (t1 ^ 32) >>> 0;
if (isInputPaused)
this._onPause$0();
else
this._onResume$0();
- this._state = (this._state & 4294967279) >>> 0;
+ this._state = (this._state & 4294967263) >>> 0;
}
t1 = this._state;
- if ((t1 & 32) !== 0 && t1 < 64)
+ if ((t1 & 64) !== 0 && t1 < 128)
this._pending.schedule$1(this);
},
static: {
-"": "_BufferingStreamSubscription__STATE_CANCEL_ON_ERROR,_BufferingStreamSubscription__STATE_CLOSED,_BufferingStreamSubscription__STATE_INPUT_PAUSED,_BufferingStreamSubscription__STATE_CANCELED,_BufferingStreamSubscription__STATE_IN_CALLBACK,_BufferingStreamSubscription__STATE_HAS_PENDING,_BufferingStreamSubscription__STATE_PAUSE_COUNT,_BufferingStreamSubscription__STATE_PAUSE_COUNT_SHIFT",
+"": "_BufferingStreamSubscription__STATE_CANCEL_ON_ERROR,_BufferingStreamSubscription__STATE_CLOSED,_BufferingStreamSubscription__STATE_INPUT_PAUSED,_BufferingStreamSubscription__STATE_CANCELED,_BufferingStreamSubscription__STATE_WAIT_FOR_CANCEL,_BufferingStreamSubscription__STATE_IN_CALLBACK,_BufferingStreamSubscription__STATE_HAS_PENDING,_BufferingStreamSubscription__STATE_PAUSE_COUNT,_BufferingStreamSubscription__STATE_PAUSE_COUNT_SHIFT",
}
},
+_BufferingStreamSubscription__sendDone_sendDone: {"": "Closure;this_0",
+ call$0: function() {
+ var t1, t2;
+ t1 = this.this_0;
+ t2 = t1._state;
+ if ((t2 & 16) === 0)
+ return;
+ t1._state = (t2 | 42) >>> 0;
+ t1._zone.runGuarded$1(t1._onDone);
+ t1._state = (t1._state & 4294967263) >>> 0;
+ }
+},
+
_StreamImpl: {"": "Stream;",
listen$4$cancelOnError$onDone$onError: function(onData, cancelOnError, onDone, onError) {
var subscription = this._createSubscription$1(true === cancelOnError);
@@ -3595,14 +3632,11 @@ _StreamImpl: {"": "Stream;",
subscription.onDone$1(onDone);
return subscription;
},
- listen$2$onError: function(onData, onError) {
- return this.listen$4$cancelOnError$onDone$onError(onData, null, null, onError);
- },
_createSubscription$1: function(cancelOnError) {
var t1, t2;
t1 = $.Zone__current;
t2 = cancelOnError ? 1 : 0;
- return new P._BufferingStreamSubscription(null, null, null, t1, t2, null);
+ return new P._BufferingStreamSubscription(null, null, null, t1, t2, null, null);
},
$asStream: null
},
@@ -3615,9 +3649,15 @@ _DelayedData: {"": "_DelayedEvent;value,next",
}
},
-_DelayedError: {"": "_DelayedEvent;error>,stackTrace<,next",
+_DelayedDone: {"": "Object;",
perform$1: function(dispatch) {
- dispatch._sendError$2(this.error, this.stackTrace);
+ dispatch._sendDone$0();
+ },
+ get$next: function() {
+ return;
+ },
+ set$next: function(_) {
+ throw H.wrapException(P.StateError$("No events after a done."));
}
},
@@ -3674,14 +3714,25 @@ _StreamImplEvents: {"": "_PendingEvents;firstPendingEvent,lastPendingEvent,_stat
}
},
-_cancelAndError_closure: {"": "Closure;subscription_0,future_1",
+_cancelAndError_closure: {"": "Closure;future_0,error_1,stackTrace_2",
+ call$0: function() {
+ return this.future_0._completeError$2(this.error_1, this.stackTrace_2);
+ }
+},
+
+_cancelAndErrorClosure_closure: {"": "Closure;subscription_0,future_1",
call$2: function(error, stackTrace) {
- this.subscription_0.cancel$0();
- this.future_1._completeError$2(error, stackTrace);
+ return P._cancelAndError(this.subscription_0, this.future_1, error, stackTrace);
},
$is_args2: true
},
+_cancelAndValue_closure: {"": "Closure;future_0,value_1",
+ call$0: function() {
+ return this.future_0._complete$1(this.value_1);
+ }
+},
+
_BaseZone: {"": "Object;",
runGuarded$1: function(f) {
var e, s, t1, exception;
@@ -3709,25 +3760,19 @@ _BaseZone: {"": "Object;",
}
},
- runBinaryGuarded$3: function(f, arg1, arg2) {
- var e, s, t1, exception;
- try {
- t1 = this.runBinary$3(f, arg1, arg2);
- return t1;
- } catch (exception) {
- t1 = H.unwrapException(exception);
- e = t1;
- s = new H._StackTrace(exception, null);
- return this.handleUncaughtError$2(e, s);
- }
-
- },
bindCallback$2$runGuarded: function(f, runGuarded) {
var registered = this.registerCallback$1(f);
if (runGuarded)
return new P._BaseZone_bindCallback_closure(this, registered);
else
return new P._BaseZone_bindCallback_closure0(this, registered);
+ },
+ bindUnaryCallback$2$runGuarded: function(f, runGuarded) {
+ var registered = this.registerUnaryCallback$1(f);
+ if (runGuarded)
+ return new P._BaseZone_bindUnaryCallback_closure(this, registered);
+ else
+ return new P._BaseZone_bindUnaryCallback_closure0(this, registered);
}
},
@@ -3743,12 +3788,32 @@ _BaseZone_bindCallback_closure0: {"": "Closure;this_2,registered_3",
}
},
+_BaseZone_bindUnaryCallback_closure: {"": "Closure;this_0,registered_1",
+ call$1: function(arg) {
+ return this.this_0.runUnaryGuarded$2(this.registered_1, arg);
+ },
+ $is_args1: true
+},
+
+_BaseZone_bindUnaryCallback_closure0: {"": "Closure;this_2,registered_3",
+ call$1: function(arg) {
+ return this.this_2.runUnary$2(this.registered_3, arg);
+ },
+ $is_args1: true
+},
+
_rootHandleUncaughtError_closure: {"": "Closure;error_0,stackTrace_1",
call$0: function() {
+ P._scheduleAsyncCallback(new P._rootHandleUncaughtError__closure(this.error_0, this.stackTrace_1));
+ }
+},
+
+_rootHandleUncaughtError__closure: {"": "Closure;error_2,stackTrace_3",
+ call$0: function() {
var t1, trace;
- t1 = this.error_0;
+ t1 = this.error_2;
P.print("Uncaught Error: " + H.S(t1));
- trace = this.stackTrace_1;
+ trace = this.stackTrace_3;
if (trace == null)
trace = P.getAttachedStackTrace(t1);
P._attachStackTrace(t1, null);
@@ -3771,11 +3836,11 @@ _RootZone: {"": "_BaseZone;",
runUnary$2: function(f, arg) {
return P._rootRunUnary(this, null, this, f, arg);
},
- runBinary$3: function(f, arg1, arg2) {
- return P._rootRunBinary(this, null, this, f, arg1, arg2);
- },
registerCallback$1: function(f) {
return f;
+ },
+ registerUnaryCallback$1: function(f) {
+ return f;
}
}}],
["dart.collection", "dart:collection", , P, {
@@ -3801,267 +3866,108 @@ HashMap_HashMap: function(equals, hashCode, isValidKey, $K, $V) {
},
_iterableToString: function(iterable) {
- var LENGTH_LIMIT, MIN_COUNT, MAX_COUNT, OVERHEAD, ELLIPSIS_SIZE, result, $length, count, it, next, penultimateString, ultimateString, penultimate, ultimate, elision, t1, t2, t3, t4;
- LENGTH_LIMIT = 80;
- MIN_COUNT = 3;
- MAX_COUNT = 100;
- OVERHEAD = 2;
- ELLIPSIS_SIZE = 3;
+ var parts, t1;
t1 = $.get$_toStringVisiting();
if (t1.contains$1(t1, iterable))
return "(...)";
t1 = $.get$_toStringVisiting();
t1.add$1(t1, iterable);
- result = [];
+ parts = [];
try {
- $building$0: {
- $length = 0;
- count = 0;
- it = J.get$iterator$ax(iterable);
- while (true) {
- t1 = count;
- t2 = MIN_COUNT;
- if (typeof t1 !== "number")
- throw t1.$lt();
- if (typeof t2 !== "number")
- throw H.iae(t2);
- if (!(t1 < t2)) {
- t1 = $length;
- t2 = LENGTH_LIMIT;
- if (typeof t1 !== "number")
- throw t1.$lt();
- if (typeof t2 !== "number")
- throw H.iae(t2);
- t2 = t1 < t2;
- t1 = t2;
- } else
- t1 = true;
- if (!t1)
- break;
- if (!it.moveNext$0())
- break $building$0;
- next = H.S(it.get$current());
- J.add$1$ax(result, next);
- t1 = $length;
- t2 = J.get$length$asx(next);
- t3 = OVERHEAD;
- if (typeof t2 !== "number")
- throw t2.$add();
- if (typeof t3 !== "number")
- throw H.iae(t3);
- if (typeof t1 !== "number")
- throw t1.$add();
- $length = t1 + (t2 + t3);
- t3 = count;
- if (typeof t3 !== "number")
- throw t3.$add();
- count = t3 + 1;
- }
- penultimateString = null;
- ultimateString = null;
- penultimate = null;
- ultimate = null;
- if (!it.moveNext$0()) {
- t1 = count;
- t2 = MIN_COUNT;
- if (typeof t2 !== "number")
- throw t2.$add();
- if (typeof t1 !== "number")
- throw t1.$le();
- if (t1 <= t2 + 2)
- break $building$0;
- ultimateString = J.removeLast$0$ax(result);
- penultimateString = J.removeLast$0$ax(result);
- } else {
- penultimate = it.get$current();
- t1 = count;
- if (typeof t1 !== "number")
- throw t1.$add();
- count = t1 + 1;
- if (!it.moveNext$0()) {
- t1 = count;
- t2 = MIN_COUNT;
- if (typeof t2 !== "number")
- throw t2.$add();
- if (typeof t1 !== "number")
- throw t1.$le();
- if (t1 <= t2 + 1) {
- J.add$1$ax(result, H.S(penultimate));
- break $building$0;
- }
- ultimateString = H.S(penultimate);
- penultimateString = J.removeLast$0$ax(result);
- t1 = $length;
- t2 = J.get$length$asx(ultimateString);
- t3 = OVERHEAD;
- if (typeof t2 !== "number")
- throw t2.$add();
- if (typeof t3 !== "number")
- throw H.iae(t3);
- if (typeof t1 !== "number")
- throw t1.$add();
- $length = t1 + (t2 + t3);
- } else {
- ultimate = it.get$current();
- t1 = count;
- if (typeof t1 !== "number")
- throw t1.$add();
- count = t1 + 1;
- for (; it.moveNext$0();) {
- penultimate = ultimate;
- ultimate = it.get$current();
- t1 = count;
- if (typeof t1 !== "number")
- throw t1.$add();
- count = t1 + 1;
- t1 = count;
- t2 = MAX_COUNT;
- if (typeof t1 !== "number")
- throw t1.$gt();
- if (typeof t2 !== "number")
- throw H.iae(t2);
- if (t1 > t2) {
- while (true) {
- t1 = $length;
- t2 = LENGTH_LIMIT;
- t3 = ELLIPSIS_SIZE;
- if (typeof t2 !== "number")
- throw t2.$sub();
- if (typeof t3 !== "number")
- throw H.iae(t3);
- t4 = OVERHEAD;
- if (typeof t4 !== "number")
- throw H.iae(t4);
- if (typeof t1 !== "number")
- throw t1.$gt();
- if (t1 > t2 - t3 - t4) {
- t1 = count;
- t2 = MIN_COUNT;
- if (typeof t1 !== "number")
- throw t1.$gt();
- if (typeof t2 !== "number")
- throw H.iae(t2);
- t2 = t1 > t2;
- t1 = t2;
- } else
- t1 = false;
- if (!t1)
- break;
- t1 = $length;
- t2 = J.get$length$asx(J.removeLast$0$ax(result));
- t3 = OVERHEAD;
- if (typeof t2 !== "number")
- throw t2.$add();
- if (typeof t3 !== "number")
- throw H.iae(t3);
- if (typeof t1 !== "number")
- throw t1.$sub();
- $length = t1 - (t2 + t3);
- t3 = count;
- if (typeof t3 !== "number")
- throw t3.$sub();
- count = t3 - 1;
- }
- J.add$1$ax(result, "...");
- break $building$0;
- }
- }
- penultimateString = H.S(penultimate);
- ultimateString = H.S(ultimate);
- t1 = $length;
- t2 = J.get$length$asx(ultimateString);
- t3 = J.get$length$asx(penultimateString);
- if (typeof t2 !== "number")
- throw t2.$add();
- if (typeof t3 !== "number")
- throw H.iae(t3);
- t4 = OVERHEAD;
- if (typeof t4 !== "number")
- throw H.iae(t4);
- if (typeof t1 !== "number")
- throw t1.$add();
- $length = t1 + (t2 + t3 + 2 * t4);
- }
- }
- elision = null;
- t1 = count;
- t2 = J.get$length$asx(result);
- if (typeof t2 !== "number")
- throw t2.$add();
- if (typeof t1 !== "number")
- throw t1.$gt();
- if (t1 > t2 + 2) {
- elision = "...";
- t1 = $length;
- t2 = ELLIPSIS_SIZE;
- t3 = OVERHEAD;
- if (typeof t2 !== "number")
- throw t2.$add();
- if (typeof t3 !== "number")
- throw H.iae(t3);
- if (typeof t1 !== "number")
- throw t1.$add();
- $length = t1 + (t2 + t3);
- }
- while (true) {
- t1 = $length;
- t2 = LENGTH_LIMIT;
- if (typeof t1 !== "number")
- throw t1.$gt();
- if (typeof t2 !== "number")
- throw H.iae(t2);
- if (t1 > t2) {
- t1 = J.get$length$asx(result);
- t2 = MIN_COUNT;
- if (typeof t1 !== "number")
- throw t1.$gt();
- if (typeof t2 !== "number")
- throw H.iae(t2);
- t2 = t1 > t2;
- t1 = t2;
- } else
- t1 = false;
- if (!t1)
- break;
- t1 = $length;
- t2 = J.get$length$asx(J.removeLast$0$ax(result));
- t3 = OVERHEAD;
- if (typeof t2 !== "number")
- throw t2.$add();
- if (typeof t3 !== "number")
- throw H.iae(t3);
- if (typeof t1 !== "number")
- throw t1.$sub();
- $length = t1 - (t2 + t3);
- if (elision == null) {
- elision = "...";
- t1 = $length;
- t2 = ELLIPSIS_SIZE;
- t3 = OVERHEAD;
- if (typeof t2 !== "number")
- throw t2.$add();
- if (typeof t3 !== "number")
- throw H.iae(t3);
- if (typeof t1 !== "number")
- throw t1.$add();
- $length = t1 + (t2 + t3);
- }
- }
- if (elision != null)
- J.add$1$ax(result, elision);
- J.add$1$ax(result, penultimateString);
- J.add$1$ax(result, ultimateString);
- }
+ P._iterablePartsToStrings(iterable, parts);
} finally {
t1 = $.get$_toStringVisiting();
t1.remove$1(t1, iterable);
}
t1 = P.StringBuffer$("(");
- t1.writeAll$2(result, ", ");
+ t1.writeAll$2(parts, ", ");
t1.write$1(")");
return t1._contents;
},
+_iterablePartsToStrings: function(iterable, parts) {
+ var it, $length, count, next, ultimateString, penultimateString, penultimate, ultimate, ultimate0, elision;
+ it = iterable.get$iterator(iterable);
+ $length = 0;
+ count = 0;
+ while (true) {
+ if (!($length < 80 || count < 3))
+ break;
+ if (!it.moveNext$0())
+ return;
+ next = H.S(it.get$current());
+ parts.push(next);
+ $length += next.length + 2;
+ ++count;
+ }
+ if (!it.moveNext$0()) {
+ if (count <= 5)
+ return;
+ if (0 >= parts.length)
+ throw H.ioore(parts, 0);
+ ultimateString = parts.pop();
+ if (0 >= parts.length)
+ throw H.ioore(parts, 0);
+ penultimateString = parts.pop();
+ } else {
+ penultimate = it.get$current();
+ ++count;
+ if (!it.moveNext$0()) {
+ if (count <= 4) {
+ parts.push(H.S(penultimate));
+ return;
+ }
+ ultimateString = H.S(penultimate);
+ if (0 >= parts.length)
+ throw H.ioore(parts, 0);
+ penultimateString = parts.pop();
+ $length += ultimateString.length + 2;
+ } else {
+ ultimate = it.get$current();
+ ++count;
+ for (; it.moveNext$0(); penultimate = ultimate, ultimate = ultimate0) {
+ ultimate0 = it.get$current();
+ ++count;
+ if (count > 100) {
+ while (true) {
+ if (!($length > 75 && count > 3))
+ break;
+ if (0 >= parts.length)
+ throw H.ioore(parts, 0);
+ $length -= parts.pop().length + 2;
+ --count;
+ }
+ parts.push("...");
+ return;
+ }
+ }
+ penultimateString = H.S(penultimate);
+ ultimateString = H.S(ultimate);
+ $length += ultimateString.length + penultimateString.length + 4;
+ }
+ }
+ if (count > parts.length + 2) {
+ $length += 5;
+ elision = "...";
+ } else
+ elision = null;
+ while (true) {
+ if (!($length > 80 && parts.length > 3))
+ break;
+ if (0 >= parts.length)
+ throw H.ioore(parts, 0);
+ $length -= parts.pop().length + 2;
+ if (elision == null) {
+ $length += 5;
+ elision = "...";
+ }
+ }
+ if (elision != null)
+ parts.push(elision);
+ parts.push(penultimateString);
+ parts.push(ultimateString);
+},
+
LinkedHashMap_LinkedHashMap: function(equals, hashCode, isValidKey, $K, $V) {
var t1 = new P._LinkedHashMap(0, null, null, null, null, null, 0);
H.setRuntimeTypeInfo(t1, [$K, $V]);
@@ -4098,7 +4004,10 @@ _HashMap: {"": "Object;_collection$_length,_strings,_nums,_rest,_keys",
get$length: function(_) {
return this._collection$_length;
},
- get$keys: function() {
+ get$isEmpty: function(_) {
+ return this._collection$_length === 0;
+ },
+ get$keys: function(_) {
var t1 = new P.HashMapKeyIterable(this);
H.setRuntimeTypeInfo(t1, [H.getRuntimeTypeArgument(this, "_HashMap", 0)]);
return t1;
@@ -4249,6 +4158,7 @@ _HashMap: {"": "Object;_collection$_length,_strings,_nums,_rest,_keys",
return -1;
},
$isMap: true,
+ $asMap: null,
static: {
_HashMap__setTableEntry: function(table, key, value) {
if (value == null)
@@ -4270,13 +4180,17 @@ _HashMap_values_closure: {"": "Closure;this_0",
call$1: function(each) {
var t1 = this.this_0;
return t1.$index(t1, each);
- }
+ },
+ $is_args1: true
},
HashMapKeyIterable: {"": "IterableBase;_map",
get$length: function(_) {
return this._map._collection$_length;
},
+ get$isEmpty: function(_) {
+ return this._map._collection$_length === 0;
+ },
get$iterator: function(_) {
var t1 = this._map;
return new P.HashMapKeyIterator(t1, t1._computeKeys$0(), 0, null);
@@ -4321,7 +4235,10 @@ _LinkedHashMap: {"": "Object;_collection$_length,_strings,_nums,_rest,_first,_la
get$length: function(_) {
return this._collection$_length;
},
- get$keys: function() {
+ get$isEmpty: function(_) {
+ return this._collection$_length === 0;
+ },
+ get$keys: function(_) {
var t1 = new P.LinkedHashMapKeyIterable(this);
H.setRuntimeTypeInfo(t1, [H.getRuntimeTypeArgument(this, "_LinkedHashMap", 0)]);
return t1;
@@ -4331,7 +4248,7 @@ _LinkedHashMap: {"": "Object;_collection$_length,_strings,_nums,_rest,_first,_la
H.setRuntimeTypeInfo(t1, [H.getRuntimeTypeArgument(this, "_LinkedHashMap", 0)]);
return H.MappedIterable_MappedIterable(t1, new P._LinkedHashMap_values_closure(this), H.getRuntimeTypeArgument(t1, "IterableBase", 0), null);
},
- containsKey$1: function(key) {
+ containsKey$1: function(_, key) {
var nums, rest;
if ((key & 0x3ffffff) === key) {
nums = this._nums;
@@ -4493,7 +4410,7 @@ _LinkedHashMap: {"": "Object;_collection$_length,_strings,_nums,_rest,_first,_la
return -1;
$length = bucket.length;
for (i = 0; i < $length; ++i)
- if (J.$eq(bucket[i].get$_key(), key))
+ if (J.$eq(J.get$_key$x(bucket[i]), key))
return i;
return -1;
},
@@ -4501,6 +4418,7 @@ _LinkedHashMap: {"": "Object;_collection$_length,_strings,_nums,_rest,_first,_la
return P.Maps_mapToString(this);
},
$isMap: true,
+ $asMap: null,
static: {
_LinkedHashMap__newHashTable: function() {
var table = Object.create(null);
@@ -4515,15 +4433,19 @@ _LinkedHashMap_values_closure: {"": "Closure;this_0",
call$1: function(each) {
var t1 = this.this_0;
return t1.$index(t1, each);
- }
+ },
+ $is_args1: true
},
-LinkedHashMapCell: {"": "Object;_key<,_collection$_value@,_next<,_previous<"},
+LinkedHashMapCell: {"": "Object;_key>,_collection$_value@,_next<,_previous<"},
LinkedHashMapKeyIterable: {"": "IterableBase;_map",
get$length: function(_) {
return this._map._collection$_length;
},
+ get$isEmpty: function(_) {
+ return this._map._collection$_length === 0;
+ },
get$iterator: function(_) {
var t1 = this._map;
t1 = new P.LinkedHashMapKeyIterator(t1, t1._modifications, null, null);
@@ -4575,6 +4497,9 @@ _HashSet: {"": "_HashSetBase;",
get$length: function(_) {
return this._collection$_length;
},
+ get$isEmpty: function(_) {
+ return this._collection$_length === 0;
+ },
contains$1: function(_, object) {
var strings, nums, rest;
if (typeof object === "string" && object !== "__proto__") {
@@ -4762,6 +4687,12 @@ IterableBase: {"": "Object;",
for (t1 = this.get$iterator(this); t1.moveNext$0();)
f.call$1(t1.get$current());
},
+ toList$1$growable: function(_, growable) {
+ return P.List_List$from(this, growable, H.getRuntimeTypeArgument(this, "IterableBase", 0));
+ },
+ toList$0: function($receiver) {
+ return this.toList$1$growable($receiver, true);
+ },
get$length: function(_) {
var it, count;
it = this.get$iterator(this);
@@ -4769,6 +4700,9 @@ IterableBase: {"": "Object;",
++count;
return count;
},
+ get$isEmpty: function(_) {
+ return !this.get$iterator(this).moveNext$0();
+ },
elementAt$1: function(_, index) {
var t1, remaining, element;
if (index < 0)
@@ -4795,19 +4729,6 @@ ListMixin: {"": "Object;",
},
forEach$1: function(receiver, action) {
var $length, i;
- if (typeof receiver !== "string" && (typeof receiver !== "object" || receiver === null || receiver.constructor !== Array && !H.isJsIndexable(receiver, receiver[init.dispatchPropertyName])))
- return this.forEach$1$bailout(1, receiver, action);
- $length = C.JS_CONST_ZYJ(receiver);
- for (i = 0; i < $length; ++i) {
- if (i >= C.JS_CONST_ZYJ(receiver))
- throw H.ioore(receiver, i);
- action.call$1(receiver[i]);
- if ($length !== C.JS_CONST_ZYJ(receiver))
- throw H.wrapException(P.ConcurrentModificationError$(receiver));
- }
- },
- forEach$1$bailout: function(state0, receiver, action) {
- var $length, i;
$length = this.get$length(receiver);
for (i = 0; i < $length; ++i) {
action.call$1(this.$index(receiver, i));
@@ -4815,18 +4736,8 @@ ListMixin: {"": "Object;",
throw H.wrapException(P.ConcurrentModificationError$(receiver));
}
},
- add$1: function(receiver, element) {
- var t1 = this.get$length(receiver);
- this.set$length(receiver, t1 + 1);
- this.$indexSet(receiver, t1, element);
- },
- removeLast$0: function(receiver) {
- var result;
- if (this.get$length(receiver) === 0)
- throw H.wrapException(P.StateError$("No elements"));
- result = this.$index(receiver, this.get$length(receiver) - 1);
- this.set$length(receiver, this.get$length(receiver) - 1);
- return result;
+ get$isEmpty: function(receiver) {
+ return this.get$length(receiver) === 0;
},
toString$0: function(receiver) {
var result, t1;
@@ -4881,12 +4792,12 @@ ListQueue: {"": "IterableBase;_table,_head,_tail,_modificationCount",
H.throwExpression(P.ConcurrentModificationError$(this));
}
},
+ get$isEmpty: function(_) {
+ return this._head === this._tail;
+ },
get$length: function(_) {
return (this._tail - this._head & this._table.length - 1) >>> 0;
},
- add$1: function(_, element) {
- this._add$1(element);
- },
toString$0: function(_) {
return H.IterableMixinWorkaround_toStringIterable(this, "{", "}");
},
@@ -4904,18 +4815,6 @@ ListQueue: {"": "IterableBase;_table,_head,_tail,_modificationCount",
this._head = (t2 + 1 & t3 - 1) >>> 0;
return result;
},
- removeLast$0: function(_) {
- var t1, t2;
- if (this._head === this._tail)
- throw H.wrapException(P.StateError$("No elements"));
- this._modificationCount = this._modificationCount + 1;
- this._tail = (this._tail - 1 & this._table.length - 1) >>> 0;
- t1 = this._table;
- t2 = this._tail;
- if (t2 < 0 || t2 >= t1.length)
- throw H.ioore(t1, t2);
- return t1[t2];
- },
_add$1: function(element) {
var t1, t2, t3;
t1 = this._table;
@@ -4989,6 +4888,75 @@ _ListQueueIterator$: function(queue) {
}}
}}],
+["dart.convert", "dart:convert", , P, {
+_convertJsonToDart: function(json, reviver) {
+ var revive = new P._convertJsonToDart_closure();
+ return revive.call$2(null, new P._convertJsonToDart_walk(revive).call$1(json));
+},
+
+_parseJson: function(source, reviver) {
+ var parsed, e, t1, exception;
+ t1 = source;
+ if (typeof t1 !== "string")
+ throw H.wrapException(new P.ArgumentError(source));
+ parsed = null;
+ try {
+ parsed = JSON.parse(source);
+ } catch (exception) {
+ t1 = H.unwrapException(exception);
+ e = t1;
+ throw H.wrapException(P.FormatException$(String(e)));
+ }
+
+ return P._convertJsonToDart(parsed, reviver);
+},
+
+_convertJsonToDart_closure: {"": "Closure;",
+ call$2: function(key, value) {
+ return value;
+ },
+ $is_args2: true
+},
+
+_convertJsonToDart_walk: {"": "Closure;revive_0",
+ call$1: function(e) {
+ var list, t1, i, keys, map, key, proto;
+ if (e == null || typeof e != "object")
+ return e;
+ if (Object.getPrototypeOf(e) === Array.prototype) {
+ list = e;
+ for (t1 = this.revive_0, i = 0; i < list.length; ++i)
+ list[i] = t1.call$2(i, this.call$1(list[i]));
+ return list;
+ }
+ keys = Object.keys(e);
+ map = H.fillLiteralMap([], P.LinkedHashMap_LinkedHashMap(null, null, null, null, null));
+ for (t1 = this.revive_0, i = 0; i < keys.length; ++i) {
+ key = keys[i];
+ map.$indexSet(map, key, t1.call$2(key, this.call$1(e[key])));
+ }
+ proto = e.__proto__;
+ if (typeof proto !== "undefined" && proto !== Object.prototype)
+ map.$indexSet(map, "__proto__", t1.call$2("__proto__", this.call$1(proto)));
+ return map;
+ },
+ $is_args1: true
+},
+
+Codec: {"": "Object;"},
+
+Converter: {"": "Object;"},
+
+JsonCodec: {"": "Codec;",
+ decode$2$reviver: function(source, reviver) {
+ return P._parseJson(source, C.JsonDecoder_null._reviver);
+ },
+ decode$1: function(source) {
+ return this.decode$2$reviver(source, null);
+ }
+},
+
+JsonDecoder: {"": "Converter;_reviver"}}],
["dart.core", "dart:core", , P, {
_symbolToString: function(symbol) {
return H.Symbol_getName(symbol);
@@ -5057,14 +5025,14 @@ List_List: function($length, $E) {
if ($length == null)
return new Array(0);
if (typeof $length !== "number" || Math.floor($length) !== $length || $length < 0)
- throw H.wrapException(P.ArgumentError$("Length must be a positive integer: " + H.S($length) + "."));
+ throw H.wrapException(new P.ArgumentError("Length must be a positive integer: " + H.S($length) + "."));
return H.Primitives_newFixedList($length);
},
List_List$filled: function($length, fill, $E) {
var result, t1, i;
if ($length < 0)
- throw H.wrapException(P.ArgumentError$("Length must be a positive integer: " + $length + "."));
+ throw H.wrapException(new P.ArgumentError("Length must be a positive integer: " + $length + "."));
result = H.Primitives_newFixedList($length);
if ($length !== 0 && true)
for (t1 = result.length, i = 0; i < t1; ++i)
@@ -5111,22 +5079,13 @@ NoSuchMethodError_toString_closure: {"": "Closure;box_0",
Duration: {"": "Object;_duration",
$lt: function(_, other) {
- var t1 = other.get$_duration();
- if (typeof t1 !== "number")
- throw H.iae(t1);
- return C.JSNumber_methods.$lt(this._duration, t1);
+ return C.JSNumber_methods.$lt(this._duration, other.get$_duration());
},
$gt: function(_, other) {
- var t1 = other.get$_duration();
- if (typeof t1 !== "number")
- throw H.iae(t1);
- return C.JSNumber_methods.$gt(this._duration, t1);
+ return C.JSNumber_methods.$gt(this._duration, other.get$_duration());
},
$ge: function(_, other) {
- var t1 = other.get$_duration();
- if (typeof t1 !== "number")
- throw H.iae(t1);
- return C.JSNumber_methods.$ge(this._duration, t1);
+ return C.JSNumber_methods.$ge(this._duration, other.get$_duration());
},
$eq: function(_, other) {
var t1;
@@ -5174,7 +5133,8 @@ Duration_toString_sixDigits: {"": "Closure;",
if (t1.$gt(n, 10))
return "0000" + H.S(n);
return "00000" + H.S(n);
- }
+ },
+ $is_args1: true
},
Duration_toString_twoDigits: {"": "Closure;",
@@ -5182,7 +5142,8 @@ Duration_toString_twoDigits: {"": "Closure;",
if (J.$ge$n(n, 10))
return H.S(n);
return "0" + H.S(n);
- }
+ },
+ $is_args1: true
},
Error: {"": "Object;",
@@ -5254,7 +5215,7 @@ ConcurrentModificationError: {"": "Error;modifiedObject",
var t1 = this.modifiedObject;
if (t1 == null)
return "Concurrent modification during iteration.";
- return "Concurrent modification during iteration: " + H.S(P.Error_safeToString(t1)) + ".";
+ return "Concurrent modification during iteration: " + P.Error_safeToString(t1) + ".";
},
static: {
ConcurrentModificationError$: function(modifiedObject) {
@@ -5290,8 +5251,18 @@ _ExceptionImplementation: {"": "Object;message",
if (t1 == null)
return "Exception";
return "Exception: " + H.S(t1);
+ }
+},
+
+FormatException: {"": "Object;message",
+ toString$0: function(_) {
+ return "FormatException: " + this.message;
},
- $isException: true
+ static: {
+FormatException$: function(message) {
+ return new P.FormatException(message);
+}}
+
},
Expando: {"": "Object;name",
@@ -5355,12 +5326,10 @@ StringBuffer: {"": "Object;_contents<",
get$length: function(_) {
return this._contents.length;
},
- write$1: function(obj) {
- if (typeof obj !== "string")
- return this.write$1$bailout(1, obj);
- this._contents = this._contents + obj;
+ get$isEmpty: function(_) {
+ return this._contents.length === 0;
},
- write$1$bailout: function(state0, obj) {
+ write$1: function(obj) {
var str = typeof obj === "string" ? obj : H.S(obj);
this._contents = this._contents + str;
},
@@ -5402,83 +5371,165 @@ StringBuffer$: function($content) {
Symbol: {"": "Object;"}}],
["dart.dom.html", "dart:html", , W, {
-Geolocation_getCurrentPosition_closure: {"": "Closure;this_0,completer_1",
- call$1: function(position) {
- var t1, t2;
- t1 = C.Geolocation_methods._ensurePosition$1(this.this_0, position);
- t2 = this.completer_1.future;
- if (t2._state !== 0)
- H.throwExpression(new P.StateError("Future already completed"));
- t2._asyncComplete$1(t1);
- }
+HttpRequest_getString: function(url, onProgress, withCredentials) {
+ return W.HttpRequest_request(url, null, null, onProgress, null, null, null, withCredentials).then$1(new W.HttpRequest_getString_closure());
+},
+
+HttpRequest_request: function(url, method, mimeType, onProgress, requestHeaders, responseType, sendData, withCredentials) {
+ var t1, completer, xhr, t2;
+ t1 = W.HttpRequest;
+ completer = new P._AsyncCompleter(P._Future$(t1));
+ H.setRuntimeTypeInfo(completer, [t1]);
+ xhr = new XMLHttpRequest();
+ C.HttpRequest_methods.open$3$async(xhr, "GET", url, true);
+ t1 = new W._EventStream(xhr, C.EventStreamProvider_load._eventType, false);
+ H.setRuntimeTypeInfo(t1, [null]);
+ t2 = new W._EventStreamSubscription(0, t1._target, t1._eventType, W._wrapZone(new W.HttpRequest_request_closure(completer, xhr)), t1._useCapture);
+ H.setRuntimeTypeInfo(t2, [H.getRuntimeTypeArgument(t1, "_EventStream", 0)]);
+ t2._tryResume$0();
+ t2 = new W._EventStream(xhr, C.EventStreamProvider_error._eventType, false);
+ H.setRuntimeTypeInfo(t2, [null]);
+ t1 = completer.get$completeError();
+ t1 = new W._EventStreamSubscription(0, t2._target, t2._eventType, W._wrapZone(t1), t2._useCapture);
+ H.setRuntimeTypeInfo(t1, [H.getRuntimeTypeArgument(t2, "_EventStream", 0)]);
+ t1._tryResume$0();
+ xhr.send();
+ return completer.future;
+},
+
+_convertNativeToDart_EventTarget: function(e) {
+ var $window, t1;
+ if (e == null)
+ return;
+ if ("setInterval" in e) {
+ $window = W._DOMWindowCrossFrame__createSafe(e);
+ t1 = J.getInterceptor($window);
+ if (typeof $window === "object" && $window !== null && !!t1.$isEventTarget)
+ return $window;
+ return;
+ } else
+ return e;
},
-Geolocation_getCurrentPosition_closure0: {"": "Closure;completer_2",
- call$1: function(error) {
- var t1 = this.completer_2.future;
- if (t1._state !== 0)
- H.throwExpression(new P.StateError("Future already completed"));
- t1._asyncCompleteError$2(error, null);
- }
+_wrapZone: function(callback) {
+ var t1 = $.Zone__current;
+ if (t1 === C.C__RootZone)
+ return callback;
+ return t1.bindUnaryCallback$2$runGuarded(callback, true);
},
-Geolocation_watchPosition_closure0: {"": "Closure;box_0,this_1,options_2",
- call$0: function() {
- var t1, t2;
- t1 = this.this_1;
- t2 = this.box_0;
- t2.watchId_0 = C.Geolocation_methods._watchPosition$3(t1, new W.Geolocation_watchPosition__closure(t2, t1), new W.Geolocation_watchPosition__closure0(t2), this.options_2);
- }
+HttpRequest_getString_closure: {"": "Closure;",
+ call$1: function(xhr) {
+ return J.get$responseText$x(xhr);
+ },
+ $is_args1: true
},
-Geolocation_watchPosition__closure: {"": "Closure;box_0,this_3",
- call$1: function(position) {
- var t1, t2;
- t1 = this.box_0.controller_1;
- t2 = C.Geolocation_methods._ensurePosition$1(this.this_3, position);
- if (t1._state >= 4)
- H.throwExpression(t1._badEventState$0());
- t1._async$_add$1(t2);
- }
+HttpRequest_request_closure0: {"": "Closure;xhr_0",
+ call$2: function(header, value) {
+ this.xhr_0.setRequestHeader(header, value);
+ },
+ $is_args2: true
},
-Geolocation_watchPosition__closure0: {"": "Closure;box_0",
- call$1: function(error) {
- this.box_0.controller_1.addError$1(error);
- }
+HttpRequest_request_closure: {"": "Closure;completer_1,xhr_2",
+ call$1: function(e) {
+ var t1, t2, t3;
+ t1 = this.xhr_2;
+ t2 = t1.status;
+ if (typeof t2 !== "number")
+ throw t2.$ge();
+ t2 = t2 >= 200 && t2 < 300 || t2 === 0 || t2 === 304;
+ t3 = this.completer_1;
+ if (t2) {
+ t2 = t3.future;
+ if (t2._state !== 0)
+ H.throwExpression(P.StateError$("Future already completed"));
+ t2._asyncComplete$1(t1);
+ } else {
+ t1 = t3.future;
+ if (t1._state !== 0)
+ H.throwExpression(P.StateError$("Future already completed"));
+ t1._asyncCompleteError$2(e, null);
+ }
+ },
+ $is_args1: true
},
-Geolocation_watchPosition_closure: {"": "Closure;box_0,this_4",
- call$0: function() {
- this.this_4.clearWatch(this.box_0.watchId_0);
- }
+Storage_keys_closure: {"": "Closure;keys_0",
+ call$2: function(k, v) {
+ return this.keys_0.push(k);
+ },
+ $is_args2: true
+},
+
+Storage_values_closure: {"": "Closure;values_0",
+ call$2: function(k, v) {
+ return this.values_0.push(v);
+ },
+ $is_args2: true
},
-_GeopositionWrapper: {"": "Object;_ptr",
- get$coords: function(_) {
- return this._ptr.coords;
+_EventStream: {"": "Stream;_target,_eventType,_useCapture",
+ listen$4$cancelOnError$onDone$onError: function(onData, cancelOnError, onDone, onError) {
+ var t1 = new W._EventStreamSubscription(0, this._target, this._eventType, W._wrapZone(onData), this._useCapture);
+ H.setRuntimeTypeInfo(t1, [H.getRuntimeTypeArgument(this, "_EventStream", 0)]);
+ t1._tryResume$0();
+ return t1;
+ },
+ $asStream: null
+},
+
+_ElementEventStreamImpl: {"": "_EventStream;_target,_eventType,_useCapture", $as_EventStream: null},
+
+_EventStreamSubscription: {"": "StreamSubscription;_pauseCount,_target,_eventType,_onData,_useCapture",
+ cancel$0: function() {
+ if (this._target == null)
+ return;
+ this._unlisten$0();
+ this._target = null;
+ this._onData = null;
+ },
+ _tryResume$0: function() {
+ var t1 = this._onData;
+ if (t1 != null && this._pauseCount <= 0)
+ J.addEventListener$3$x(this._target, this._eventType, t1, this._useCapture);
+ },
+ _unlisten$0: function() {
+ var t1 = this._onData;
+ if (t1 != null)
+ J.removeEventListener$3$x(this._target, this._eventType, t1, this._useCapture);
},
- $isGeoposition: true
+ $asStreamSubscription: null
},
-HtmlElement: {"": "Element;", "%": "HTMLAppletElement|HTMLBRElement|HTMLBaseElement|HTMLBaseFontElement|HTMLBodyElement|HTMLButtonElement|HTMLCanvasElement|HTMLContentElement|HTMLDListElement|HTMLDataListElement|HTMLDetailsElement|HTMLDialogElement|HTMLDirectoryElement|HTMLDivElement|HTMLEmbedElement|HTMLFieldSetElement|HTMLFontElement|HTMLFrameElement|HTMLFrameSetElement|HTMLHRElement|HTMLHeadElement|HTMLHeadingElement|HTMLHtmlElement|HTMLIFrameElement|HTMLImageElement|HTMLInputElement|HTMLKeygenElement|HTMLLIElement|HTMLLabelElement|HTMLLegendElement|HTMLLinkElement|HTMLMapElement|HTMLMarqueeElement|HTMLMenuElement|HTMLMetaElement|HTMLMeterElement|HTMLModElement|HTMLOListElement|HTMLOptGroupElement|HTMLOptionElement|HTMLOutputElement|HTMLParagraphElement|HTMLParamElement|HTMLPreElement|HTMLProgressElement|HTMLQuoteElement|HTMLScriptElement|HTMLShadowElement|HTMLSourceElement|HTMLSpanElement|HTMLStyleElement|HTMLTableCaptionElement|HTMLTableCellElement|HTMLTableColElement|HTMLTableDataCellElement|HTMLTableElement|HTMLTableHeaderCellElement|HTMLTableRowElement|HTMLTableSectionElement|HTMLTemplateElement|HTMLTextAreaElement|HTMLTitleElement|HTMLTrackElement|HTMLUListElement|HTMLUnknownElement;HTMLElement"},
+EventStreamProvider: {"": "Object;_eventType"},
-AnchorElement: {"": "HtmlElement;",
+_DOMWindowCrossFrame: {"": "Object;_window", $isEventTarget: true, static: {
+_DOMWindowCrossFrame__createSafe: function(w) {
+ if (w === window)
+ return w;
+ else
+ return new W._DOMWindowCrossFrame(w);
+}}
+},
+
+HtmlElement: {"": "Element;", "%": "HTMLAppletElement|HTMLBRElement|HTMLBaseFontElement|HTMLBodyElement|HTMLCanvasElement|HTMLContentElement|HTMLDListElement|HTMLDataListElement|HTMLDetailsElement|HTMLDialogElement|HTMLDirectoryElement|HTMLDivElement|HTMLEmbedElement|HTMLFontElement|HTMLFrameElement|HTMLFrameSetElement|HTMLHRElement|HTMLHeadElement|HTMLHeadingElement|HTMLHtmlElement|HTMLIFrameElement|HTMLImageElement|HTMLLIElement|HTMLLabelElement|HTMLLegendElement|HTMLMapElement|HTMLMarqueeElement|HTMLMenuElement|HTMLMetaElement|HTMLMeterElement|HTMLModElement|HTMLOListElement|HTMLObjectElement|HTMLOutputElement|HTMLParagraphElement|HTMLParamElement|HTMLPreElement|HTMLProgressElement|HTMLQuoteElement|HTMLScriptElement|HTMLShadowElement|HTMLSourceElement|HTMLSpanElement|HTMLTableCaptionElement|HTMLTableCellElement|HTMLTableColElement|HTMLTableDataCellElement|HTMLTableElement|HTMLTableHeaderCellElement|HTMLTableRowElement|HTMLTableSectionElement|HTMLTemplateElement|HTMLTitleElement|HTMLTrackElement|HTMLUListElement|HTMLUnknownElement;HTMLElement"},
+
+AnchorElement: {"": "HtmlElement;target=",
toString$0: function(receiver) {
return receiver.toString();
},
"%": "HTMLAnchorElement"
},
-AreaElement: {"": "HtmlElement;coords=", "%": "HTMLAreaElement"},
-
-CloseEvent: {"": "Event;code=", "%": "CloseEvent"},
+AreaElement: {"": "HtmlElement;target=", "%": "HTMLAreaElement"},
-Coordinates: {"": "Interceptor;latitude=,longitude=", "%": "Coordinates"},
+BaseElement: {"": "HtmlElement;target=", "%": "HTMLBaseElement"},
-CssFontFaceLoadEvent: {"": "Event;error=", "%": "CSSFontFaceLoadEvent"},
+ButtonElement: {"": "HtmlElement;disabled}", "%": "HTMLButtonElement"},
-DomError: {"": "Interceptor;", "%": ";DOMError"},
+CharacterData: {"": "Node;length=", "%": "CDATASection|Comment|Text;CharacterData"},
DomException: {"": "Interceptor;",
toString$0: function(receiver) {
@@ -5491,122 +5542,152 @@ Element: {"": "Node;",
toString$0: function(receiver) {
return receiver.localName;
},
- "%": "SVGAElement|SVGAltGlyphDefElement|SVGAltGlyphElement|SVGAltGlyphItemElement|SVGAnimateColorElement|SVGAnimateElement|SVGAnimateMotionElement|SVGAnimateTransformElement|SVGAnimationElement|SVGCircleElement|SVGClipPathElement|SVGComponentTransferFunctionElement|SVGCursorElement|SVGDefsElement|SVGDescElement|SVGElement|SVGEllipseElement|SVGFEBlendElement|SVGFEColorMatrixElement|SVGFEComponentTransferElement|SVGFECompositeElement|SVGFEConvolveMatrixElement|SVGFEDiffuseLightingElement|SVGFEDisplacementMapElement|SVGFEDistantLightElement|SVGFEDropShadowElement|SVGFEFloodElement|SVGFEFuncAElement|SVGFEFuncBElement|SVGFEFuncGElement|SVGFEFuncRElement|SVGFEGaussianBlurElement|SVGFEImageElement|SVGFEMergeElement|SVGFEMergeNodeElement|SVGFEMorphologyElement|SVGFEOffsetElement|SVGFEPointLightElement|SVGFESpecularLightingElement|SVGFESpotLightElement|SVGFETileElement|SVGFETurbulenceElement|SVGFilterElement|SVGFontElement|SVGFontFaceElement|SVGFontFaceFormatElement|SVGFontFaceNameElement|SVGFontFaceSrcElement|SVGFontFaceUriElement|SVGForeignObjectElement|SVGGElement|SVGGlyphElement|SVGGlyphRefElement|SVGGradientElement|SVGGraphicsElement|SVGHKernElement|SVGImageElement|SVGLineElement|SVGLinearGradientElement|SVGMPathElement|SVGMarkerElement|SVGMaskElement|SVGMetadataElement|SVGMissingGlyphElement|SVGPathElement|SVGPatternElement|SVGPolygonElement|SVGPolylineElement|SVGRadialGradientElement|SVGRectElement|SVGSVGElement|SVGScriptElement|SVGSetElement|SVGStopElement|SVGStyleElement|SVGSwitchElement|SVGSymbolElement|SVGTRefElement|SVGTSpanElement|SVGTextContentElement|SVGTextElement|SVGTextPathElement|SVGTextPositioningElement|SVGTitleElement|SVGUseElement|SVGVKernElement|SVGViewElement;Element"
+ "%": ";Element"
},
ErrorEvent: {"": "Event;error=", "%": "ErrorEvent"},
-Event: {"": "Interceptor;", "%": "AudioProcessingEvent|AutocompleteErrorEvent|BeforeLoadEvent|CompositionEvent|CustomEvent|DeviceMotionEvent|DeviceOrientationEvent|DragEvent|FocusEvent|HashChangeEvent|IDBVersionChangeEvent|KeyboardEvent|MIDIConnectionEvent|MIDIMessageEvent|MSPointerEvent|MediaKeyEvent|MediaKeyMessageEvent|MediaKeyNeededEvent|MediaStreamEvent|MediaStreamTrackEvent|MessageEvent|MouseEvent|MouseScrollEvent|MouseWheelEvent|MutationEvent|OfflineAudioCompletionEvent|OverflowEvent|PageTransitionEvent|PointerEvent|PopStateEvent|ProgressEvent|RTCDTMFToneChangeEvent|RTCDataChannelEvent|RTCIceCandidateEvent|ResourceProgressEvent|SVGZoomEvent|SecurityPolicyViolationEvent|SpeechInputEvent|SpeechRecognitionEvent|SpeechSynthesisEvent|StorageEvent|TextEvent|TouchEvent|TrackEvent|TransitionEvent|UIEvent|WebGLContextEvent|WebKitAnimationEvent|WebKitTransitionEvent|WheelEvent|XMLHttpRequestProgressEvent;Event"},
-
-EventTarget: {"": "Interceptor;", "%": "MediaStream;EventTarget"},
-
-FileError: {"": "DomError;code=", "%": "FileError"},
-
-FormElement: {"": "HtmlElement;length=", "%": "HTMLFormElement"},
-
-Geolocation: {"": "Interceptor;",
- getCurrentPosition$3$enableHighAccuracy$maximumAge$timeout: function(receiver, enableHighAccuracy, maximumAge, timeout) {
- var options, completer, e, stacktrace, t1, completer0, exception;
- options = H.fillLiteralMap([], P.LinkedHashMap_LinkedHashMap(null, null, null, null, null));
- t1 = W.Geoposition;
- completer0 = new P._AsyncCompleter(P._Future$(t1));
- H.setRuntimeTypeInfo(completer0, [t1]);
- completer = completer0;
- try {
- this._getCurrentPosition$3(receiver, new W.Geolocation_getCurrentPosition_closure(receiver, completer), new W.Geolocation_getCurrentPosition_closure0(completer), options);
- } catch (exception) {
- t1 = H.unwrapException(exception);
- e = t1;
- stacktrace = new H._StackTrace(exception, null);
- t1 = completer.get$future();
- if (t1._state !== 0)
- H.throwExpression(new P.StateError("Future already completed"));
- t1._asyncCompleteError$2(e, stacktrace);
- }
-
- return completer.get$future();
- },
- getCurrentPosition$0: function($receiver) {
- return this.getCurrentPosition$3$enableHighAccuracy$maximumAge$timeout($receiver, null, null, null);
+Event: {"": "Interceptor;",
+ get$target: function(receiver) {
+ return W._convertNativeToDart_EventTarget(receiver.target);
},
- watchPosition$3$enableHighAccuracy$maximumAge$timeout: function(receiver, enableHighAccuracy, maximumAge, timeout) {
- var t1, options;
- t1 = {};
- options = H.fillLiteralMap([], P.LinkedHashMap_LinkedHashMap(null, null, null, null, null));
- t1.watchId_0 = null;
- t1.controller_1 = null;
- t1.controller_1 = P.StreamController_StreamController(new W.Geolocation_watchPosition_closure(t1, receiver), new W.Geolocation_watchPosition_closure0(t1, receiver, options), null, null, true, W.Geoposition);
- t1 = t1.controller_1;
- t1.toString;
- t1 = new P._ControllerStream(t1);
- H.setRuntimeTypeInfo(t1, [null]);
- return t1;
+ "%": "AudioProcessingEvent|AutocompleteErrorEvent|BeforeLoadEvent|BeforeUnloadEvent|CSSFontFaceLoadEvent|CloseEvent|CustomEvent|DeviceMotionEvent|DeviceOrientationEvent|HashChangeEvent|IDBVersionChangeEvent|MIDIConnectionEvent|MIDIMessageEvent|MediaKeyEvent|MediaKeyMessageEvent|MediaKeyNeededEvent|MediaStreamEvent|MediaStreamTrackEvent|MessageEvent|MutationEvent|OfflineAudioCompletionEvent|OverflowEvent|PageTransitionEvent|PopStateEvent|RTCDTMFToneChangeEvent|RTCDataChannelEvent|RTCIceCandidateEvent|SecurityPolicyViolationEvent|SpeechInputEvent|SpeechRecognitionEvent|SpeechSynthesisEvent|StorageEvent|TrackEvent|TransitionEvent|WebGLContextEvent|WebKitAnimationEvent|WebKitTransitionEvent;Event"
+},
+
+EventTarget: {"": "Interceptor;",
+ addEventListener$3: function(receiver, type, listener, useCapture) {
+ return receiver.addEventListener(type, H.convertDartClosureToJS(listener, 1), useCapture);
},
- watchPosition$0: function($receiver) {
- return this.watchPosition$3$enableHighAccuracy$maximumAge$timeout($receiver, null, null, null);
+ removeEventListener$3: function(receiver, type, listener, useCapture) {
+ return receiver.removeEventListener(type, H.convertDartClosureToJS(listener, 1), useCapture);
},
- _ensurePosition$1: function(receiver, domPosition) {
- var t1, t2, exception;
- try {
- t1 = domPosition;
- t2 = J.getInterceptor(t1);
- if (typeof t1 === "object" && t1 !== null && !!t2.$isGeoposition)
- return domPosition;
- } catch (exception) {
- H.unwrapException(exception);
- }
+ $isEventTarget: true,
+ "%": "MediaStream;EventTarget"
+},
+
+FieldSetElement: {"": "HtmlElement;disabled}", "%": "HTMLFieldSetElement"},
- return new W._GeopositionWrapper(domPosition);
+FormElement: {"": "HtmlElement;length=,target=", "%": "HTMLFormElement"},
+
+HttpRequest: {"": "XmlHttpRequestEventTarget;responseText=",
+ open$5$async$password$user: function(receiver, method, url, async, password, user) {
+ return receiver.open(method, url, async, user, password);
},
- _getCurrentPosition$3: function(receiver, successCallback, errorCallback, options) {
- return receiver.getCurrentPosition(H.convertDartClosureToJS(successCallback, 1), H.convertDartClosureToJS(errorCallback, 1), options);
+ open$3$async: function($receiver, method, url, async) {
+ return $receiver.open(method, url, async);
},
- _watchPosition$3: function(receiver, successCallback, errorCallback, options) {
- return receiver.watchPosition(H.convertDartClosureToJS(successCallback, 1), H.convertDartClosureToJS(errorCallback, 1), options);
+ send$1: function(receiver, data) {
+ return receiver.send(data);
},
- "%": "Geolocation"
+ "%": "XMLHttpRequest"
},
-Geoposition: {"": "Interceptor;coords=", $isGeoposition: true, "%": "Geoposition"},
+InputElement: {"": "HtmlElement;disabled}", $isInputElement: true, $isEventTarget: true, "%": "HTMLInputElement"},
-MediaElement: {"": "HtmlElement;error=", "%": "HTMLAudioElement|HTMLMediaElement|HTMLVideoElement"},
+KeygenElement: {"": "HtmlElement;disabled}", "%": "HTMLKeygenElement"},
+
+LinkElement: {"": "HtmlElement;disabled}", "%": "HTMLLinkElement"},
-MediaError: {"": "Interceptor;code=", "%": "MediaError"},
+MediaElement: {"": "HtmlElement;error=", "%": "HTMLAudioElement|HTMLMediaElement|HTMLVideoElement"},
-MediaKeyError: {"": "Interceptor;code=", "%": "MediaKeyError"},
+MouseEvent: {"": "UIEvent;", "%": "DragEvent|MSPointerEvent|MouseEvent|MouseScrollEvent|MouseWheelEvent|PointerEvent|WheelEvent"},
Node: {"": "EventTarget;",
toString$0: function(receiver) {
var t1 = receiver.nodeValue;
return t1 == null ? J.Interceptor.prototype.toString$0.call(this, receiver) : t1;
},
- "%": "Document|HTMLDocument;Node"
+ "%": "Attr|Document|DocumentFragment|DocumentType|Entity|HTMLDocument|Notation|SVGDocument|ShadowRoot;Node"
},
-ObjectElement: {"": "HtmlElement;code=", "%": "HTMLObjectElement"},
+OptGroupElement: {"": "HtmlElement;disabled}", "%": "HTMLOptGroupElement"},
+
+OptionElement: {"": "HtmlElement;disabled}", "%": "HTMLOptionElement"},
+
+ProcessingInstruction: {"": "CharacterData;target=", "%": "ProcessingInstruction"},
-PositionError: {"": "Interceptor;code=", "%": "PositionError"},
+ProgressEvent: {"": "Event;", "%": "ProgressEvent|ResourceProgressEvent|XMLHttpRequestProgressEvent"},
-SelectElement: {"": "HtmlElement;length=", "%": "HTMLSelectElement"},
+SelectElement: {"": "HtmlElement;disabled},length=", "%": "HTMLSelectElement"},
SpeechRecognitionError: {"": "Event;error=", "%": "SpeechRecognitionError"},
+Storage: {"": "Interceptor;",
+ $index: function(receiver, key) {
+ return receiver.getItem(key);
+ },
+ $indexSet: function(receiver, key, value) {
+ receiver.setItem(key, value);
+ },
+ forEach$1: function(receiver, f) {
+ var i, key;
+ for (i = 0; true; ++i) {
+ key = receiver.key(i);
+ if (key == null)
+ return;
+ f.call$2(key, receiver.getItem(key));
+ }
+ },
+ get$keys: function(receiver) {
+ var keys = [];
+ this.forEach$1(receiver, new W.Storage_keys_closure(keys));
+ return keys;
+ },
+ get$values: function(receiver) {
+ var values = [];
+ this.forEach$1(receiver, new W.Storage_values_closure(values));
+ return values;
+ },
+ get$length: function(receiver) {
+ return receiver.length;
+ },
+ get$isEmpty: function(receiver) {
+ return receiver.key(0) == null;
+ },
+ $isMap: true,
+ $asMap: function() {
+ return [J.JSString, J.JSString];
+ },
+ "%": "Storage"
+},
+
+StyleElement: {"": "HtmlElement;disabled}", "%": "HTMLStyleElement"},
+
+TextAreaElement: {"": "HtmlElement;disabled}", "%": "HTMLTextAreaElement"},
+
+UIEvent: {"": "Event;", "%": "CompositionEvent|FocusEvent|KeyboardEvent|SVGZoomEvent|TextEvent|TouchEvent;UIEvent"},
+
Window: {"": "EventTarget;",
toString$0: function(receiver) {
return receiver.toString();
},
+ $isEventTarget: true,
"%": "DOMWindow|Window"
-}}],
-["dart.dom.web_sql", "dart:web_sql", , P, {
-SqlError: {"": "Interceptor;code=", "%": "SQLError"}}],
-["dart.isolate", "dart:isolate", , P, {
-_Isolate_port: function() {
- if ($.lazyPort == null)
- $.lazyPort = H.ReceivePortImpl$();
- return $.lazyPort;
},
+XmlHttpRequestEventTarget: {"": "EventTarget;", "%": ";XMLHttpRequestEventTarget"}}],
+["dart.dom.svg", "dart:svg", , P, {
+AElement: {"": "GraphicsElement;target=", "%": "SVGAElement"},
+
+GraphicsElement: {"": "SvgElement;", "%": "SVGAltGlyphElement|SVGCircleElement|SVGClipPathElement|SVGDefsElement|SVGEllipseElement|SVGForeignObjectElement|SVGGElement|SVGImageElement|SVGLineElement|SVGPathElement|SVGPolygonElement|SVGPolylineElement|SVGRectElement|SVGSVGElement|SVGSwitchElement|SVGTSpanElement|SVGTextContentElement|SVGTextElement|SVGTextPathElement|SVGTextPositioningElement|SVGUseElement;SVGGraphicsElement"},
+
+StyleElement0: {"": "SvgElement;disabled}", "%": "SVGStyleElement"},
+
+SvgElement: {"": "Element;", "%": "SVGAltGlyphDefElement|SVGAltGlyphItemElement|SVGAnimateColorElement|SVGAnimateElement|SVGAnimateMotionElement|SVGAnimateTransformElement|SVGAnimationElement|SVGComponentTransferFunctionElement|SVGCursorElement|SVGDescElement|SVGFEBlendElement|SVGFEColorMatrixElement|SVGFEComponentTransferElement|SVGFECompositeElement|SVGFEConvolveMatrixElement|SVGFEDiffuseLightingElement|SVGFEDisplacementMapElement|SVGFEDistantLightElement|SVGFEDropShadowElement|SVGFEFloodElement|SVGFEFuncAElement|SVGFEFuncBElement|SVGFEFuncGElement|SVGFEFuncRElement|SVGFEGaussianBlurElement|SVGFEImageElement|SVGFEMergeElement|SVGFEMergeNodeElement|SVGFEMorphologyElement|SVGFEOffsetElement|SVGFEPointLightElement|SVGFESpecularLightingElement|SVGFESpotLightElement|SVGFETileElement|SVGFETurbulenceElement|SVGFilterElement|SVGFontElement|SVGFontFaceElement|SVGFontFaceFormatElement|SVGFontFaceNameElement|SVGFontFaceSrcElement|SVGFontFaceUriElement|SVGGlyphElement|SVGGlyphRefElement|SVGGradientElement|SVGHKernElement|SVGLinearGradientElement|SVGMPathElement|SVGMarkerElement|SVGMaskElement|SVGMetadataElement|SVGMissingGlyphElement|SVGPatternElement|SVGRadialGradientElement|SVGScriptElement|SVGSetElement|SVGStopElement|SVGSymbolElement|SVGTitleElement|SVGVKernElement|SVGViewElement;SVGElement"}}],
+["dart.isolate", "dart:isolate", , P, {
ReceivePort: {"": "Object;"}}],
+["dart.math", "dart:math", , P, {
+_Random: {"": "Object;",
+ nextInt$1: function(max) {
+ if (typeof max !== "number")
+ throw max.$lt();
+ if (max < 0)
+ throw H.wrapException(new P.ArgumentError("negative max: " + max));
+ if (max > 4294967295)
+ max = 4294967295;
+ return Math.random() * max >>> 0;
+ }
+}}],
["dart.typed_data", "dart:typed_data", , P, {
TypedData_ListMixin: {"": "TypedData+ListMixin;", $isList: true, $asList: null, $isEfficientLength: true},
@@ -5628,30 +5709,12 @@ Uint8List: {"": "TypedData_ListMixin_FixedLengthListMixin;",
return C.JS_CONST_ZYJ(receiver);
},
$index: function(receiver, index) {
- var t1;
- if (typeof index !== "number")
- return this.$$index$bailout(1, receiver, index);
- t1 = C.JS_CONST_ZYJ(receiver);
- if (index >>> 0 != index || index >= t1)
- this._invalidIndex$2(receiver, index, t1);
- return receiver[index];
- },
- $$index$bailout: function(state0, receiver, index) {
var t1 = C.JS_CONST_ZYJ(receiver);
if (index >>> 0 != index || J.$ge$n(index, t1))
this._invalidIndex$2(receiver, index, t1);
return receiver[index];
},
$indexSet: function(receiver, index, value) {
- var t1;
- if (typeof index !== "number")
- return this.$$indexSet$bailout(1, receiver, index, value);
- t1 = C.JS_CONST_ZYJ(receiver);
- if (index >>> 0 != index || index >= t1)
- this._invalidIndex$2(receiver, index, t1);
- receiver[index] = value;
- },
- $$indexSet$bailout: function(state0, receiver, index, value) {
var t1 = C.JS_CONST_ZYJ(receiver);
if (index >>> 0 != index || J.$ge$n(index, t1))
this._invalidIndex$2(receiver, index, t1);
@@ -5665,68 +5728,125 @@ Uint8List: {"": "TypedData_ListMixin_FixedLengthListMixin;",
$isJavaScriptIndexingBehavior: true,
"%": ";Uint8Array"
}}],
-["trip_meter.dart", "trip_meter.dart", , E, {
-calculateDistance: function(lat1, lon1, lat2, lon2) {
- var t1, t2, t3, t4, a;
- if (typeof lat2 !== "number")
- throw lat2.$sub();
- if (typeof lat1 !== "number")
- throw H.iae(lat1);
- if (typeof lon2 !== "number")
- throw lon2.$sub();
- if (typeof lon1 !== "number")
- throw H.iae(lon1);
- t1 = Math.sin((lat2 - lat1) / 2);
- t1 = Math.pow(t1, 2);
- t2 = Math.cos(lat1);
- t3 = Math.cos(lat2);
- t4 = Math.sin((lon2 - lon1) / 2);
- a = t1 + t2 * t3 * Math.pow(t4, 2);
- t1 = Math.sqrt(a);
- t2 = Math.sqrt(1 - a);
- return 6371 * (2 * Math.atan2(t1, t2));
+["", "piratebadge.dart", , A, {
+main: function() {
+ var inputField, t1, t2;
+ inputField = document.querySelector("#inputName");
+ inputField.toString;
+ t1 = new W._ElementEventStreamImpl(inputField, C.EventStreamProvider_input._eventType, false);
+ H.setRuntimeTypeInfo(t1, [null]);
+ t2 = new W._EventStreamSubscription(0, t1._target, t1._eventType, W._wrapZone(A.updateBadge$closure), t1._useCapture);
+ H.setRuntimeTypeInfo(t2, [H.getRuntimeTypeArgument(t1, "_EventStream", 0)]);
+ t2._tryResume$0();
+ $.genButton = document.querySelector("#generateButton");
+ t2 = $.genButton;
+ t2.toString;
+ t2 = new W._ElementEventStreamImpl(t2, C.EventStreamProvider_click._eventType, false);
+ H.setRuntimeTypeInfo(t2, [null]);
+ t1 = new W._EventStreamSubscription(0, t2._target, t2._eventType, W._wrapZone(A.generateBadge$closure), t2._useCapture);
+ H.setRuntimeTypeInfo(t1, [H.getRuntimeTypeArgument(t2, "_EventStream", 0)]);
+ t1._tryResume$0();
+ $.badgeNameElement = document.querySelector("#badgeName");
+ A.PirateName_readyThePirates().then$1(new A.main_closure(inputField)).catchError$1(new A.main_closure0());
+},
+
+updateBadge: function(e) {
+ var inputName, t1, t2;
+ inputName = H.interceptedTypeCast(J.get$target$x(e), "$isInputElement").value;
+ A.setBadgeName(A.PirateName$(null, inputName));
+ t1 = J.trim$0$s(inputName);
+ t2 = $.genButton;
+ if (t1.length === 0) {
+ J.set$disabled$x(t2, false);
+ t2.textContent = "Aye! Gimme a name!";
+ } else {
+ J.set$disabled$x(t2, true);
+ t2.textContent = "Arrr! Write yer name!";
+ }
},
-main: function() {
- var t1 = {};
- t1.startPosition_0 = null;
- J.getCurrentPosition$0$x(window.navigator.geolocation).then$2$onError(new E.main_closure(t1), new E.main_closure0());
- J.watchPosition$0$x(window.navigator.geolocation).listen$2$onError(new E.main_closure1(t1), new E.main_closure2());
+generateBadge: function(e) {
+ A.setBadgeName(A.PirateName$(null, null));
},
-main_closure: {"": "Closure;box_0",
- call$1: function(position) {
- var t1 = this.box_0;
- t1.startPosition_0 = position;
- document.querySelector("#start-lat").textContent = H.S(J.get$latitude$x(J.get$coords$x(t1.startPosition_0)));
- document.querySelector("#start-lon").textContent = H.S(J.get$longitude$x(J.get$coords$x(t1.startPosition_0)));
- }
+setBadgeName: function(newName) {
+ var t1;
+ if (newName == null)
+ return;
+ t1 = $.badgeNameElement;
+ t1.textContent = J.get$isEmpty$asx(newName._firstName) === true ? "" : H.S(newName._firstName) + " the " + H.S(newName._appellation);
+ window.localStorage.setItem("pirateName", "{ \"f\": \"" + H.S(newName._firstName) + "\", \"a\": \"" + H.S(newName._appellation) + "\" } ");
},
-main_closure0: {"": "Closure;",
- call$1: function(error) {
- window.alert("Error occurred. Error code: " + H.S(J.get$code$x(error)));
+getBadgeNameFromStorage: function() {
+ var storedName = window.localStorage.getItem("pirateName");
+ if (storedName != null)
+ return A.PirateName$fromJSON(storedName);
+ else
return;
- }
},
-main_closure1: {"": "Closure;box_0",
- call$1: function(position) {
- var t1, t2, distance;
- t1 = J.getInterceptor$x(position);
- document.querySelector("#current-lat").textContent = H.S(J.get$latitude$x(t1.get$coords(position)));
- document.querySelector("#current-lon").textContent = H.S(J.get$longitude$x(t1.get$coords(position)));
- t2 = this.box_0;
- distance = E.calculateDistance(J.get$latitude$x(J.get$coords$x(t2.startPosition_0)), J.get$longitude$x(J.get$coords$x(t2.startPosition_0)), J.get$latitude$x(t1.get$coords(position)), J.get$longitude$x(t1.get$coords(position)));
- document.querySelector("#distance").textContent = H.S(distance);
- }
+main_closure: {"": "Closure;inputField_0",
+ call$1: function(_) {
+ J.set$disabled$x(this.inputField_0, false);
+ J.set$disabled$x($.genButton, false);
+ A.setBadgeName(A.getBadgeNameFromStorage());
+ },
+ $is_args1: true
},
-main_closure2: {"": "Closure;",
- call$1: function(error) {
- window.alert("Error occurred. Error code: " + H.S(J.get$code$x(error)));
- return;
- }
+main_closure0: {"": "Closure;",
+ call$1: function(arrr) {
+ P.print("Error initializing pirate names: " + H.S(arrr));
+ $.badgeNameElement.textContent = "Arrr! No names.";
+ },
+ $is_args1: true
+},
+
+PirateName: {"": "Object;_firstName,_appellation",
+ toString$0: function(_) {
+ return J.get$isEmpty$asx(this._firstName) === true ? "" : H.S(this._firstName) + " the " + H.S(this._appellation);
+ },
+ PirateName$2$appellation$firstName: function(appellation, firstName) {
+ if (firstName == null)
+ this._firstName = J.$index$asx($.get$PirateName_names(), $.get$PirateName_indexGen().nextInt$1(J.get$length$asx($.get$PirateName_names())));
+ else
+ this._firstName = firstName;
+ this._appellation = J.$index$asx($.get$PirateName_appellations(), $.get$PirateName_indexGen().nextInt$1(J.get$length$asx($.get$PirateName_appellations())));
+ },
+ PirateName$fromJSON$1: function(jsonString) {
+ var storedName, t1;
+ storedName = C.C_JsonCodec.decode$1(jsonString);
+ t1 = J.getInterceptor$asx(storedName);
+ this._firstName = t1.$index(storedName, "f");
+ this._appellation = t1.$index(storedName, "a");
+ },
+ static: {
+"": "PirateName_indexGen,PirateName_names,PirateName_appellations",
+PirateName$: function(appellation, firstName) {
+ var t1 = new A.PirateName(null, null);
+ t1.PirateName$2$appellation$firstName(appellation, firstName);
+ return t1;
+},
+
+PirateName$fromJSON: function(jsonString) {
+ var t1 = new A.PirateName(null, null);
+ t1.PirateName$fromJSON$1(jsonString);
+ return t1;
+},
+
+PirateName_readyThePirates: function() {
+ return W.HttpRequest_getString("piratenames.json", null, null).then$1(A.PirateName__parsePirateNamesFromJSON$closure);
+},
+
+PirateName__parsePirateNamesFromJSON: function(jsonString) {
+ var pirateNames, t1;
+ pirateNames = C.C_JsonCodec.decode$1(jsonString);
+ t1 = J.getInterceptor$asx(pirateNames);
+ $.PirateName_names = t1.$index(pirateNames, "names");
+ $.PirateName_appellations = t1.$index(pirateNames, "appellations");
+}}
+
}},
1],
]);
@@ -5752,16 +5872,27 @@ init.globalFunctions._defaultEquals$closure = P._defaultEquals$closure = new H.C
init.globalFunctions._defaultHashCode$closure = P._defaultHashCode$closure = new H.Closure$1(P._defaultHashCode, "_defaultHashCode$closure");
init.globalFunctions.identical$closure = P.identical$closure = new H.Closure$2(P.identical, "identical$closure");
init.globalFunctions.identityHashCode$closure = P.identityHashCode$closure = new H.Closure$1(P.identityHashCode, "identityHashCode$closure");
-init.globalFunctions.main$closure = E.main$closure = new H.Closure$0(E.main, "main$closure");
+init.globalFunctions.main$closure = A.main$closure = new H.Closure$0(A.main, "main$closure");
+init.globalFunctions.updateBadge$closure = A.updateBadge$closure = new H.Closure$1(A.updateBadge, "updateBadge$closure");
+init.globalFunctions.generateBadge$closure = A.generateBadge$closure = new H.Closure$1(A.generateBadge, "generateBadge$closure");
+init.globalFunctions.PirateName__parsePirateNamesFromJSON$closure = A.PirateName__parsePirateNamesFromJSON$closure = new H.Closure$1(A.PirateName__parsePirateNamesFromJSON, "PirateName__parsePirateNamesFromJSON$closure");
// Runtime type support
-J.JSInt.$isint = true;
-J.JSInt.$isObject = true;
J.JSString.$isString = true;
J.JSString.$isObject = true;
+J.JSInt.$isint = true;
+J.JSInt.$isObject = true;
J.JSNumber.$isObject = true;
+P.Object.$isObject = true;
P.Duration.$isObject = true;
-W.Geoposition.$isGeoposition = true;
-W.Geoposition.$isObject = true;
+W.Event.$isEvent = true;
+W.Event.$isObject = true;
+W.MouseEvent.$isEvent = true;
+W.MouseEvent.$isObject = true;
+J.JSBool.$isbool = true;
+J.JSBool.$isObject = true;
+W.HttpRequest.$isObject = true;
+W.ProgressEvent.$isEvent = true;
+W.ProgressEvent.$isObject = true;
P.ReceivePort.$isObject = true;
H._IsolateEvent.$isObject = true;
H._IsolateContext.$isObject = true;
@@ -5770,17 +5901,14 @@ P.Symbol.$isSymbol = true;
P.Symbol.$isObject = true;
P.StackTrace.$isStackTrace = true;
P.StackTrace.$isObject = true;
-P.Future.$isFuture = true;
-P.Future.$isObject = true;
-P.Object.$isObject = true;
P.Function.$isFunction = true;
P.Function.$isObject = true;
-J.JSBool.$isbool = true;
-J.JSBool.$isObject = true;
-P.StreamSubscription.$isStreamSubscription = true;
-P.StreamSubscription.$isObject = true;
P._EventSink.$is_EventSink = true;
P._EventSink.$isObject = true;
+P.Future.$isFuture = true;
+P.Future.$isObject = true;
+P.StreamSubscription.$isStreamSubscription = true;
+P.StreamSubscription.$isObject = true;
// getInterceptor methods
J.getInterceptor = function(receiver) {
if (typeof receiver == "number") {
@@ -5853,11 +5981,17 @@ J.getInterceptor$x = function(receiver) {
return receiver;
return J.getNativeInterceptor(receiver);
};
-C.C_CloseToken = new H.CloseToken();
+C.C_JsonCodec = new P.JsonCodec();
C.C_UnknownJavaScriptObject = new J.UnknownJavaScriptObject();
+C.C__DelayedDone = new P._DelayedDone();
+C.C__Random = new P._Random();
C.C__RootZone = new P._RootZone();
C.Duration_0 = new P.Duration(0);
-C.Geolocation_methods = W.Geolocation.prototype;
+C.EventStreamProvider_click = new W.EventStreamProvider("click");
+C.EventStreamProvider_error = new W.EventStreamProvider("error");
+C.EventStreamProvider_input = new W.EventStreamProvider("input");
+C.EventStreamProvider_load = new W.EventStreamProvider("load");
+C.HttpRequest_methods = W.HttpRequest.prototype;
C.JSArray_methods = J.JSArray.prototype;
C.JSInt_methods = J.JSInt.prototype;
C.JSNumber_methods = J.JSNumber.prototype;
@@ -5868,6 +6002,7 @@ C.JS_CONST_ZYJ = ((typeof version == "function" && typeof os == "object" &&
? function(x) { return x.$dartCachedLength || x.length; }
: function(x) { return x.length; };
;
+C.JsonDecoder_null = new P.JsonDecoder(null);
Isolate.makeConstantList = function(list) {
list.immutable$list = true;
list.fixed$length = true;
@@ -5878,12 +6013,15 @@ $.lazyPort = null;
$.ReceivePortImpl__nextFreeId = 1;
$.Primitives_mirrorFunctionCacheName = "$cachedFunction";
$.Primitives_mirrorInvokeCacheName = "$cachedInvocation";
+$.initNativeDispatchFlag = null;
$.printToZone = null;
$._callbacksAreEnqueued = false;
$.Zone__current = C.C__RootZone;
$.Expando__keyCount = 0;
$.Device__isOpera = null;
$.Device__isWebKit = null;
+$.genButton = null;
+$.badgeNameElement = null;
J.$eq = function(receiver, a0) {
if (receiver == null)
return a0 == null;
@@ -5907,17 +6045,14 @@ J.$indexSet$ax = function(receiver, a0, a1) {
return receiver[a0] = a1;
return J.getInterceptor$ax(receiver).$indexSet(receiver, a0, a1);
};
-J.add$1$ax = function(receiver, a0) {
- return J.getInterceptor$ax(receiver).add$1(receiver, a0);
+J.addEventListener$3$x = function(receiver, a0, a1, a2) {
+ return J.getInterceptor$x(receiver).addEventListener$3(receiver, a0, a1, a2);
};
J.forEach$1$ax = function(receiver, a0) {
return J.getInterceptor$ax(receiver).forEach$1(receiver, a0);
};
-J.get$code$x = function(receiver) {
- return J.getInterceptor$x(receiver).get$code(receiver);
-};
-J.get$coords$x = function(receiver) {
- return J.getInterceptor$x(receiver).get$coords(receiver);
+J.get$_key$x = function(receiver) {
+ return J.getInterceptor$x(receiver).get$_key(receiver);
};
J.get$error$x = function(receiver) {
return J.getInterceptor$x(receiver).get$error(receiver);
@@ -5925,29 +6060,41 @@ J.get$error$x = function(receiver) {
J.get$hashCode$ = function(receiver) {
return J.getInterceptor(receiver).get$hashCode(receiver);
};
+J.get$isEmpty$asx = function(receiver) {
+ return J.getInterceptor$asx(receiver).get$isEmpty(receiver);
+};
J.get$iterator$ax = function(receiver) {
return J.getInterceptor$ax(receiver).get$iterator(receiver);
};
-J.get$latitude$x = function(receiver) {
- return J.getInterceptor$x(receiver).get$latitude(receiver);
-};
J.get$length$asx = function(receiver) {
return J.getInterceptor$asx(receiver).get$length(receiver);
};
-J.get$longitude$x = function(receiver) {
- return J.getInterceptor$x(receiver).get$longitude(receiver);
+J.get$responseText$x = function(receiver) {
+ return J.getInterceptor$x(receiver).get$responseText(receiver);
+};
+J.get$target$x = function(receiver) {
+ return J.getInterceptor$x(receiver).get$target(receiver);
};
-J.getCurrentPosition$0$x = function(receiver) {
- return J.getInterceptor$x(receiver).getCurrentPosition$0(receiver);
+J.get$values$x = function(receiver) {
+ return J.getInterceptor$x(receiver).get$values(receiver);
};
-J.removeLast$0$ax = function(receiver) {
- return J.getInterceptor$ax(receiver).removeLast$0(receiver);
+J.removeEventListener$3$x = function(receiver, a0, a1, a2) {
+ return J.getInterceptor$x(receiver).removeEventListener$3(receiver, a0, a1, a2);
+};
+J.send$1$x = function(receiver, a0) {
+ return J.getInterceptor$x(receiver).send$1(receiver, a0);
+};
+J.set$disabled$x = function(receiver, value) {
+ return J.getInterceptor$x(receiver).set$disabled(receiver, value);
+};
+J.toList$0$ax = function(receiver) {
+ return J.getInterceptor$ax(receiver).toList$0(receiver);
};
J.toString$0 = function(receiver) {
return J.getInterceptor(receiver).toString$0(receiver);
};
-J.watchPosition$0$x = function(receiver) {
- return J.getInterceptor$x(receiver).watchPosition$0(receiver);
+J.trim$0$s = function(receiver) {
+ return J.getInterceptor$s(receiver).trim$0(receiver);
};
Isolate.$lazy($, "globalThis", "globalThis", "get$globalThis", function() {
return function() { return this; }();
@@ -6015,8 +6162,17 @@ Isolate.$lazy($, "_toStringVisiting", "_toStringVisiting", "get$_toStringVisitin
Isolate.$lazy($, "_toStringList", "Maps__toStringList", "get$Maps__toStringList", function() {
return P.List_List(null, null);
});
+Isolate.$lazy($, "indexGen", "PirateName_indexGen", "get$PirateName_indexGen", function() {
+ return C.C__Random;
+});
+Isolate.$lazy($, "names", "PirateName_names", "get$PirateName_names", function() {
+ return [];
+});
+Isolate.$lazy($, "appellations", "PirateName_appellations", "get$PirateName_appellations", function() {
+ return [];
+});
// Native classes
-J.Interceptor["%"] = "Navigator|NavigatorUserMediaError|SVGAnimatedNumberList";
+J.Interceptor["%"] = "DOMError|FileError|MediaError|MediaKeyError|Navigator|NavigatorUserMediaError|PositionError|SQLError|SVGAnimatedNumberList|SVGAnimatedString";
init.functionAliases = {};
@@ -6091,9 +6247,9 @@ Z = convertToFastObject(Z);
init.currentScript = currentScript;
if (typeof dartMainRunner === "function") {
- dartMainRunner(function() { H.startRootIsolate(E.main$closure); });
+ dartMainRunner(function() { H.startRootIsolate(A.main$closure); });
} else {
- H.startRootIsolate(E.main$closure);
+ H.startRootIsolate(A.main$closure);
}
});
// END invoke [main].
@@ -6346,5 +6502,5 @@ function init() {
}
})()
-//# sourceMappingURL=trip_meter.dart.js.map
-//@ sourceMappingURL=trip_meter.dart.js.map
+//# sourceMappingURL=piratebadge.dart.js.map
+//@ sourceMappingURL=piratebadge.dart.js.map

Powered by Google App Engine
This is Rietveld 408576698