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

Side by Side Diff: test/codegen/expect/dart/_isolate_helper.js

Issue 977613002: Make int and double nullable by default (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: actually upload changes Created 5 years, 9 months 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 unified diff | Download patch
OLDNEW
1 var _isolate_helper; 1 var _isolate_helper;
2 (function(exports) { 2 (function(exports) {
3 'use strict'; 3 'use strict';
4 // Function _callInIsolate: (_IsolateContext, Function) → dynamic 4 // Function _callInIsolate: (_IsolateContext, Function) → dynamic
5 function _callInIsolate(isolate, function) { 5 function _callInIsolate(isolate, function) {
6 let result = isolate.eval(function); 6 let result = isolate.eval(function);
7 exports._globalState.topEventLoop.run(); 7 exports._globalState.topEventLoop.run();
8 return result; 8 return result;
9 } 9 }
10 let _activeJsAsyncCount = Symbol('_activeJsAsyncCount'); 10 let _activeJsAsyncCount = Symbol('_activeJsAsyncCount');
11 // Function enterJsAsync: () → dynamic 11 // Function enterJsAsync: () → dynamic
12 function enterJsAsync() { 12 function enterJsAsync() {
13 exports._globalState.topEventLoop[_activeJsAsyncCount]++; 13 dart.notNull(exports._globalState.topEventLoop[_activeJsAsyncCount])++;
14 } 14 }
15 // Function leaveJsAsync: () → dynamic 15 // Function leaveJsAsync: () → dynamic
16 function leaveJsAsync() { 16 function leaveJsAsync() {
17 exports._globalState.topEventLoop[_activeJsAsyncCount]--; 17 dart.notNull(exports._globalState.topEventLoop[_activeJsAsyncCount])--;
18 dart.assert(exports._globalState.topEventLoop[_activeJsAsyncCount] >= 0); 18 dart.assert(dart.notNull(exports._globalState.topEventLoop[_activeJsAsyncCou nt]) >= 0);
19 } 19 }
20 // Function isWorker: () → bool 20 // Function isWorker: () → bool
21 function isWorker() { 21 function isWorker() {
22 return exports._globalState.isWorker; 22 return exports._globalState.isWorker;
23 } 23 }
24 // Function _currentIsolate: () → _IsolateContext 24 // Function _currentIsolate: () → _IsolateContext
25 function _currentIsolate() { 25 function _currentIsolate() {
26 return exports._globalState.currentContext; 26 return exports._globalState.currentContext;
27 } 27 }
28 // Function startRootIsolate: (dynamic, dynamic) → void 28 // Function startRootIsolate: (dynamic, dynamic) → void
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 this.isolates = new core.Map(); 87 this.isolates = new core.Map();
88 this.managers = new core.Map(); 88 this.managers = new core.Map();
89 if (this.isWorker) { 89 if (this.isWorker) {
90 this.mainManager = new _MainManagerStub(); 90 this.mainManager = new _MainManagerStub();
91 this[_nativeInitWorkerMessageHandler](); 91 this[_nativeInitWorkerMessageHandler]();
92 } 92 }
93 } 93 }
94 [_nativeDetectEnvironment]() { 94 [_nativeDetectEnvironment]() {
95 let isWindowDefined = exports.globalWindow !== null; 95 let isWindowDefined = exports.globalWindow !== null;
96 let isWorkerDefined = exports.globalWorker !== null; 96 let isWorkerDefined = exports.globalWorker !== null;
97 this.isWorker = dart.notNull(!dart.notNull(isWindowDefined)) && dart.notNu ll(exports.globalPostMessageDefined); 97 this.isWorker = !dart.notNull(isWindowDefined) && dart.notNull(exports.glo balPostMessageDefined);
98 this.supportsWorkers = dart.notNull(this.isWorker) || dart.notNull(dart.no tNull(isWorkerDefined) && dart.notNull(IsolateNatives.thisScript !== null)); 98 this.supportsWorkers = dart.notNull(this.isWorker) || dart.notNull(isWorke rDefined) && dart.notNull(IsolateNatives.thisScript !== null);
99 this.fromCommandLine = dart.notNull(!dart.notNull(isWindowDefined)) && dar t.notNull(!dart.notNull(this.isWorker)); 99 this.fromCommandLine = !dart.notNull(isWindowDefined) && !dart.notNull(thi s.isWorker);
100 } 100 }
101 [_nativeInitWorkerMessageHandler]() { 101 [_nativeInitWorkerMessageHandler]() {
102 let function = function(f, a) { 102 let function = function(f, a) {
103 return function(e) { 103 return function(e) {
104 f(a, e); 104 f(a, e);
105 }; 105 };
106 }(_foreign_helper.DART_CLOSURE_TO_JS(IsolateNatives[_processWorkerMessage] ), this.mainManager); 106 }(_foreign_helper.DART_CLOSURE_TO_JS(IsolateNatives[_processWorkerMessage] ), this.mainManager);
107 self.onmessage = function; 107 self.onmessage = function;
108 self.dartPrint = self.dartPrint || function(serialize) { 108 self.dartPrint = self.dartPrint || function(serialize) {
109 return function(object) { 109 return function(object) {
110 if (self.console && self.console.log) { 110 if (self.console && self.console.log) {
111 self.console.log(object); 111 self.console.log(object);
112 } else { 112 } else {
113 self.postMessage(serialize(object)); 113 self.postMessage(serialize(object));
114 } 114 }
115 }; 115 };
116 }(_foreign_helper.DART_CLOSURE_TO_JS(_serializePrintMessage)); 116 }(_foreign_helper.DART_CLOSURE_TO_JS(_serializePrintMessage));
117 } 117 }
118 static [_serializePrintMessage](object) { 118 static [_serializePrintMessage](object) {
119 return _serializeMessage(dart.map({command: "print", msg: object})); 119 return _serializeMessage(dart.map({command: "print", msg: object}));
120 } 120 }
121 maybeCloseWorker() { 121 maybeCloseWorker() {
122 if (dart.notNull(dart.notNull(this.isWorker) && dart.notNull(this.isolates .isEmpty)) && dart.notNull(this.topEventLoop[_activeJsAsyncCount] === 0)) { 122 if (dart.notNull(this.isWorker) && dart.notNull(this.isolates.isEmpty) && this.topEventLoop[_activeJsAsyncCount] === 0) {
123 this.mainManager.postMessage(_serializeMessage(dart.map({command: 'close '}))); 123 this.mainManager.postMessage(_serializeMessage(dart.map({command: 'close '})));
124 } 124 }
125 } 125 }
126 } 126 }
127 let _scheduledControlEvents = Symbol('_scheduledControlEvents'); 127 let _scheduledControlEvents = Symbol('_scheduledControlEvents');
128 let _isExecutingEvent = Symbol('_isExecutingEvent'); 128 let _isExecutingEvent = Symbol('_isExecutingEvent');
129 let _id = Symbol('_id'); 129 let _id = Symbol('_id');
130 let _updateGlobalState = Symbol('_updateGlobalState'); 130 let _updateGlobalState = Symbol('_updateGlobalState');
131 let _setGlobals = Symbol('_setGlobals'); 131 let _setGlobals = Symbol('_setGlobals');
132 let _addRegistration = Symbol('_addRegistration'); 132 let _addRegistration = Symbol('_addRegistration');
133 class _IsolateContext extends dart.Object { 133 class _IsolateContext extends dart.Object {
134 _IsolateContext() { 134 _IsolateContext() {
135 this.id = exports._globalState.nextIsolateId++; 135 this.id = dart.notNull(exports._globalState.nextIsolateId)++;
136 this.ports = new core.Map(); 136 this.ports = new core.Map();
137 this.weakPorts = new core.Set(); 137 this.weakPorts = new core.Set();
138 this.isolateStatics = _foreign_helper.JS_CREATE_ISOLATE(); 138 this.isolateStatics = _foreign_helper.JS_CREATE_ISOLATE();
139 this.controlPort = new RawReceivePortImpl._controlPort(); 139 this.controlPort = new RawReceivePortImpl._controlPort();
140 this.pauseCapability = new isolate.Capability(); 140 this.pauseCapability = new isolate.Capability();
141 this.terminateCapability = new isolate.Capability(); 141 this.terminateCapability = new isolate.Capability();
142 this.delayedEvents = dart.as(new List.from([]), core.List$(_IsolateEvent)) ; 142 this.delayedEvents = dart.as(new List.from([]), core.List$(_IsolateEvent)) ;
143 this.pauseTokens = dart.as(new core.Set(), core.Set$(isolate.Capability)); 143 this.pauseTokens = dart.as(new core.Set(), core.Set$(isolate.Capability));
144 this.errorPorts = dart.as(new core.Set(), core.Set$(isolate.SendPort)); 144 this.errorPorts = dart.as(new core.Set(), core.Set$(isolate.SendPort));
145 this.initialized = false; 145 this.initialized = false;
146 this.isPaused = false; 146 this.isPaused = false;
147 this.doneHandlers = null; 147 this.doneHandlers = null;
148 this[_scheduledControlEvents] = null; 148 this[_scheduledControlEvents] = null;
149 this[_isExecutingEvent] = false; 149 this[_isExecutingEvent] = false;
150 this.errorsAreFatal = true; 150 this.errorsAreFatal = true;
151 this.registerWeak(this.controlPort[_id], this.controlPort); 151 this.registerWeak(this.controlPort[_id], this.controlPort);
152 } 152 }
153 addPause(authentification, resume) { 153 addPause(authentification, resume) {
154 if (!dart.equals(this.pauseCapability, authentification)) 154 if (!dart.equals(this.pauseCapability, authentification))
155 return; 155 return;
156 if (dart.notNull(this.pauseTokens.add(resume)) && dart.notNull(!dart.notNu ll(this.isPaused))) { 156 if (dart.notNull(this.pauseTokens.add(resume)) && !dart.notNull(this.isPau sed)) {
157 this.isPaused = true; 157 this.isPaused = true;
158 } 158 }
159 this[_updateGlobalState](); 159 this[_updateGlobalState]();
160 } 160 }
161 removePause(resume) { 161 removePause(resume) {
162 if (!dart.notNull(this.isPaused)) 162 if (!dart.notNull(this.isPaused))
163 return; 163 return;
164 this.pauseTokens.remove(resume); 164 this.pauseTokens.remove(resume);
165 if (this.pauseTokens.isEmpty) { 165 if (this.pauseTokens.isEmpty) {
166 while (this.delayedEvents.isNotEmpty) { 166 while (this.delayedEvents.isNotEmpty) {
(...skipping 16 matching lines...) Expand all
183 if (this.doneHandlers === null) 183 if (this.doneHandlers === null)
184 return; 184 return;
185 dart.dinvoke(this.doneHandlers, 'remove', responsePort); 185 dart.dinvoke(this.doneHandlers, 'remove', responsePort);
186 } 186 }
187 setErrorsFatal(authentification, errorsAreFatal) { 187 setErrorsFatal(authentification, errorsAreFatal) {
188 if (!dart.equals(this.terminateCapability, authentification)) 188 if (!dart.equals(this.terminateCapability, authentification))
189 return; 189 return;
190 this.errorsAreFatal = errorsAreFatal; 190 this.errorsAreFatal = errorsAreFatal;
191 } 191 }
192 handlePing(responsePort, pingType) { 192 handlePing(responsePort, pingType) {
193 if (dart.notNull(pingType === isolate.Isolate.IMMEDIATE) || dart.notNull(d art.notNull(pingType === isolate.Isolate.BEFORE_NEXT_EVENT) && dart.notNull(!dar t.notNull(this[_isExecutingEvent])))) { 193 if (pingType === isolate.Isolate.IMMEDIATE || pingType === isolate.Isolate .BEFORE_NEXT_EVENT && !dart.notNull(this[_isExecutingEvent])) {
194 responsePort.send(null); 194 responsePort.send(null);
195 return; 195 return;
196 } 196 }
197 // Function respond: () → void 197 // Function respond: () → void
198 function respond() { 198 function respond() {
199 responsePort.send(null); 199 responsePort.send(null);
200 } 200 }
201 if (pingType === isolate.Isolate.AS_EVENT) { 201 if (pingType === isolate.Isolate.AS_EVENT) {
202 exports._globalState.topEventLoop.enqueue(this, respond, "ping"); 202 exports._globalState.topEventLoop.enqueue(this, respond, "ping");
203 return; 203 return;
204 } 204 }
205 dart.assert(pingType === isolate.Isolate.BEFORE_NEXT_EVENT); 205 dart.assert(pingType === isolate.Isolate.BEFORE_NEXT_EVENT);
206 if (this[_scheduledControlEvents] === null) { 206 if (this[_scheduledControlEvents] === null) {
207 this[_scheduledControlEvents] = new collection.Queue(); 207 this[_scheduledControlEvents] = new collection.Queue();
208 } 208 }
209 dart.dinvoke(this[_scheduledControlEvents], 'addLast', respond); 209 dart.dinvoke(this[_scheduledControlEvents], 'addLast', respond);
210 } 210 }
211 handleKill(authentification, priority) { 211 handleKill(authentification, priority) {
212 if (!dart.equals(this.terminateCapability, authentification)) 212 if (!dart.equals(this.terminateCapability, authentification))
213 return; 213 return;
214 if (dart.notNull(priority === isolate.Isolate.IMMEDIATE) || dart.notNull(d art.notNull(priority === isolate.Isolate.BEFORE_NEXT_EVENT) && dart.notNull(!dar t.notNull(this[_isExecutingEvent])))) { 214 if (priority === isolate.Isolate.IMMEDIATE || priority === isolate.Isolate .BEFORE_NEXT_EVENT && !dart.notNull(this[_isExecutingEvent])) {
215 this.kill(); 215 this.kill();
216 return; 216 return;
217 } 217 }
218 if (priority === isolate.Isolate.AS_EVENT) { 218 if (priority === isolate.Isolate.AS_EVENT) {
219 exports._globalState.topEventLoop.enqueue(this, this.kill, "kill"); 219 exports._globalState.topEventLoop.enqueue(this, this.kill, "kill");
220 return; 220 return;
221 } 221 }
222 dart.assert(priority === isolate.Isolate.BEFORE_NEXT_EVENT); 222 dart.assert(priority === isolate.Isolate.BEFORE_NEXT_EVENT);
223 if (this[_scheduledControlEvents] === null) { 223 if (this[_scheduledControlEvents] === null) {
224 this[_scheduledControlEvents] = new collection.Queue(); 224 this[_scheduledControlEvents] = new collection.Queue();
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 } 328 }
329 register(portId, port) { 329 register(portId, port) {
330 this[_addRegistration](portId, port); 330 this[_addRegistration](portId, port);
331 this[_updateGlobalState](); 331 this[_updateGlobalState]();
332 } 332 }
333 registerWeak(portId, port) { 333 registerWeak(portId, port) {
334 this.weakPorts.add(portId); 334 this.weakPorts.add(portId);
335 this[_addRegistration](portId, port); 335 this[_addRegistration](portId, port);
336 } 336 }
337 [_updateGlobalState]() { 337 [_updateGlobalState]() {
338 if (dart.notNull(dart.notNull(this.ports.length - this.weakPorts.length > 0) || dart.notNull(this.isPaused)) || dart.notNull(!dart.notNull(this.initialize d))) { 338 if (dart.notNull(this.ports.length) - dart.notNull(this.weakPorts.length) > 0 || dart.notNull(this.isPaused) || !dart.notNull(this.initialized)) {
339 exports._globalState.isolates.set(this.id, this); 339 exports._globalState.isolates.set(this.id, this);
340 } else { 340 } else {
341 this.kill(); 341 this.kill();
342 } 342 }
343 } 343 }
344 kill() { 344 kill() {
345 if (this[_scheduledControlEvents] !== null) { 345 if (this[_scheduledControlEvents] !== null) {
346 dart.dinvoke(this[_scheduledControlEvents], 'clear'); 346 dart.dinvoke(this[_scheduledControlEvents], 'clear');
347 } 347 }
348 for (let port of this.ports.values) { 348 for (let port of this.ports.values) {
(...skipping 27 matching lines...) Expand all
376 } 376 }
377 prequeue(event) { 377 prequeue(event) {
378 this.events.addFirst(event); 378 this.events.addFirst(event);
379 } 379 }
380 dequeue() { 380 dequeue() {
381 if (this.events.isEmpty) 381 if (this.events.isEmpty)
382 return null; 382 return null;
383 return this.events.removeFirst(); 383 return this.events.removeFirst();
384 } 384 }
385 checkOpenReceivePortsFromCommandLine() { 385 checkOpenReceivePortsFromCommandLine() {
386 if (dart.notNull(dart.notNull(dart.notNull(exports._globalState.rootContex t !== null) && dart.notNull(exports._globalState.isolates.containsKey(exports._g lobalState.rootContext.id))) && dart.notNull(exports._globalState.fromCommandLin e)) && dart.notNull(exports._globalState.rootContext.ports.isEmpty)) { 386 if (dart.notNull(exports._globalState.rootContext !== null) && dart.notNul l(exports._globalState.isolates.containsKey(exports._globalState.rootContext.id) ) && dart.notNull(exports._globalState.fromCommandLine) && dart.notNull(exports. _globalState.rootContext.ports.isEmpty)) {
387 throw new core.Exception("Program exited with open ReceivePorts."); 387 throw new core.Exception("Program exited with open ReceivePorts.");
388 } 388 }
389 } 389 }
390 runIteration() { 390 runIteration() {
391 let event = this.dequeue(); 391 let event = this.dequeue();
392 if (event === null) { 392 if (event === null) {
393 this.checkOpenReceivePortsFromCommandLine(); 393 this.checkOpenReceivePortsFromCommandLine();
394 exports._globalState.maybeCloseWorker(); 394 exports._globalState.maybeCloseWorker();
395 return false; 395 return false;
396 } 396 }
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 let completer = dart.as(new async.Completer(), async.Completer$(core.List) ); 628 let completer = dart.as(new async.Completer(), async.Completer$(core.List) );
629 port.first.then(((msg) => { 629 port.first.then(((msg) => {
630 if (dart.equals(dart.dindex(msg, 0), _SPAWNED_SIGNAL)) { 630 if (dart.equals(dart.dindex(msg, 0), _SPAWNED_SIGNAL)) {
631 completer.complete(msg); 631 completer.complete(msg);
632 } else { 632 } else {
633 dart.assert(dart.equals(dart.dindex(msg, 0), _SPAWN_FAILED_SIGNAL)); 633 dart.assert(dart.equals(dart.dindex(msg, 0), _SPAWN_FAILED_SIGNAL));
634 completer.completeError(dart.dindex(msg, 1)); 634 completer.completeError(dart.dindex(msg, 1));
635 } 635 }
636 }).bind(this)); 636 }).bind(this));
637 let signalReply = port.sendPort; 637 let signalReply = port.sendPort;
638 if (dart.notNull(exports._globalState.useWorkers) && dart.notNull(!dart.no tNull(isLight))) { 638 if (dart.notNull(exports._globalState.useWorkers) && !dart.notNull(isLight )) {
639 _startWorker(functionName, uri, args, message, isSpawnUri, startPaused, signalReply, ((message) => completer.completeError(message)).bind(this)); 639 _startWorker(functionName, uri, args, message, isSpawnUri, startPaused, signalReply, ((message) => completer.completeError(message)).bind(this));
640 } else { 640 } else {
641 _startNonWorker(functionName, uri, args, message, isSpawnUri, startPause d, signalReply); 641 _startNonWorker(functionName, uri, args, message, isSpawnUri, startPause d, signalReply);
642 } 642 }
643 return completer.future; 643 return completer.future;
644 } 644 }
645 static [_startWorker](functionName, uri, args, message, isSpawnUri, startPau sed, replyPort, onError) { 645 static [_startWorker](functionName, uri, args, message, isSpawnUri, startPau sed, replyPort, onError) {
646 if (args !== null) 646 if (args !== null)
647 args = new core.List.from(args); 647 args = new core.List.from(args);
648 if (exports._globalState.isWorker) { 648 if (exports._globalState.isWorker) {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 }; 701 };
702 }(_foreign_helper.DART_CLOSURE_TO_JS(workerOnError), uri, onError); 702 }(_foreign_helper.DART_CLOSURE_TO_JS(workerOnError), uri, onError);
703 worker.onerror = onerrorTrampoline; 703 worker.onerror = onerrorTrampoline;
704 let processWorkerMessageTrampoline = function(f, a) { 704 let processWorkerMessageTrampoline = function(f, a) {
705 return function(e) { 705 return function(e) {
706 e.onerror = null; 706 e.onerror = null;
707 return f(a, e); 707 return f(a, e);
708 }; 708 };
709 }(_foreign_helper.DART_CLOSURE_TO_JS(_processWorkerMessage), worker); 709 }(_foreign_helper.DART_CLOSURE_TO_JS(_processWorkerMessage), worker);
710 worker.onmessage = processWorkerMessageTrampoline; 710 worker.onmessage = processWorkerMessageTrampoline;
711 let workerId = exports._globalState.nextManagerId++; 711 let workerId = dart.notNull(exports._globalState.nextManagerId)++;
712 workerIds.set(worker, workerId); 712 workerIds.set(worker, workerId);
713 exports._globalState.managers.set(workerId, worker); 713 exports._globalState.managers.set(workerId, worker);
714 worker.postMessage(_serializeMessage(dart.map({command: 'start', id: worke rId, replyTo: _serializeMessage(replyPort), args: args, msg: _serializeMessage(m essage), isSpawnUri: isSpawnUri, startPaused: startPaused, functionName: functio nName}))); 714 worker.postMessage(_serializeMessage(dart.map({command: 'start', id: worke rId, replyTo: _serializeMessage(replyPort), args: args, msg: _serializeMessage(m essage), isSpawnUri: isSpawnUri, startPaused: startPaused, functionName: functio nName})));
715 } 715 }
716 static workerOnError(event, uri, onError) { 716 static workerOnError(event, uri, onError) {
717 event.preventDefault(); 717 event.preventDefault();
718 let message = dart.as(event.message, core.String); 718 let message = dart.as(event.message, core.String);
719 if (message === null) { 719 if (message === null) {
720 message = `Error spawning worker for ${uri}`; 720 message = `Error spawning worker for ${uri}`;
721 } else { 721 } else {
(...skipping 13 matching lines...) Expand all
735 return new core.Expando(); 735 return new core.Expando();
736 } 736 }
737 }); 737 });
738 let _isolateId = Symbol('_isolateId'); 738 let _isolateId = Symbol('_isolateId');
739 let _checkReplyTo = Symbol('_checkReplyTo'); 739 let _checkReplyTo = Symbol('_checkReplyTo');
740 class _BaseSendPort extends dart.Object { 740 class _BaseSendPort extends dart.Object {
741 _BaseSendPort($_isolateId) { 741 _BaseSendPort($_isolateId) {
742 this[_isolateId] = $_isolateId; 742 this[_isolateId] = $_isolateId;
743 } 743 }
744 [_checkReplyTo](replyTo) { 744 [_checkReplyTo](replyTo) {
745 if (dart.notNull(dart.notNull(replyTo !== null) && dart.notNull(!dart.is(r eplyTo, _NativeJsSendPort))) && dart.notNull(!dart.is(replyTo, _WorkerSendPort)) ) { 745 if (dart.notNull(replyTo !== null) && dart.notNull(!dart.is(replyTo, _Nati veJsSendPort)) && dart.notNull(!dart.is(replyTo, _WorkerSendPort))) {
746 throw new core.Exception("SendPort.send: Illegal replyTo port type"); 746 throw new core.Exception("SendPort.send: Illegal replyTo port type");
747 } 747 }
748 } 748 }
749 } 749 }
750 let _receivePort = Symbol('_receivePort'); 750 let _receivePort = Symbol('_receivePort');
751 let _isClosed = Symbol('_isClosed'); 751 let _isClosed = Symbol('_isClosed');
752 class _NativeJsSendPort extends _BaseSendPort { 752 class _NativeJsSendPort extends _BaseSendPort {
753 _NativeJsSendPort($_receivePort, isolateId) { 753 _NativeJsSendPort($_receivePort, isolateId) {
754 this[_receivePort] = $_receivePort; 754 this[_receivePort] = $_receivePort;
755 super._BaseSendPort(isolateId); 755 super._BaseSendPort(isolateId);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 if (exports._globalState.isWorker) { 791 if (exports._globalState.isWorker) {
792 exports._globalState.mainManager.postMessage(workerMessage); 792 exports._globalState.mainManager.postMessage(workerMessage);
793 } else { 793 } else {
794 let manager = exports._globalState.managers.get(this[_workerId]); 794 let manager = exports._globalState.managers.get(this[_workerId]);
795 if (manager !== null) { 795 if (manager !== null) {
796 manager.postMessage(workerMessage); 796 manager.postMessage(workerMessage);
797 } 797 }
798 } 798 }
799 } 799 }
800 ['=='](other) { 800 ['=='](other) {
801 return dart.notNull(dart.notNull(dart.notNull(dart.is(other, _WorkerSendPo rt)) && dart.notNull(this[_workerId] === dart.dload(other, '_workerId'))) && dar t.notNull(this[_isolateId] === dart.dload(other, '_isolateId'))) && dart.notNull (this[_receivePortId] === dart.dload(other, '_receivePortId')); 801 return dart.notNull(dart.is(other, _WorkerSendPort)) && this[_workerId] == = dart.dload(other, '_workerId') && this[_isolateId] === dart.dload(other, '_iso lateId') && this[_receivePortId] === dart.dload(other, '_receivePortId');
802 } 802 }
803 get hashCode() { 803 get hashCode() {
804 return this[_workerId] << 16 ^ this[_isolateId] << 8 ^ this[_receivePortId ]; 804 return dart.notNull(this[_workerId]) << 16 ^ dart.notNull(this[_isolateId] ) << 8 ^ dart.notNull(this[_receivePortId]);
805 } 805 }
806 } 806 }
807 let _handler = Symbol('_handler'); 807 let _handler = Symbol('_handler');
808 let _close = Symbol('_close'); 808 let _close = Symbol('_close');
809 let _add = Symbol('_add'); 809 let _add = Symbol('_add');
810 class RawReceivePortImpl extends dart.Object { 810 class RawReceivePortImpl extends dart.Object {
811 RawReceivePortImpl($_handler) { 811 RawReceivePortImpl($_handler) {
812 this[_handler] = $_handler; 812 this[_handler] = $_handler;
813 this[_id] = _nextFreeId++; 813 this[_id] = dart.notNull(_nextFreeId)++;
814 this[_isClosed] = false; 814 this[_isClosed] = false;
815 exports._globalState.currentContext.register(this[_id], this); 815 exports._globalState.currentContext.register(this[_id], this);
816 } 816 }
817 RawReceivePortImpl$weak($_handler) { 817 RawReceivePortImpl$weak($_handler) {
818 this[_handler] = $_handler; 818 this[_handler] = $_handler;
819 this[_id] = _nextFreeId++; 819 this[_id] = dart.notNull(_nextFreeId)++;
820 this[_isClosed] = false; 820 this[_isClosed] = false;
821 exports._globalState.currentContext.registerWeak(this[_id], this); 821 exports._globalState.currentContext.registerWeak(this[_id], this);
822 } 822 }
823 RawReceivePortImpl$_controlPort() { 823 RawReceivePortImpl$_controlPort() {
824 this[_handler] = null; 824 this[_handler] = null;
825 this[_id] = 0; 825 this[_id] = 0;
826 this[_isClosed] = false; 826 this[_isClosed] = false;
827 } 827 }
828 set handler(newHandler) { 828 set handler(newHandler) {
829 this[_handler] = newHandler; 829 this[_handler] = newHandler;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
883 } 883 }
884 dart.defineNamedConstructor(ReceivePortImpl, 'weak'); 884 dart.defineNamedConstructor(ReceivePortImpl, 'weak');
885 dart.defineNamedConstructor(ReceivePortImpl, 'fromRawReceivePort'); 885 dart.defineNamedConstructor(ReceivePortImpl, 'fromRawReceivePort');
886 let _once = Symbol('_once'); 886 let _once = Symbol('_once');
887 let _inEventLoop = Symbol('_inEventLoop'); 887 let _inEventLoop = Symbol('_inEventLoop');
888 let _handle = Symbol('_handle'); 888 let _handle = Symbol('_handle');
889 class TimerImpl extends dart.Object { 889 class TimerImpl extends dart.Object {
890 TimerImpl(milliseconds, callback) { 890 TimerImpl(milliseconds, callback) {
891 this[_once] = true; 891 this[_once] = true;
892 this[_inEventLoop] = false; 892 this[_inEventLoop] = false;
893 this[_handle] = dart.as(null, core.int); 893 this[_handle] = null;
894 if (dart.notNull(milliseconds === 0) && dart.notNull(dart.notNull(!dart.no tNull(hasTimer())) || dart.notNull(exports._globalState.isWorker))) { 894 if (milliseconds === 0 && (!dart.notNull(hasTimer()) || dart.notNull(expor ts._globalState.isWorker))) {
895 // Function internalCallback: () → void 895 // Function internalCallback: () → void
896 function internalCallback() { 896 function internalCallback() {
897 this[_handle] = dart.as(null, core.int); 897 this[_handle] = null;
898 callback(); 898 callback();
899 } 899 }
900 this[_handle] = 1; 900 this[_handle] = 1;
901 exports._globalState.topEventLoop.enqueue(exports._globalState.currentCo ntext, internalCallback, 'timer'); 901 exports._globalState.topEventLoop.enqueue(exports._globalState.currentCo ntext, internalCallback, 'timer');
902 this[_inEventLoop] = true; 902 this[_inEventLoop] = true;
903 } else if (hasTimer()) { 903 } else if (hasTimer()) {
904 // Function internalCallback: () → void 904 // Function internalCallback: () → void
905 function internalCallback() { 905 function internalCallback() {
906 this[_handle] = dart.as(null, core.int); 906 this[_handle] = null;
907 leaveJsAsync(); 907 leaveJsAsync();
908 callback(); 908 callback();
909 } 909 }
910 enterJsAsync(); 910 enterJsAsync();
911 this[_handle] = self.setTimeout(_js_helper.convertDartClosureToJS(intern alCallback, 0), milliseconds); 911 this[_handle] = self.setTimeout(_js_helper.convertDartClosureToJS(intern alCallback, 0), milliseconds);
912 } else { 912 } else {
913 dart.assert(milliseconds > 0); 913 dart.assert(dart.notNull(milliseconds) > 0);
914 throw new core.UnsupportedError("Timer greater than 0."); 914 throw new core.UnsupportedError("Timer greater than 0.");
915 } 915 }
916 } 916 }
917 TimerImpl$periodic(milliseconds, callback) { 917 TimerImpl$periodic(milliseconds, callback) {
918 this[_once] = false; 918 this[_once] = false;
919 this[_inEventLoop] = false; 919 this[_inEventLoop] = false;
920 this[_handle] = dart.as(null, core.int); 920 this[_handle] = null;
921 if (hasTimer()) { 921 if (hasTimer()) {
922 enterJsAsync(); 922 enterJsAsync();
923 this[_handle] = self.setInterval(_js_helper.convertDartClosureToJS((() = > { 923 this[_handle] = self.setInterval(_js_helper.convertDartClosureToJS((() = > {
924 callback(this); 924 callback(this);
925 }).bind(this), 0), milliseconds); 925 }).bind(this), 0), milliseconds);
926 } else { 926 } else {
927 throw new core.UnsupportedError("Periodic timer."); 927 throw new core.UnsupportedError("Periodic timer.");
928 } 928 }
929 } 929 }
930 cancel() { 930 cancel() {
931 if (hasTimer()) { 931 if (hasTimer()) {
932 if (this[_inEventLoop]) { 932 if (this[_inEventLoop]) {
933 throw new core.UnsupportedError("Timer in event loop cannot be cancele d."); 933 throw new core.UnsupportedError("Timer in event loop cannot be cancele d.");
934 } 934 }
935 if (this[_handle] === null) 935 if (this[_handle] === null)
936 return; 936 return;
937 leaveJsAsync(); 937 leaveJsAsync();
938 if (this[_once]) { 938 if (this[_once]) {
939 self.clearTimeout(this[_handle]); 939 self.clearTimeout(this[_handle]);
940 } else { 940 } else {
941 self.clearInterval(this[_handle]); 941 self.clearInterval(this[_handle]);
942 } 942 }
943 this[_handle] = dart.as(null, core.int); 943 this[_handle] = null;
944 } else { 944 } else {
945 throw new core.UnsupportedError("Canceling a timer."); 945 throw new core.UnsupportedError("Canceling a timer.");
946 } 946 }
947 } 947 }
948 get isActive() { 948 get isActive() {
949 return this[_handle] !== null; 949 return this[_handle] !== null;
950 } 950 }
951 } 951 }
952 dart.defineNamedConstructor(TimerImpl, 'periodic'); 952 dart.defineNamedConstructor(TimerImpl, 'periodic');
953 // Function hasTimer: () → bool 953 // Function hasTimer: () → bool
954 function hasTimer() { 954 function hasTimer() {
955 _js_helper.requiresPreamble(); 955 _js_helper.requiresPreamble();
956 return self.setTimeout !== null; 956 return self.setTimeout !== null;
957 } 957 }
958 class CapabilityImpl extends dart.Object { 958 class CapabilityImpl extends dart.Object {
959 CapabilityImpl() { 959 CapabilityImpl() {
960 this.CapabilityImpl$_internal(_js_helper.random64()); 960 this.CapabilityImpl$_internal(_js_helper.random64());
961 } 961 }
962 CapabilityImpl$_internal($_id) { 962 CapabilityImpl$_internal($_id) {
963 this[_id] = $_id; 963 this[_id] = $_id;
964 } 964 }
965 get hashCode() { 965 get hashCode() {
966 let hash = this[_id]; 966 let hash = this[_id];
967 hash = hash >> 0 ^ (hash / 4294967296).truncate(); 967 hash = dart.notNull(hash) >> 0 ^ (dart.notNull(hash) / 4294967296).truncat e();
968 hash = ~hash + (hash << 15) & 4294967295; 968 hash = ~dart.notNull(hash) + (dart.notNull(hash) << 15) & 4294967295;
969 hash = hash >> 12; 969 hash = dart.notNull(hash) >> 12;
970 hash = hash * 5 & 4294967295; 970 hash = dart.notNull(hash) * 5 & 4294967295;
971 hash = hash >> 4; 971 hash = dart.notNull(hash) >> 4;
972 hash = hash * 2057 & 4294967295; 972 hash = dart.notNull(hash) * 2057 & 4294967295;
973 hash = hash >> 16; 973 hash = dart.notNull(hash) >> 16;
974 return hash; 974 return hash;
975 } 975 }
976 ['=='](other) { 976 ['=='](other) {
977 if (core.identical(other, this)) 977 if (core.identical(other, this))
978 return true; 978 return true;
979 if (dart.is(other, CapabilityImpl)) { 979 if (dart.is(other, CapabilityImpl)) {
980 return core.identical(this[_id], other[_id]); 980 return core.identical(this[_id], other[_id]);
981 } 981 }
982 return false; 982 return false;
983 } 983 }
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
1039 if (message === void 0) 1039 if (message === void 0)
1040 message = null; 1040 message = null;
1041 if (message === null) 1041 if (message === null)
1042 message = "Can't transmit:"; 1042 message = "Can't transmit:";
1043 throw new core.UnsupportedError(`${message} ${x}`); 1043 throw new core.UnsupportedError(`${message} ${x}`);
1044 } 1044 }
1045 makeRef(serializationId) { 1045 makeRef(serializationId) {
1046 return new List.from(["ref", serializationId]); 1046 return new List.from(["ref", serializationId]);
1047 } 1047 }
1048 isPrimitive(x) { 1048 isPrimitive(x) {
1049 return dart.notNull(dart.notNull(dart.notNull(x === null) || dart.notNull( typeof x == string)) || dart.notNull(dart.is(x, core.num))) || dart.notNull(type of x == boolean); 1049 return dart.notNull(x === null) || dart.notNull(typeof x == string) || dar t.notNull(dart.is(x, core.num)) || dart.notNull(typeof x == boolean);
1050 } 1050 }
1051 serializePrimitive(primitive) { 1051 serializePrimitive(primitive) {
1052 return primitive; 1052 return primitive;
1053 } 1053 }
1054 serializeByteBuffer(buffer) { 1054 serializeByteBuffer(buffer) {
1055 return new List.from(["buffer", buffer]); 1055 return new List.from(["buffer", buffer]);
1056 } 1056 }
1057 serializeTypedData(data) { 1057 serializeTypedData(data) {
1058 return new List.from(["typed", data]); 1058 return new List.from(["typed", data]);
1059 } 1059 }
1060 serializeJSIndexable(indexable) { 1060 serializeJSIndexable(indexable) {
1061 dart.assert(!(typeof indexable == string)); 1061 dart.assert(!(typeof indexable == string));
1062 let serialized = dart.as(this.serializeArray(dart.as(indexable, _intercept ors.JSArray)), core.List); 1062 let serialized = dart.as(this.serializeArray(dart.as(indexable, _intercept ors.JSArray)), core.List);
1063 if (dart.is(indexable, _interceptors.JSFixedArray)) 1063 if (dart.is(indexable, _interceptors.JSFixedArray))
1064 return new List.from(["fixed", serialized]); 1064 return new List.from(["fixed", serialized]);
1065 if (dart.is(indexable, _interceptors.JSExtendableArray)) 1065 if (dart.is(indexable, _interceptors.JSExtendableArray))
1066 return new List.from(["extendable", serialized]); 1066 return new List.from(["extendable", serialized]);
1067 if (dart.is(indexable, _interceptors.JSMutableArray)) 1067 if (dart.is(indexable, _interceptors.JSMutableArray))
1068 return new List.from(["mutable", serialized]); 1068 return new List.from(["mutable", serialized]);
1069 if (dart.is(indexable, _interceptors.JSArray)) 1069 if (dart.is(indexable, _interceptors.JSArray))
1070 return new List.from(["const", serialized]); 1070 return new List.from(["const", serialized]);
1071 this.unsupported(indexable, "Can't serialize indexable: "); 1071 this.unsupported(indexable, "Can't serialize indexable: ");
1072 return null; 1072 return null;
1073 } 1073 }
1074 serializeArray(x) { 1074 serializeArray(x) {
1075 let serialized = new List.from([]); 1075 let serialized = new List.from([]);
1076 serialized.length = x.length; 1076 serialized.length = x.length;
1077 for (let i = 0; i < x.length; i++) { 1077 for (let i = 0; dart.notNull(i) < dart.notNull(x.length); dart.notNull(i)+ +) {
1078 serialized.set(i, this.serialize(x.get(i))); 1078 serialized.set(i, this.serialize(x.get(i)));
1079 } 1079 }
1080 return serialized; 1080 return serialized;
1081 } 1081 }
1082 serializeArrayInPlace(x) { 1082 serializeArrayInPlace(x) {
1083 for (let i = 0; i < x.length; i++) { 1083 for (let i = 0; dart.notNull(i) < dart.notNull(x.length); dart.notNull(i)+ +) {
1084 x.set(i, this.serialize(x.get(i))); 1084 x.set(i, this.serialize(x.get(i)));
1085 } 1085 }
1086 return x; 1086 return x;
1087 } 1087 }
1088 serializeMap(x) { 1088 serializeMap(x) {
1089 let serializeTearOff = this.serialize; 1089 let serializeTearOff = this.serialize;
1090 return new List.from(['map', x.keys.map(dart.as(serializeTearOff, dart.thr ow_("Unimplemented type (dynamic) → dynamic"))).toList(), x.values.map(dart.as(s erializeTearOff, dart.throw_("Unimplemented type (dynamic) → dynamic"))).toList( )]); 1090 return new List.from(['map', x.keys.map(dart.as(serializeTearOff, dart.thr ow_("Unimplemented type (dynamic) → dynamic"))).toList(), x.values.map(dart.as(s erializeTearOff, dart.throw_("Unimplemented type (dynamic) → dynamic"))).toList( )]);
1091 } 1091 }
1092 serializeJSObject(x) { 1092 serializeJSObject(x) {
1093 if (dart.notNull(!!x.constructor) && dart.notNull(x.constructor !== Object )) { 1093 if (!!x.constructor && x.constructor !== Object) {
1094 this.unsupported(x, "Only plain JS Objects are supported:"); 1094 this.unsupported(x, "Only plain JS Objects are supported:");
1095 } 1095 }
1096 let keys = dart.as(Object.keys(x), core.List); 1096 let keys = dart.as(Object.keys(x), core.List);
1097 let values = new List.from([]); 1097 let values = new List.from([]);
1098 values.length = keys.length; 1098 values.length = keys.length;
1099 for (let i = 0; i < keys.length; i++) { 1099 for (let i = 0; dart.notNull(i) < dart.notNull(keys.length); dart.notNull( i)++) {
1100 values.set(i, this.serialize(x[keys.get(i)])); 1100 values.set(i, this.serialize(x[keys.get(i)]));
1101 } 1101 }
1102 return new List.from(['js-object', keys, values]); 1102 return new List.from(['js-object', keys, values]);
1103 } 1103 }
1104 serializeWorkerSendPort(x) { 1104 serializeWorkerSendPort(x) {
1105 if (this[_serializeSendPorts]) { 1105 if (this[_serializeSendPorts]) {
1106 return new List.from(['sendport', x[_workerId], x[_isolateId], x[_receiv ePortId]]); 1106 return new List.from(['sendport', x[_workerId], x[_isolateId], x[_receiv ePortId]]);
1107 } 1107 }
1108 return new List.from(['raw sendport', x]); 1108 return new List.from(['raw sendport', x]);
1109 } 1109 }
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
1169 return this.deserializeJSObject(x); 1169 return this.deserializeJSObject(x);
1170 case "function": 1170 case "function":
1171 return this.deserializeClosure(x); 1171 return this.deserializeClosure(x);
1172 case "dart": 1172 case "dart":
1173 return this.deserializeDartObject(x); 1173 return this.deserializeDartObject(x);
1174 default: 1174 default:
1175 throw `couldn't deserialize: ${x}`; 1175 throw `couldn't deserialize: ${x}`;
1176 } 1176 }
1177 } 1177 }
1178 isPrimitive(x) { 1178 isPrimitive(x) {
1179 return dart.notNull(dart.notNull(dart.notNull(x === null) || dart.notNull( typeof x == string)) || dart.notNull(dart.is(x, core.num))) || dart.notNull(type of x == boolean); 1179 return dart.notNull(x === null) || dart.notNull(typeof x == string) || dar t.notNull(dart.is(x, core.num)) || dart.notNull(typeof x == boolean);
1180 } 1180 }
1181 deserializePrimitive(x) { 1181 deserializePrimitive(x) {
1182 return x; 1182 return x;
1183 } 1183 }
1184 deserializeRef(x) { 1184 deserializeRef(x) {
1185 dart.assert(dart.equals(dart.dindex(x, 0), 'ref')); 1185 dart.assert(dart.equals(dart.dindex(x, 0), 'ref'));
1186 let serializationId = dart.as(dart.dindex(x, 1), core.int); 1186 let serializationId = dart.as(dart.dindex(x, 1), core.int);
1187 return this.deserializedObjects.get(serializationId); 1187 return this.deserializedObjects.get(serializationId);
1188 } 1188 }
1189 deserializeByteBuffer(x) { 1189 deserializeByteBuffer(x) {
1190 dart.assert(dart.equals(dart.dindex(x, 0), 'buffer')); 1190 dart.assert(dart.equals(dart.dindex(x, 0), 'buffer'));
1191 let result = dart.as(dart.dindex(x, 1), _native_typed_data.NativeByteBuffe r); 1191 let result = dart.as(dart.dindex(x, 1), _native_typed_data.NativeByteBuffe r);
1192 this.deserializedObjects.add(result); 1192 this.deserializedObjects.add(result);
1193 return result; 1193 return result;
1194 } 1194 }
1195 deserializeTypedData(x) { 1195 deserializeTypedData(x) {
1196 dart.assert(dart.equals(dart.dindex(x, 0), 'typed')); 1196 dart.assert(dart.equals(dart.dindex(x, 0), 'typed'));
1197 let result = dart.as(dart.dindex(x, 1), _native_typed_data.NativeTypedData ); 1197 let result = dart.as(dart.dindex(x, 1), _native_typed_data.NativeTypedData );
1198 this.deserializedObjects.add(result); 1198 this.deserializedObjects.add(result);
1199 return result; 1199 return result;
1200 } 1200 }
1201 deserializeArrayInPlace(x) { 1201 deserializeArrayInPlace(x) {
1202 for (let i = 0; i < x.length; i++) { 1202 for (let i = 0; dart.notNull(i) < dart.notNull(x.length); dart.notNull(i)+ +) {
1203 x.set(i, this.deserialize(x.get(i))); 1203 x.set(i, this.deserialize(x.get(i)));
1204 } 1204 }
1205 return x; 1205 return x;
1206 } 1206 }
1207 deserializeFixed(x) { 1207 deserializeFixed(x) {
1208 dart.assert(dart.equals(dart.dindex(x, 0), 'fixed')); 1208 dart.assert(dart.equals(dart.dindex(x, 0), 'fixed'));
1209 let result = dart.as(dart.dindex(x, 1), core.List); 1209 let result = dart.as(dart.dindex(x, 1), core.List);
1210 this.deserializedObjects.add(result); 1210 this.deserializedObjects.add(result);
1211 return new _interceptors.JSArray.markFixed(this.deserializeArrayInPlace(da rt.as(result, _interceptors.JSArray))); 1211 return new _interceptors.JSArray.markFixed(this.deserializeArrayInPlace(da rt.as(result, _interceptors.JSArray)));
1212 } 1212 }
(...skipping 15 matching lines...) Expand all
1228 this.deserializedObjects.add(result); 1228 this.deserializedObjects.add(result);
1229 return new _interceptors.JSArray.markFixed(this.deserializeArrayInPlace(da rt.as(result, _interceptors.JSArray))); 1229 return new _interceptors.JSArray.markFixed(this.deserializeArrayInPlace(da rt.as(result, _interceptors.JSArray)));
1230 } 1230 }
1231 deserializeMap(x) { 1231 deserializeMap(x) {
1232 dart.assert(dart.equals(dart.dindex(x, 0), 'map')); 1232 dart.assert(dart.equals(dart.dindex(x, 0), 'map'));
1233 let keys = dart.as(dart.dindex(x, 1), core.List); 1233 let keys = dart.as(dart.dindex(x, 1), core.List);
1234 let values = dart.as(dart.dindex(x, 2), core.List); 1234 let values = dart.as(dart.dindex(x, 2), core.List);
1235 let result = dart.map(); 1235 let result = dart.map();
1236 this.deserializedObjects.add(result); 1236 this.deserializedObjects.add(result);
1237 keys = keys.map(this.deserialize).toList(); 1237 keys = keys.map(this.deserialize).toList();
1238 for (let i = 0; i < keys.length; i++) { 1238 for (let i = 0; dart.notNull(i) < dart.notNull(keys.length); dart.notNull( i)++) {
1239 result.set(keys.get(i), this.deserialize(values.get(i))); 1239 result.set(keys.get(i), this.deserialize(values.get(i)));
1240 } 1240 }
1241 return result; 1241 return result;
1242 } 1242 }
1243 deserializeSendPort(x) { 1243 deserializeSendPort(x) {
1244 dart.assert(dart.equals(dart.dindex(x, 0), 'sendport')); 1244 dart.assert(dart.equals(dart.dindex(x, 0), 'sendport'));
1245 let managerId = dart.as(dart.dindex(x, 1), core.int); 1245 let managerId = dart.as(dart.dindex(x, 1), core.int);
1246 let isolateId = dart.as(dart.dindex(x, 2), core.int); 1246 let isolateId = dart.as(dart.dindex(x, 2), core.int);
1247 let receivePortId = dart.as(dart.dindex(x, 3), core.int); 1247 let receivePortId = dart.as(dart.dindex(x, 3), core.int);
1248 let result = null; 1248 let result = null;
(...skipping 16 matching lines...) Expand all
1265 let result = dart.as(dart.dindex(x, 1), isolate.SendPort); 1265 let result = dart.as(dart.dindex(x, 1), isolate.SendPort);
1266 this.deserializedObjects.add(result); 1266 this.deserializedObjects.add(result);
1267 return result; 1267 return result;
1268 } 1268 }
1269 deserializeJSObject(x) { 1269 deserializeJSObject(x) {
1270 dart.assert(dart.equals(dart.dindex(x, 0), 'js-object')); 1270 dart.assert(dart.equals(dart.dindex(x, 0), 'js-object'));
1271 let keys = dart.as(dart.dindex(x, 1), core.List); 1271 let keys = dart.as(dart.dindex(x, 1), core.List);
1272 let values = dart.as(dart.dindex(x, 2), core.List); 1272 let values = dart.as(dart.dindex(x, 2), core.List);
1273 let o = {}; 1273 let o = {};
1274 this.deserializedObjects.add(o); 1274 this.deserializedObjects.add(o);
1275 for (let i = 0; i < keys.length; i++) { 1275 for (let i = 0; dart.notNull(i) < dart.notNull(keys.length); dart.notNull( i)++) {
1276 o[keys.get(i)] = this.deserialize(values.get(i)); 1276 o[keys.get(i)] = this.deserialize(values.get(i));
1277 } 1277 }
1278 return o; 1278 return o;
1279 } 1279 }
1280 deserializeClosure(x) { 1280 deserializeClosure(x) {
1281 dart.assert(dart.equals(dart.dindex(x, 0), 'function')); 1281 dart.assert(dart.equals(dart.dindex(x, 0), 'function'));
1282 let name = dart.as(dart.dindex(x, 1), core.String); 1282 let name = dart.as(dart.dindex(x, 1), core.String);
1283 let result = dart.as(IsolateNatives._getJSFunctionFromName(name), core.Fun ction); 1283 let result = dart.as(IsolateNatives._getJSFunctionFromName(name), core.Fun ction);
1284 this.deserializedObjects.add(result); 1284 this.deserializedObjects.add(result);
1285 return result; 1285 return result;
(...skipping 18 matching lines...) Expand all
1304 exports.globalWindow = globalWindow; 1304 exports.globalWindow = globalWindow;
1305 exports.globalWorker = globalWorker; 1305 exports.globalWorker = globalWorker;
1306 exports.globalPostMessageDefined = globalPostMessageDefined; 1306 exports.globalPostMessageDefined = globalPostMessageDefined;
1307 exports.IsolateNatives = IsolateNatives; 1307 exports.IsolateNatives = IsolateNatives;
1308 exports.RawReceivePortImpl = RawReceivePortImpl; 1308 exports.RawReceivePortImpl = RawReceivePortImpl;
1309 exports.ReceivePortImpl = ReceivePortImpl; 1309 exports.ReceivePortImpl = ReceivePortImpl;
1310 exports.TimerImpl = TimerImpl; 1310 exports.TimerImpl = TimerImpl;
1311 exports.hasTimer = hasTimer; 1311 exports.hasTimer = hasTimer;
1312 exports.CapabilityImpl = CapabilityImpl; 1312 exports.CapabilityImpl = CapabilityImpl;
1313 })(_isolate_helper || (_isolate_helper = {})); 1313 })(_isolate_helper || (_isolate_helper = {}));
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698