| OLD | NEW |
| 1 dart_library.library('dart/_isolate_helper', null, /* Imports */[ | 1 dart_library.library('dart/_isolate_helper', null, /* Imports */[ |
| 2 "dart_runtime/dart", | 2 "dart_runtime/dart", |
| 3 'dart/core', | 3 'dart/core', |
| 4 'dart/_interceptors', | 4 'dart/_interceptors', |
| 5 'dart/_js_helper', | 5 'dart/_js_helper', |
| 6 'dart/isolate', | 6 'dart/isolate', |
| 7 'dart/_foreign_helper', | 7 'dart/_foreign_helper', |
| 8 'dart/collection', | 8 'dart/collection', |
| 9 'dart/async' | 9 'dart/async' |
| 10 ], /* Lazy imports */[ | 10 ], /* Lazy imports */[ |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 dart.fn(_clone); | 29 dart.fn(_clone); |
| 30 let _serializeSendPorts = Symbol('_serializeSendPorts'); | 30 let _serializeSendPorts = Symbol('_serializeSendPorts'); |
| 31 let _workerId = Symbol('_workerId'); | 31 let _workerId = Symbol('_workerId'); |
| 32 let _isolateId = Symbol('_isolateId'); | 32 let _isolateId = Symbol('_isolateId'); |
| 33 let _receivePortId = Symbol('_receivePortId'); | 33 let _receivePortId = Symbol('_receivePortId'); |
| 34 let _id = Symbol('_id'); | 34 let _id = Symbol('_id'); |
| 35 let _receivePort = Symbol('_receivePort'); | 35 let _receivePort = Symbol('_receivePort'); |
| 36 class _Serializer extends core.Object { | 36 class _Serializer extends core.Object { |
| 37 _Serializer(opts) { | 37 _Serializer(opts) { |
| 38 let serializeSendPorts = opts && 'serializeSendPorts' in opts ? opts.seria
lizeSendPorts : true; | 38 let serializeSendPorts = opts && 'serializeSendPorts' in opts ? opts.seria
lizeSendPorts : true; |
| 39 this.serializedObjectIds = core.Map$(core.Object, core.int).identity(); | 39 this.serializedObjectIds = core.Map$(dart.dynamic, core.int).identity(); |
| 40 this[_serializeSendPorts] = dart.as(serializeSendPorts, core.bool); | 40 this[_serializeSendPorts] = dart.as(serializeSendPorts, core.bool); |
| 41 } | 41 } |
| 42 serialize(x) { | 42 serialize(x) { |
| 43 if (dart.notNull(this.isPrimitive(x))) | 43 if (dart.notNull(this.isPrimitive(x))) |
| 44 return this.serializePrimitive(x); | 44 return this.serializePrimitive(x); |
| 45 let serializationId = this.serializedObjectIds.get(x); | 45 let serializationId = this.serializedObjectIds.get(x); |
| 46 if (serializationId != null) | 46 if (serializationId != null) |
| 47 return this.makeRef(serializationId); | 47 return this.makeRef(serializationId); |
| 48 serializationId = this.serializedObjectIds.length; | 48 serializationId = this.serializedObjectIds.length; |
| 49 this.serializedObjectIds.set(x, serializationId); | 49 this.serializedObjectIds.set(x, serializationId); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 return serialized; | 115 return serialized; |
| 116 } | 116 } |
| 117 serializeArrayInPlace(x) { | 117 serializeArrayInPlace(x) { |
| 118 for (let i = 0; dart.notNull(i) < dart.notNull(x[dartx.length]); i = dart.
notNull(i) + 1) { | 118 for (let i = 0; dart.notNull(i) < dart.notNull(x[dartx.length]); i = dart.
notNull(i) + 1) { |
| 119 x[dartx.set](i, this.serialize(x[dartx.get](i))); | 119 x[dartx.set](i, this.serialize(x[dartx.get](i))); |
| 120 } | 120 } |
| 121 return x; | 121 return x; |
| 122 } | 122 } |
| 123 serializeMap(x) { | 123 serializeMap(x) { |
| 124 let serializeTearOff = dart.bind(this, 'serialize'); | 124 let serializeTearOff = dart.bind(this, 'serialize'); |
| 125 return ['map', x.keys[dartx.map](dart.as(serializeTearOff, __CastType0))[d
artx.toList](), x.values[dartx.map](dart.as(serializeTearOff, dart.functionType(
core.Object, [dart.bottom])))[dartx.toList]()]; | 125 return ['map', x.keys[dartx.map](dart.as(serializeTearOff, __CastType0))[d
artx.toList](), x.values[dartx.map](dart.as(serializeTearOff, dart.functionType(
dart.dynamic, [dart.dynamic])))[dartx.toList]()]; |
| 126 } | 126 } |
| 127 serializeJSObject(x) { | 127 serializeJSObject(x) { |
| 128 if (!!x.constructor && x.constructor !== Object) { | 128 if (!!x.constructor && x.constructor !== Object) { |
| 129 this.unsupported(x, "Only plain JS Objects are supported:"); | 129 this.unsupported(x, "Only plain JS Objects are supported:"); |
| 130 } | 130 } |
| 131 let keys = dart.as(Object.keys(x), core.List); | 131 let keys = dart.as(Object.keys(x), core.List); |
| 132 let values = []; | 132 let values = []; |
| 133 values[dartx.length] = keys[dartx.length]; | 133 values[dartx.length] = keys[dartx.length]; |
| 134 for (let i = 0; dart.notNull(i) < dart.notNull(keys[dartx.length]); i = da
rt.notNull(i) + 1) { | 134 for (let i = 0; dart.notNull(i) < dart.notNull(keys[dartx.length]); i = da
rt.notNull(i) + 1) { |
| 135 values[dartx.set](i, this.serialize(x[keys[dartx.get](i)])); | 135 values[dartx.set](i, this.serialize(x[keys[dartx.get](i)])); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 161 } | 161 } |
| 162 serializeDartObject(x) { | 162 serializeDartObject(x) { |
| 163 let classExtractor = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_n
ames.CLASS_ID_EXTRACTOR); | 163 let classExtractor = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_n
ames.CLASS_ID_EXTRACTOR); |
| 164 let fieldsExtractor = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_
names.CLASS_FIELDS_EXTRACTOR); | 164 let fieldsExtractor = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_
names.CLASS_FIELDS_EXTRACTOR); |
| 165 let classId = classExtractor(x); | 165 let classId = classExtractor(x); |
| 166 let fields = dart.as(fieldsExtractor(x), core.List); | 166 let fields = dart.as(fieldsExtractor(x), core.List); |
| 167 return ['dart', classId, this.serializeArrayInPlace(dart.as(fields, _inter
ceptors.JSArray))]; | 167 return ['dart', classId, this.serializeArrayInPlace(dart.as(fields, _inter
ceptors.JSArray))]; |
| 168 } | 168 } |
| 169 } | 169 } |
| 170 dart.setSignature(_Serializer, { | 170 dart.setSignature(_Serializer, { |
| 171 constructors: () => ({_Serializer: [_Serializer, [], {serializeSendPorts: co
re.Object}]}), | 171 constructors: () => ({_Serializer: [_Serializer, [], {serializeSendPorts: da
rt.dynamic}]}), |
| 172 methods: () => ({ | 172 methods: () => ({ |
| 173 serialize: [core.Object, [core.Object]], | 173 serialize: [dart.dynamic, [dart.dynamic]], |
| 174 unsupported: [dart.void, [core.Object], [core.String]], | 174 unsupported: [dart.void, [dart.dynamic], [core.String]], |
| 175 makeRef: [core.Object, [core.int]], | 175 makeRef: [dart.dynamic, [core.int]], |
| 176 isPrimitive: [core.bool, [core.Object]], | 176 isPrimitive: [core.bool, [dart.dynamic]], |
| 177 serializePrimitive: [core.Object, [core.Object]], | 177 serializePrimitive: [dart.dynamic, [dart.dynamic]], |
| 178 serializeByteBuffer: [core.Object, [_native_typed_data.NativeByteBuffer]], | 178 serializeByteBuffer: [dart.dynamic, [_native_typed_data.NativeByteBuffer]]
, |
| 179 serializeTypedData: [core.Object, [_native_typed_data.NativeTypedData]], | 179 serializeTypedData: [dart.dynamic, [_native_typed_data.NativeTypedData]], |
| 180 serializeJSIndexable: [core.Object, [_interceptors.JSIndexable]], | 180 serializeJSIndexable: [dart.dynamic, [_interceptors.JSIndexable]], |
| 181 serializeArray: [core.Object, [_interceptors.JSArray]], | 181 serializeArray: [dart.dynamic, [_interceptors.JSArray]], |
| 182 serializeArrayInPlace: [core.Object, [_interceptors.JSArray]], | 182 serializeArrayInPlace: [dart.dynamic, [_interceptors.JSArray]], |
| 183 serializeMap: [core.Object, [core.Map]], | 183 serializeMap: [dart.dynamic, [core.Map]], |
| 184 serializeJSObject: [core.Object, [_interceptors.JSObject]], | 184 serializeJSObject: [dart.dynamic, [_interceptors.JSObject]], |
| 185 serializeWorkerSendPort: [core.Object, [_WorkerSendPort]], | 185 serializeWorkerSendPort: [dart.dynamic, [_WorkerSendPort]], |
| 186 serializeJsSendPort: [core.Object, [_NativeJsSendPort]], | 186 serializeJsSendPort: [dart.dynamic, [_NativeJsSendPort]], |
| 187 serializeCapability: [core.Object, [CapabilityImpl]], | 187 serializeCapability: [dart.dynamic, [CapabilityImpl]], |
| 188 serializeClosure: [core.Object, [core.Function]], | 188 serializeClosure: [dart.dynamic, [core.Function]], |
| 189 serializeDartObject: [core.Object, [core.Object]] | 189 serializeDartObject: [dart.dynamic, [dart.dynamic]] |
| 190 }) | 190 }) |
| 191 }); | 191 }); |
| 192 let _adjustSendPorts = Symbol('_adjustSendPorts'); | 192 let _adjustSendPorts = Symbol('_adjustSendPorts'); |
| 193 class _Deserializer extends core.Object { | 193 class _Deserializer extends core.Object { |
| 194 _Deserializer(opts) { | 194 _Deserializer(opts) { |
| 195 let adjustSendPorts = opts && 'adjustSendPorts' in opts ? opts.adjustSendP
orts : true; | 195 let adjustSendPorts = opts && 'adjustSendPorts' in opts ? opts.adjustSendP
orts : true; |
| 196 this.deserializedObjects = core.List.new(); | 196 this.deserializedObjects = core.List.new(); |
| 197 this[_adjustSendPorts] = dart.as(adjustSendPorts, core.bool); | 197 this[_adjustSendPorts] = dart.as(adjustSendPorts, core.bool); |
| 198 } | 198 } |
| 199 deserialize(x) { | 199 deserialize(x) { |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 let fields = dart.as(dart.dindex(x, 2), core.List); | 375 let fields = dart.as(dart.dindex(x, 2), core.List); |
| 376 let instanceFromClassId = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embed
ded_names.INSTANCE_FROM_CLASS_ID); | 376 let instanceFromClassId = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embed
ded_names.INSTANCE_FROM_CLASS_ID); |
| 377 let initializeObject = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded
_names.INITIALIZE_EMPTY_INSTANCE); | 377 let initializeObject = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded
_names.INITIALIZE_EMPTY_INSTANCE); |
| 378 let emptyInstance = instanceFromClassId(classId); | 378 let emptyInstance = instanceFromClassId(classId); |
| 379 this.deserializedObjects[dartx.add](emptyInstance); | 379 this.deserializedObjects[dartx.add](emptyInstance); |
| 380 this.deserializeArrayInPlace(dart.as(fields, _interceptors.JSArray)); | 380 this.deserializeArrayInPlace(dart.as(fields, _interceptors.JSArray)); |
| 381 return initializeObject(classId, emptyInstance, fields); | 381 return initializeObject(classId, emptyInstance, fields); |
| 382 } | 382 } |
| 383 } | 383 } |
| 384 dart.setSignature(_Deserializer, { | 384 dart.setSignature(_Deserializer, { |
| 385 constructors: () => ({_Deserializer: [_Deserializer, [], {adjustSendPorts: c
ore.Object}]}), | 385 constructors: () => ({_Deserializer: [_Deserializer, [], {adjustSendPorts: d
art.dynamic}]}), |
| 386 methods: () => ({ | 386 methods: () => ({ |
| 387 deserialize: [core.Object, [core.Object]], | 387 deserialize: [dart.dynamic, [dart.dynamic]], |
| 388 isPrimitive: [core.bool, [core.Object]], | 388 isPrimitive: [core.bool, [dart.dynamic]], |
| 389 deserializePrimitive: [core.Object, [core.Object]], | 389 deserializePrimitive: [dart.dynamic, [dart.dynamic]], |
| 390 deserializeRef: [core.Object, [core.Object]], | 390 deserializeRef: [dart.dynamic, [dart.dynamic]], |
| 391 deserializeByteBuffer: [_native_typed_data.NativeByteBuffer, [core.Object]
], | 391 deserializeByteBuffer: [_native_typed_data.NativeByteBuffer, [dart.dynamic
]], |
| 392 deserializeTypedData: [_native_typed_data.NativeTypedData, [core.Object]], | 392 deserializeTypedData: [_native_typed_data.NativeTypedData, [dart.dynamic]]
, |
| 393 deserializeArrayInPlace: [core.List, [_interceptors.JSArray]], | 393 deserializeArrayInPlace: [core.List, [_interceptors.JSArray]], |
| 394 deserializeFixed: [core.List, [core.Object]], | 394 deserializeFixed: [core.List, [dart.dynamic]], |
| 395 deserializeExtendable: [core.List, [core.Object]], | 395 deserializeExtendable: [core.List, [dart.dynamic]], |
| 396 deserializeMutable: [core.List, [core.Object]], | 396 deserializeMutable: [core.List, [dart.dynamic]], |
| 397 deserializeConst: [core.List, [core.Object]], | 397 deserializeConst: [core.List, [dart.dynamic]], |
| 398 deserializeMap: [core.Map, [core.Object]], | 398 deserializeMap: [core.Map, [dart.dynamic]], |
| 399 deserializeSendPort: [isolate.SendPort, [core.Object]], | 399 deserializeSendPort: [isolate.SendPort, [dart.dynamic]], |
| 400 deserializeRawSendPort: [isolate.SendPort, [core.Object]], | 400 deserializeRawSendPort: [isolate.SendPort, [dart.dynamic]], |
| 401 deserializeJSObject: [core.Object, [core.Object]], | 401 deserializeJSObject: [dart.dynamic, [dart.dynamic]], |
| 402 deserializeClosure: [core.Function, [core.Object]], | 402 deserializeClosure: [core.Function, [dart.dynamic]], |
| 403 deserializeDartObject: [core.Object, [core.Object]] | 403 deserializeDartObject: [dart.dynamic, [dart.dynamic]] |
| 404 }) | 404 }) |
| 405 }); | 405 }); |
| 406 let __CastType0 = dart.typedef('__CastType0', () => dart.functionType(core.Obj
ect, [dart.bottom])); | 406 let __CastType0 = dart.typedef('__CastType0', () => dart.functionType(dart.dyn
amic, [dart.dynamic])); |
| 407 function _callInIsolate(isolate, func) { | 407 function _callInIsolate(isolate, func) { |
| 408 let result = isolate.eval(func); | 408 let result = isolate.eval(func); |
| 409 exports._globalState.topEventLoop.run(); | 409 exports._globalState.topEventLoop.run(); |
| 410 return result; | 410 return result; |
| 411 } | 411 } |
| 412 dart.fn(_callInIsolate, () => dart.functionType(core.Object, [_IsolateContext,
core.Function])); | 412 dart.fn(_callInIsolate, () => dart.definiteFunctionType(dart.dynamic, [_Isolat
eContext, core.Function])); |
| 413 let _activeJsAsyncCount = Symbol('_activeJsAsyncCount'); | 413 let _activeJsAsyncCount = Symbol('_activeJsAsyncCount'); |
| 414 function enterJsAsync() { | 414 function enterJsAsync() { |
| 415 let o = exports._globalState.topEventLoop; | 415 let o = exports._globalState.topEventLoop; |
| 416 o[_activeJsAsyncCount] = dart.notNull(o[_activeJsAsyncCount]) + 1; | 416 o[_activeJsAsyncCount] = dart.notNull(o[_activeJsAsyncCount]) + 1; |
| 417 } | 417 } |
| 418 dart.fn(enterJsAsync); | 418 dart.fn(enterJsAsync); |
| 419 function leaveJsAsync() { | 419 function leaveJsAsync() { |
| 420 let o = exports._globalState.topEventLoop; | 420 let o = exports._globalState.topEventLoop; |
| 421 o[_activeJsAsyncCount] = dart.notNull(o[_activeJsAsyncCount]) - 1; | 421 o[_activeJsAsyncCount] = dart.notNull(o[_activeJsAsyncCount]) - 1; |
| 422 dart.assert(dart.notNull(exports._globalState.topEventLoop[_activeJsAsyncCou
nt]) >= 0); | 422 dart.assert(dart.notNull(exports._globalState.topEventLoop[_activeJsAsyncCou
nt]) >= 0); |
| 423 } | 423 } |
| 424 dart.fn(leaveJsAsync); | 424 dart.fn(leaveJsAsync); |
| 425 function isWorker() { | 425 function isWorker() { |
| 426 return exports._globalState.isWorker; | 426 return exports._globalState.isWorker; |
| 427 } | 427 } |
| 428 dart.fn(isWorker, core.bool, []); | 428 dart.fn(isWorker, core.bool, []); |
| 429 function _currentIsolate() { | 429 function _currentIsolate() { |
| 430 return exports._globalState.currentContext; | 430 return exports._globalState.currentContext; |
| 431 } | 431 } |
| 432 dart.fn(_currentIsolate, () => dart.functionType(_IsolateContext, [])); | 432 dart.fn(_currentIsolate, () => dart.definiteFunctionType(_IsolateContext, []))
; |
| 433 function startRootIsolate(entry, args) { | 433 function startRootIsolate(entry, args) { |
| 434 args = args; | 434 args = args; |
| 435 if (args == null) | 435 if (args == null) |
| 436 args = []; | 436 args = []; |
| 437 if (!dart.is(args, core.List)) { | 437 if (!dart.is(args, core.List)) { |
| 438 throw new core.ArgumentError(`Arguments to main must be a List: ${args}`); | 438 throw new core.ArgumentError(`Arguments to main must be a List: ${args}`); |
| 439 } | 439 } |
| 440 exports._globalState = new _Manager(dart.as(entry, core.Function)); | 440 exports._globalState = new _Manager(dart.as(entry, core.Function)); |
| 441 if (dart.notNull(exports._globalState.isWorker)) | 441 if (dart.notNull(exports._globalState.isWorker)) |
| 442 return; | 442 return; |
| 443 let rootContext = new _IsolateContext(); | 443 let rootContext = new _IsolateContext(); |
| 444 exports._globalState.rootContext = rootContext; | 444 exports._globalState.rootContext = rootContext; |
| 445 exports._globalState.currentContext = rootContext; | 445 exports._globalState.currentContext = rootContext; |
| 446 if (dart.is(entry, _MainFunctionArgs)) { | 446 if (dart.is(entry, _MainFunctionArgs)) { |
| 447 rootContext.eval(dart.fn(() => { | 447 rootContext.eval(dart.fn(() => { |
| 448 dart.dcall(entry, args); | 448 dart.dcall(entry, args); |
| 449 })); | 449 })); |
| 450 } else if (dart.is(entry, _MainFunctionArgsMessage)) { | 450 } else if (dart.is(entry, _MainFunctionArgsMessage)) { |
| 451 rootContext.eval(dart.fn(() => { | 451 rootContext.eval(dart.fn(() => { |
| 452 dart.dcall(entry, args, null); | 452 dart.dcall(entry, args, null); |
| 453 })); | 453 })); |
| 454 } else { | 454 } else { |
| 455 rootContext.eval(dart.as(entry, core.Function)); | 455 rootContext.eval(dart.as(entry, core.Function)); |
| 456 } | 456 } |
| 457 exports._globalState.topEventLoop.run(); | 457 exports._globalState.topEventLoop.run(); |
| 458 } | 458 } |
| 459 dart.fn(startRootIsolate, dart.void, [core.Object, core.Object]); | 459 dart.fn(startRootIsolate, dart.void, [dart.dynamic, dart.dynamic]); |
| 460 dart.copyProperties(exports, { | 460 dart.copyProperties(exports, { |
| 461 get _globalState() { | 461 get _globalState() { |
| 462 return dart.as(dart.globalState, _Manager); | 462 return dart.as(dart.globalState, _Manager); |
| 463 }, | 463 }, |
| 464 set _globalState(val) { | 464 set _globalState(val) { |
| 465 dart.globalState = val; | 465 dart.globalState = val; |
| 466 } | 466 } |
| 467 }); | 467 }); |
| 468 let _nativeDetectEnvironment = Symbol('_nativeDetectEnvironment'); | 468 let _nativeDetectEnvironment = Symbol('_nativeDetectEnvironment'); |
| 469 let _nativeInitWorkerMessageHandler = Symbol('_nativeInitWorkerMessageHandler'
); | 469 let _nativeInitWorkerMessageHandler = Symbol('_nativeInitWorkerMessageHandler'
); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 481 this.topEventLoop = null; | 481 this.topEventLoop = null; |
| 482 this.fromCommandLine = null; | 482 this.fromCommandLine = null; |
| 483 this.isWorker = null; | 483 this.isWorker = null; |
| 484 this.supportsWorkers = null; | 484 this.supportsWorkers = null; |
| 485 this.isolates = null; | 485 this.isolates = null; |
| 486 this.mainManager = null; | 486 this.mainManager = null; |
| 487 this.managers = null; | 487 this.managers = null; |
| 488 this[_nativeDetectEnvironment](); | 488 this[_nativeDetectEnvironment](); |
| 489 this.topEventLoop = new _EventLoop(); | 489 this.topEventLoop = new _EventLoop(); |
| 490 this.isolates = core.Map$(core.int, _IsolateContext).new(); | 490 this.isolates = core.Map$(core.int, _IsolateContext).new(); |
| 491 this.managers = core.Map$(core.int, core.Object).new(); | 491 this.managers = core.Map$(core.int, dart.dynamic).new(); |
| 492 if (dart.notNull(this.isWorker)) { | 492 if (dart.notNull(this.isWorker)) { |
| 493 this.mainManager = new _MainManagerStub(); | 493 this.mainManager = new _MainManagerStub(); |
| 494 this[_nativeInitWorkerMessageHandler](); | 494 this[_nativeInitWorkerMessageHandler](); |
| 495 } | 495 } |
| 496 } | 496 } |
| 497 [_nativeDetectEnvironment]() { | 497 [_nativeDetectEnvironment]() { |
| 498 let isWindowDefined = exports.globalWindow != null; | 498 let isWindowDefined = exports.globalWindow != null; |
| 499 let isWorkerDefined = exports.globalWorker != null; | 499 let isWorkerDefined = exports.globalWorker != null; |
| 500 this.isWorker = !dart.notNull(isWindowDefined) && dart.notNull(exports.glo
balPostMessageDefined); | 500 this.isWorker = !dart.notNull(isWindowDefined) && dart.notNull(exports.glo
balPostMessageDefined); |
| 501 this.supportsWorkers = dart.notNull(this.isWorker) || dart.notNull(isWorke
rDefined) && IsolateNatives.thisScript != null; | 501 this.supportsWorkers = dart.notNull(this.isWorker) || dart.notNull(isWorke
rDefined) && IsolateNatives.thisScript != null; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 527 } | 527 } |
| 528 } | 528 } |
| 529 } | 529 } |
| 530 dart.setSignature(_Manager, { | 530 dart.setSignature(_Manager, { |
| 531 constructors: () => ({_Manager: [_Manager, [core.Function]]}), | 531 constructors: () => ({_Manager: [_Manager, [core.Function]]}), |
| 532 methods: () => ({ | 532 methods: () => ({ |
| 533 [_nativeDetectEnvironment]: [dart.void, []], | 533 [_nativeDetectEnvironment]: [dart.void, []], |
| 534 [_nativeInitWorkerMessageHandler]: [dart.void, []], | 534 [_nativeInitWorkerMessageHandler]: [dart.void, []], |
| 535 maybeCloseWorker: [dart.void, []] | 535 maybeCloseWorker: [dart.void, []] |
| 536 }), | 536 }), |
| 537 statics: () => ({_serializePrintMessage: [core.Object, [core.Object]]}), | 537 statics: () => ({_serializePrintMessage: [dart.dynamic, [dart.dynamic]]}), |
| 538 names: ['_serializePrintMessage'] | 538 names: ['_serializePrintMessage'] |
| 539 }); | 539 }); |
| 540 let _scheduledControlEvents = Symbol('_scheduledControlEvents'); | 540 let _scheduledControlEvents = Symbol('_scheduledControlEvents'); |
| 541 let _isExecutingEvent = Symbol('_isExecutingEvent'); | 541 let _isExecutingEvent = Symbol('_isExecutingEvent'); |
| 542 let _updateGlobalState = Symbol('_updateGlobalState'); | 542 let _updateGlobalState = Symbol('_updateGlobalState'); |
| 543 let _setGlobals = Symbol('_setGlobals'); | 543 let _setGlobals = Symbol('_setGlobals'); |
| 544 let _addRegistration = Symbol('_addRegistration'); | 544 let _addRegistration = Symbol('_addRegistration'); |
| 545 let _close = Symbol('_close'); | 545 let _close = Symbol('_close'); |
| 546 class _IsolateContext extends core.Object { | 546 class _IsolateContext extends core.Object { |
| 547 _IsolateContext() { | 547 _IsolateContext() { |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 806 methods: () => ({ | 806 methods: () => ({ |
| 807 addPause: [dart.void, [isolate.Capability, isolate.Capability]], | 807 addPause: [dart.void, [isolate.Capability, isolate.Capability]], |
| 808 removePause: [dart.void, [isolate.Capability]], | 808 removePause: [dart.void, [isolate.Capability]], |
| 809 addDoneListener: [dart.void, [isolate.SendPort]], | 809 addDoneListener: [dart.void, [isolate.SendPort]], |
| 810 removeDoneListener: [dart.void, [isolate.SendPort]], | 810 removeDoneListener: [dart.void, [isolate.SendPort]], |
| 811 setErrorsFatal: [dart.void, [isolate.Capability, core.bool]], | 811 setErrorsFatal: [dart.void, [isolate.Capability, core.bool]], |
| 812 handlePing: [dart.void, [isolate.SendPort, core.int]], | 812 handlePing: [dart.void, [isolate.SendPort, core.int]], |
| 813 handleKill: [dart.void, [isolate.Capability, core.int]], | 813 handleKill: [dart.void, [isolate.Capability, core.int]], |
| 814 addErrorListener: [dart.void, [isolate.SendPort]], | 814 addErrorListener: [dart.void, [isolate.SendPort]], |
| 815 removeErrorListener: [dart.void, [isolate.SendPort]], | 815 removeErrorListener: [dart.void, [isolate.SendPort]], |
| 816 handleUncaughtError: [dart.void, [core.Object, core.StackTrace]], | 816 handleUncaughtError: [dart.void, [dart.dynamic, core.StackTrace]], |
| 817 eval: [core.Object, [core.Function]], | 817 eval: [dart.dynamic, [core.Function]], |
| 818 [_setGlobals]: [dart.void, []], | 818 [_setGlobals]: [dart.void, []], |
| 819 handleControlMessage: [dart.void, [core.Object]], | 819 handleControlMessage: [dart.void, [dart.dynamic]], |
| 820 lookup: [RawReceivePortImpl, [core.int]], | 820 lookup: [RawReceivePortImpl, [core.int]], |
| 821 [_addRegistration]: [dart.void, [core.int, RawReceivePortImpl]], | 821 [_addRegistration]: [dart.void, [core.int, RawReceivePortImpl]], |
| 822 register: [dart.void, [core.int, RawReceivePortImpl]], | 822 register: [dart.void, [core.int, RawReceivePortImpl]], |
| 823 registerWeak: [dart.void, [core.int, RawReceivePortImpl]], | 823 registerWeak: [dart.void, [core.int, RawReceivePortImpl]], |
| 824 [_updateGlobalState]: [dart.void, []], | 824 [_updateGlobalState]: [dart.void, []], |
| 825 kill: [dart.void, []], | 825 kill: [dart.void, []], |
| 826 unregister: [dart.void, [core.int]] | 826 unregister: [dart.void, [core.int]] |
| 827 }) | 827 }) |
| 828 }); | 828 }); |
| 829 let _runHelper = Symbol('_runHelper'); | 829 let _runHelper = Symbol('_runHelper'); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 882 let trace = dart.stackTrace(e); | 882 let trace = dart.stackTrace(e); |
| 883 exports._globalState.mainManager.postMessage(_serializeMessage(dart.ma
p({command: 'error', msg: `${e}\n${trace}`}))); | 883 exports._globalState.mainManager.postMessage(_serializeMessage(dart.ma
p({command: 'error', msg: `${e}\n${trace}`}))); |
| 884 } | 884 } |
| 885 | 885 |
| 886 } | 886 } |
| 887 } | 887 } |
| 888 } | 888 } |
| 889 dart.setSignature(_EventLoop, { | 889 dart.setSignature(_EventLoop, { |
| 890 constructors: () => ({_EventLoop: [_EventLoop, []]}), | 890 constructors: () => ({_EventLoop: [_EventLoop, []]}), |
| 891 methods: () => ({ | 891 methods: () => ({ |
| 892 enqueue: [dart.void, [core.Object, core.Object, core.Object]], | 892 enqueue: [dart.void, [dart.dynamic, dart.dynamic, dart.dynamic]], |
| 893 prequeue: [dart.void, [_IsolateEvent]], | 893 prequeue: [dart.void, [_IsolateEvent]], |
| 894 dequeue: [_IsolateEvent, []], | 894 dequeue: [_IsolateEvent, []], |
| 895 checkOpenReceivePortsFromCommandLine: [dart.void, []], | 895 checkOpenReceivePortsFromCommandLine: [dart.void, []], |
| 896 runIteration: [core.bool, []], | 896 runIteration: [core.bool, []], |
| 897 [_runHelper]: [dart.void, []], | 897 [_runHelper]: [dart.void, []], |
| 898 run: [dart.void, []] | 898 run: [dart.void, []] |
| 899 }) | 899 }) |
| 900 }); | 900 }); |
| 901 class _IsolateEvent extends core.Object { | 901 class _IsolateEvent extends core.Object { |
| 902 _IsolateEvent(isolate, fn, message) { | 902 _IsolateEvent(isolate, fn, message) { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 915 dart.setSignature(_IsolateEvent, { | 915 dart.setSignature(_IsolateEvent, { |
| 916 constructors: () => ({_IsolateEvent: [_IsolateEvent, [_IsolateContext, core.
Function, core.String]]}), | 916 constructors: () => ({_IsolateEvent: [_IsolateEvent, [_IsolateContext, core.
Function, core.String]]}), |
| 917 methods: () => ({process: [dart.void, []]}) | 917 methods: () => ({process: [dart.void, []]}) |
| 918 }); | 918 }); |
| 919 class _MainManagerStub extends core.Object { | 919 class _MainManagerStub extends core.Object { |
| 920 postMessage(msg) { | 920 postMessage(msg) { |
| 921 self.postMessage(msg); | 921 self.postMessage(msg); |
| 922 } | 922 } |
| 923 } | 923 } |
| 924 dart.setSignature(_MainManagerStub, { | 924 dart.setSignature(_MainManagerStub, { |
| 925 methods: () => ({postMessage: [dart.void, [core.Object]]}) | 925 methods: () => ({postMessage: [dart.void, [dart.dynamic]]}) |
| 926 }); | 926 }); |
| 927 let _SPAWNED_SIGNAL = "spawned"; | 927 let _SPAWNED_SIGNAL = "spawned"; |
| 928 let _SPAWN_FAILED_SIGNAL = "spawn failed"; | 928 let _SPAWN_FAILED_SIGNAL = "spawn failed"; |
| 929 dart.copyProperties(exports, { | 929 dart.copyProperties(exports, { |
| 930 get globalWindow() { | 930 get globalWindow() { |
| 931 return self.window; | 931 return self.window; |
| 932 }, | 932 }, |
| 933 get globalWorker() { | 933 get globalWorker() { |
| 934 return self.Worker; | 934 return self.Worker; |
| 935 }, | 935 }, |
| 936 get globalPostMessageDefined() { | 936 get globalPostMessageDefined() { |
| 937 return !!self.postMessage; | 937 return !!self.postMessage; |
| 938 } | 938 } |
| 939 }); | 939 }); |
| 940 let _MainFunction = dart.typedef('_MainFunction', () => dart.functionType(core
.Object, [])); | 940 let _MainFunction = dart.typedef('_MainFunction', () => dart.functionType(dart
.dynamic, [])); |
| 941 let _MainFunctionArgs = dart.typedef('_MainFunctionArgs', () => dart.functionT
ype(core.Object, [dart.bottom])); | 941 let _MainFunctionArgs = dart.typedef('_MainFunctionArgs', () => dart.functionT
ype(dart.dynamic, [dart.dynamic])); |
| 942 let _MainFunctionArgsMessage = dart.typedef('_MainFunctionArgsMessage', () =>
dart.functionType(core.Object, [dart.bottom, dart.bottom])); | 942 let _MainFunctionArgsMessage = dart.typedef('_MainFunctionArgsMessage', () =>
dart.functionType(dart.dynamic, [dart.dynamic, dart.dynamic])); |
| 943 class IsolateNatives extends core.Object { | 943 class IsolateNatives extends core.Object { |
| 944 static computeThisScript() { | 944 static computeThisScript() { |
| 945 let currentScript = document.currentScript; | 945 let currentScript = document.currentScript; |
| 946 if (currentScript != null) { | 946 if (currentScript != null) { |
| 947 return String(currentScript.src); | 947 return String(currentScript.src); |
| 948 } | 948 } |
| 949 if (dart.notNull(_js_helper.Primitives.isD8)) | 949 if (dart.notNull(_js_helper.Primitives.isD8)) |
| 950 return IsolateNatives.computeThisScriptD8(); | 950 return IsolateNatives.computeThisScriptD8(); |
| 951 if (dart.notNull(_js_helper.Primitives.isJsshell)) | 951 if (dart.notNull(_js_helper.Primitives.isJsshell)) |
| 952 return IsolateNatives.computeThisScriptJsshell(); | 952 return IsolateNatives.computeThisScriptJsshell(); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1050 throw dart.dindex(msg, 'msg'); | 1050 throw dart.dindex(msg, 'msg'); |
| 1051 } | 1051 } |
| 1052 } | 1052 } |
| 1053 } | 1053 } |
| 1054 static handleSpawnWorkerRequest(msg) { | 1054 static handleSpawnWorkerRequest(msg) { |
| 1055 let replyPort = dart.dindex(msg, 'replyPort'); | 1055 let replyPort = dart.dindex(msg, 'replyPort'); |
| 1056 IsolateNatives.spawn(dart.as(dart.dindex(msg, 'functionName'), core.String
), dart.as(dart.dindex(msg, 'uri'), core.String), dart.as(dart.dindex(msg, 'args
'), core.List$(core.String)), dart.dindex(msg, 'msg'), false, dart.as(dart.dinde
x(msg, 'isSpawnUri'), core.bool), dart.as(dart.dindex(msg, 'startPaused'), core.
bool)).then(dart.fn(msg => { | 1056 IsolateNatives.spawn(dart.as(dart.dindex(msg, 'functionName'), core.String
), dart.as(dart.dindex(msg, 'uri'), core.String), dart.as(dart.dindex(msg, 'args
'), core.List$(core.String)), dart.dindex(msg, 'msg'), false, dart.as(dart.dinde
x(msg, 'isSpawnUri'), core.bool), dart.as(dart.dindex(msg, 'startPaused'), core.
bool)).then(dart.fn(msg => { |
| 1057 dart.dsend(replyPort, 'send', msg); | 1057 dart.dsend(replyPort, 'send', msg); |
| 1058 }), {onError: dart.fn(errorMessage => { | 1058 }), {onError: dart.fn(errorMessage => { |
| 1059 dart.dsend(replyPort, 'send', [_SPAWN_FAILED_SIGNAL, errorMessage]); | 1059 dart.dsend(replyPort, 'send', [_SPAWN_FAILED_SIGNAL, errorMessage]); |
| 1060 }, core.Object, [core.String])}); | 1060 }, dart.dynamic, [core.String])}); |
| 1061 } | 1061 } |
| 1062 static _log(msg) { | 1062 static _log(msg) { |
| 1063 if (dart.notNull(exports._globalState.isWorker)) { | 1063 if (dart.notNull(exports._globalState.isWorker)) { |
| 1064 exports._globalState.mainManager.postMessage(_serializeMessage(dart.map(
{command: 'log', msg: msg}))); | 1064 exports._globalState.mainManager.postMessage(_serializeMessage(dart.map(
{command: 'log', msg: msg}))); |
| 1065 } else { | 1065 } else { |
| 1066 try { | 1066 try { |
| 1067 IsolateNatives._consoleLog(msg); | 1067 IsolateNatives._consoleLog(msg); |
| 1068 } catch (e) { | 1068 } catch (e) { |
| 1069 let trace = dart.stackTrace(e); | 1069 let trace = dart.stackTrace(e); |
| 1070 throw core.Exception.new(trace); | 1070 throw core.Exception.new(trace); |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1207 onError(message); | 1207 onError(message); |
| 1208 return true; | 1208 return true; |
| 1209 } | 1209 } |
| 1210 } | 1210 } |
| 1211 dart.setSignature(IsolateNatives, { | 1211 dart.setSignature(IsolateNatives, { |
| 1212 statics: () => ({ | 1212 statics: () => ({ |
| 1213 computeThisScript: [core.String, []], | 1213 computeThisScript: [core.String, []], |
| 1214 computeThisScriptJsshell: [core.String, []], | 1214 computeThisScriptJsshell: [core.String, []], |
| 1215 computeThisScriptD8: [core.String, []], | 1215 computeThisScriptD8: [core.String, []], |
| 1216 computeThisScriptFromTrace: [core.String, []], | 1216 computeThisScriptFromTrace: [core.String, []], |
| 1217 _getEventData: [core.Object, [core.Object]], | 1217 _getEventData: [dart.dynamic, [dart.dynamic]], |
| 1218 _processWorkerMessage: [dart.void, [core.Object, core.Object]], | 1218 _processWorkerMessage: [dart.void, [dart.dynamic, dart.dynamic]], |
| 1219 handleSpawnWorkerRequest: [core.Object, [core.Object]], | 1219 handleSpawnWorkerRequest: [dart.dynamic, [dart.dynamic]], |
| 1220 _log: [core.Object, [core.Object]], | 1220 _log: [dart.dynamic, [dart.dynamic]], |
| 1221 _consoleLog: [dart.void, [core.Object]], | 1221 _consoleLog: [dart.void, [dart.dynamic]], |
| 1222 _getJSFunctionFromName: [core.Object, [core.String]], | 1222 _getJSFunctionFromName: [dart.dynamic, [core.String]], |
| 1223 _getJSFunctionName: [core.String, [core.Function]], | 1223 _getJSFunctionName: [core.String, [core.Function]], |
| 1224 _allocate: [core.Object, [core.Object]], | 1224 _allocate: [dart.dynamic, [dart.dynamic]], |
| 1225 spawnFunction: [async.Future$(core.List), [dart.functionType(dart.void, [d
art.bottom]), core.Object, core.bool]], | 1225 spawnFunction: [async.Future$(core.List), [dart.functionType(dart.void, [d
art.dynamic]), dart.dynamic, core.bool]], |
| 1226 spawnUri: [async.Future$(core.List), [core.Uri, core.List$(core.String), c
ore.Object, core.bool]], | 1226 spawnUri: [async.Future$(core.List), [core.Uri, core.List$(core.String), d
art.dynamic, core.bool]], |
| 1227 spawn: [async.Future$(core.List), [core.String, core.String, core.List$(co
re.String), core.Object, core.bool, core.bool, core.bool]], | 1227 spawn: [async.Future$(core.List), [core.String, core.String, core.List$(co
re.String), dart.dynamic, core.bool, core.bool, core.bool]], |
| 1228 _startWorker: [dart.void, [core.String, core.String, core.List$(core.Strin
g), core.Object, core.bool, core.bool, isolate.SendPort, dart.functionType(dart.
void, [core.String])]], | 1228 _startWorker: [dart.void, [core.String, core.String, core.List$(core.Strin
g), dart.dynamic, core.bool, core.bool, isolate.SendPort, dart.functionType(dart
.void, [core.String])]], |
| 1229 _startNonWorker: [dart.void, [core.String, core.String, core.List$(core.St
ring), core.Object, core.bool, core.bool, isolate.SendPort]], | 1229 _startNonWorker: [dart.void, [core.String, core.String, core.List$(core.St
ring), dart.dynamic, core.bool, core.bool, isolate.SendPort]], |
| 1230 _startIsolate: [dart.void, [core.Function, core.List$(core.String), core.O
bject, core.bool, core.bool, isolate.SendPort]], | 1230 _startIsolate: [dart.void, [core.Function, core.List$(core.String), dart.d
ynamic, core.bool, core.bool, isolate.SendPort]], |
| 1231 _spawnWorker: [dart.void, [core.Object, core.String, core.List$(core.Strin
g), core.Object, core.bool, core.bool, isolate.SendPort, dart.functionType(dart.
void, [core.String])]], | 1231 _spawnWorker: [dart.void, [dart.dynamic, core.String, core.List$(core.Stri
ng), dart.dynamic, core.bool, core.bool, isolate.SendPort, dart.functionType(dar
t.void, [core.String])]], |
| 1232 workerOnError: [core.bool, [core.Object, core.String, dart.functionType(da
rt.void, [core.String])]] | 1232 workerOnError: [core.bool, [dart.dynamic, core.String, dart.functionType(d
art.void, [core.String])]] |
| 1233 }), | 1233 }), |
| 1234 names: ['computeThisScript', 'computeThisScriptJsshell', 'computeThisScriptD
8', 'computeThisScriptFromTrace', '_getEventData', '_processWorkerMessage', 'han
dleSpawnWorkerRequest', '_log', '_consoleLog', '_getJSFunctionFromName', '_getJS
FunctionName', '_allocate', 'spawnFunction', 'spawnUri', 'spawn', '_startWorker'
, '_startNonWorker', '_startIsolate', '_spawnWorker', 'workerOnError'] | 1234 names: ['computeThisScript', 'computeThisScriptJsshell', 'computeThisScriptD
8', 'computeThisScriptFromTrace', '_getEventData', '_processWorkerMessage', 'han
dleSpawnWorkerRequest', '_log', '_consoleLog', '_getJSFunctionFromName', '_getJS
FunctionName', '_allocate', 'spawnFunction', 'spawnUri', 'spawn', '_startWorker'
, '_startNonWorker', '_startIsolate', '_spawnWorker', 'workerOnError'] |
| 1235 }); | 1235 }); |
| 1236 IsolateNatives.enableSpawnWorker = null; | 1236 IsolateNatives.enableSpawnWorker = null; |
| 1237 dart.defineLazyProperties(IsolateNatives, { | 1237 dart.defineLazyProperties(IsolateNatives, { |
| 1238 get thisScript() { | 1238 get thisScript() { |
| 1239 return IsolateNatives.computeThisScript(); | 1239 return IsolateNatives.computeThisScript(); |
| 1240 }, | 1240 }, |
| 1241 set thisScript(_) {}, | 1241 set thisScript(_) {}, |
| 1242 get workerIds() { | 1242 get workerIds() { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1286 ['=='](other) { | 1286 ['=='](other) { |
| 1287 return dart.is(other, _NativeJsSendPort) && dart.equals(this[_receivePort]
, dart.dload(other, _receivePort)); | 1287 return dart.is(other, _NativeJsSendPort) && dart.equals(this[_receivePort]
, dart.dload(other, _receivePort)); |
| 1288 } | 1288 } |
| 1289 get hashCode() { | 1289 get hashCode() { |
| 1290 return this[_receivePort][_id]; | 1290 return this[_receivePort][_id]; |
| 1291 } | 1291 } |
| 1292 } | 1292 } |
| 1293 _NativeJsSendPort[dart.implements] = () => [isolate.SendPort]; | 1293 _NativeJsSendPort[dart.implements] = () => [isolate.SendPort]; |
| 1294 dart.setSignature(_NativeJsSendPort, { | 1294 dart.setSignature(_NativeJsSendPort, { |
| 1295 constructors: () => ({_NativeJsSendPort: [_NativeJsSendPort, [RawReceivePort
Impl, core.int]]}), | 1295 constructors: () => ({_NativeJsSendPort: [_NativeJsSendPort, [RawReceivePort
Impl, core.int]]}), |
| 1296 methods: () => ({send: [dart.void, [core.Object]]}) | 1296 methods: () => ({send: [dart.void, [dart.dynamic]]}) |
| 1297 }); | 1297 }); |
| 1298 class _WorkerSendPort extends _BaseSendPort { | 1298 class _WorkerSendPort extends _BaseSendPort { |
| 1299 _WorkerSendPort(workerId, isolateId, receivePortId) { | 1299 _WorkerSendPort(workerId, isolateId, receivePortId) { |
| 1300 this[_workerId] = workerId; | 1300 this[_workerId] = workerId; |
| 1301 this[_receivePortId] = receivePortId; | 1301 this[_receivePortId] = receivePortId; |
| 1302 super._BaseSendPort(isolateId); | 1302 super._BaseSendPort(isolateId); |
| 1303 } | 1303 } |
| 1304 send(message) { | 1304 send(message) { |
| 1305 let workerMessage = _serializeMessage(dart.map({command: 'message', port:
this, msg: message})); | 1305 let workerMessage = _serializeMessage(dart.map({command: 'message', port:
this, msg: message})); |
| 1306 if (dart.notNull(exports._globalState.isWorker)) { | 1306 if (dart.notNull(exports._globalState.isWorker)) { |
| 1307 exports._globalState.mainManager.postMessage(workerMessage); | 1307 exports._globalState.mainManager.postMessage(workerMessage); |
| 1308 } else { | 1308 } else { |
| 1309 let manager = exports._globalState.managers.get(this[_workerId]); | 1309 let manager = exports._globalState.managers.get(this[_workerId]); |
| 1310 if (manager != null) { | 1310 if (manager != null) { |
| 1311 manager.postMessage(workerMessage); | 1311 manager.postMessage(workerMessage); |
| 1312 } | 1312 } |
| 1313 } | 1313 } |
| 1314 } | 1314 } |
| 1315 ['=='](other) { | 1315 ['=='](other) { |
| 1316 return dart.is(other, _WorkerSendPort) && dart.equals(this[_workerId], dar
t.dload(other, _workerId)) && dart.equals(this[_isolateId], dart.dload(other, _i
solateId)) && dart.equals(this[_receivePortId], dart.dload(other, _receivePortId
)); | 1316 return dart.is(other, _WorkerSendPort) && dart.equals(this[_workerId], dar
t.dload(other, _workerId)) && dart.equals(this[_isolateId], dart.dload(other, _i
solateId)) && dart.equals(this[_receivePortId], dart.dload(other, _receivePortId
)); |
| 1317 } | 1317 } |
| 1318 get hashCode() { | 1318 get hashCode() { |
| 1319 return dart.notNull(this[_workerId]) << 16 ^ dart.notNull(this[_isolateId]
) << 8 ^ dart.notNull(this[_receivePortId]); | 1319 return dart.notNull(this[_workerId]) << 16 ^ dart.notNull(this[_isolateId]
) << 8 ^ dart.notNull(this[_receivePortId]); |
| 1320 } | 1320 } |
| 1321 } | 1321 } |
| 1322 _WorkerSendPort[dart.implements] = () => [isolate.SendPort]; | 1322 _WorkerSendPort[dart.implements] = () => [isolate.SendPort]; |
| 1323 dart.setSignature(_WorkerSendPort, { | 1323 dart.setSignature(_WorkerSendPort, { |
| 1324 constructors: () => ({_WorkerSendPort: [_WorkerSendPort, [core.int, core.int
, core.int]]}), | 1324 constructors: () => ({_WorkerSendPort: [_WorkerSendPort, [core.int, core.int
, core.int]]}), |
| 1325 methods: () => ({send: [dart.void, [core.Object]]}) | 1325 methods: () => ({send: [dart.void, [dart.dynamic]]}) |
| 1326 }); | 1326 }); |
| 1327 let _handler = Symbol('_handler'); | 1327 let _handler = Symbol('_handler'); |
| 1328 class RawReceivePortImpl extends core.Object { | 1328 class RawReceivePortImpl extends core.Object { |
| 1329 RawReceivePortImpl(handler) { | 1329 RawReceivePortImpl(handler) { |
| 1330 this[_handler] = handler; | 1330 this[_handler] = handler; |
| 1331 this[_id] = (() => { | 1331 this[_id] = (() => { |
| 1332 let x = RawReceivePortImpl._nextFreeId; | 1332 let x = RawReceivePortImpl._nextFreeId; |
| 1333 RawReceivePortImpl._nextFreeId = dart.notNull(x) + 1; | 1333 RawReceivePortImpl._nextFreeId = dart.notNull(x) + 1; |
| 1334 return x; | 1334 return x; |
| 1335 })(); | 1335 })(); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1379 dart.defineNamedConstructor(RawReceivePortImpl, '_controlPort'); | 1379 dart.defineNamedConstructor(RawReceivePortImpl, '_controlPort'); |
| 1380 dart.setSignature(RawReceivePortImpl, { | 1380 dart.setSignature(RawReceivePortImpl, { |
| 1381 constructors: () => ({ | 1381 constructors: () => ({ |
| 1382 RawReceivePortImpl: [RawReceivePortImpl, [core.Function]], | 1382 RawReceivePortImpl: [RawReceivePortImpl, [core.Function]], |
| 1383 weak: [RawReceivePortImpl, [core.Function]], | 1383 weak: [RawReceivePortImpl, [core.Function]], |
| 1384 _controlPort: [RawReceivePortImpl, []] | 1384 _controlPort: [RawReceivePortImpl, []] |
| 1385 }), | 1385 }), |
| 1386 methods: () => ({ | 1386 methods: () => ({ |
| 1387 [_close]: [dart.void, []], | 1387 [_close]: [dart.void, []], |
| 1388 close: [dart.void, []], | 1388 close: [dart.void, []], |
| 1389 [_add]: [dart.void, [core.Object]] | 1389 [_add]: [dart.void, [dart.dynamic]] |
| 1390 }) | 1390 }) |
| 1391 }); | 1391 }); |
| 1392 RawReceivePortImpl._nextFreeId = 1; | 1392 RawReceivePortImpl._nextFreeId = 1; |
| 1393 let _rawPort = Symbol('_rawPort'); | 1393 let _rawPort = Symbol('_rawPort'); |
| 1394 let _controller = Symbol('_controller'); | 1394 let _controller = Symbol('_controller'); |
| 1395 class ReceivePortImpl extends async.Stream { | 1395 class ReceivePortImpl extends async.Stream { |
| 1396 ReceivePortImpl() { | 1396 ReceivePortImpl() { |
| 1397 this.fromRawReceivePort(new RawReceivePortImpl(null)); | 1397 this.fromRawReceivePort(new RawReceivePortImpl(null)); |
| 1398 } | 1398 } |
| 1399 weak() { | 1399 weak() { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1423 ReceivePortImpl[dart.implements] = () => [isolate.ReceivePort]; | 1423 ReceivePortImpl[dart.implements] = () => [isolate.ReceivePort]; |
| 1424 dart.defineNamedConstructor(ReceivePortImpl, 'weak'); | 1424 dart.defineNamedConstructor(ReceivePortImpl, 'weak'); |
| 1425 dart.defineNamedConstructor(ReceivePortImpl, 'fromRawReceivePort'); | 1425 dart.defineNamedConstructor(ReceivePortImpl, 'fromRawReceivePort'); |
| 1426 dart.setSignature(ReceivePortImpl, { | 1426 dart.setSignature(ReceivePortImpl, { |
| 1427 constructors: () => ({ | 1427 constructors: () => ({ |
| 1428 ReceivePortImpl: [ReceivePortImpl, []], | 1428 ReceivePortImpl: [ReceivePortImpl, []], |
| 1429 weak: [ReceivePortImpl, []], | 1429 weak: [ReceivePortImpl, []], |
| 1430 fromRawReceivePort: [ReceivePortImpl, [isolate.RawReceivePort]] | 1430 fromRawReceivePort: [ReceivePortImpl, [isolate.RawReceivePort]] |
| 1431 }), | 1431 }), |
| 1432 methods: () => ({ | 1432 methods: () => ({ |
| 1433 listen: [async.StreamSubscription, [dart.functionType(dart.void, [dart.bot
tom])], {onError: core.Function, onDone: dart.functionType(dart.void, []), cance
lOnError: core.bool}], | 1433 listen: [async.StreamSubscription, [dart.functionType(dart.void, [dart.dyn
amic])], {onError: core.Function, onDone: dart.functionType(dart.void, []), canc
elOnError: core.bool}], |
| 1434 close: [dart.void, []] | 1434 close: [dart.void, []] |
| 1435 }) | 1435 }) |
| 1436 }); | 1436 }); |
| 1437 let _once = Symbol('_once'); | 1437 let _once = Symbol('_once'); |
| 1438 let _inEventLoop = Symbol('_inEventLoop'); | 1438 let _inEventLoop = Symbol('_inEventLoop'); |
| 1439 let _handle = Symbol('_handle'); | 1439 let _handle = Symbol('_handle'); |
| 1440 class TimerImpl extends core.Object { | 1440 class TimerImpl extends core.Object { |
| 1441 TimerImpl(milliseconds, callback) { | 1441 TimerImpl(milliseconds, callback) { |
| 1442 this[_once] = true; | 1442 this[_once] = true; |
| 1443 this[_inEventLoop] = false; | 1443 this[_inEventLoop] = false; |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1554 exports.leaveJsAsync = leaveJsAsync; | 1554 exports.leaveJsAsync = leaveJsAsync; |
| 1555 exports.isWorker = isWorker; | 1555 exports.isWorker = isWorker; |
| 1556 exports.startRootIsolate = startRootIsolate; | 1556 exports.startRootIsolate = startRootIsolate; |
| 1557 exports.IsolateNatives = IsolateNatives; | 1557 exports.IsolateNatives = IsolateNatives; |
| 1558 exports.RawReceivePortImpl = RawReceivePortImpl; | 1558 exports.RawReceivePortImpl = RawReceivePortImpl; |
| 1559 exports.ReceivePortImpl = ReceivePortImpl; | 1559 exports.ReceivePortImpl = ReceivePortImpl; |
| 1560 exports.TimerImpl = TimerImpl; | 1560 exports.TimerImpl = TimerImpl; |
| 1561 exports.hasTimer = hasTimer; | 1561 exports.hasTimer = hasTimer; |
| 1562 exports.CapabilityImpl = CapabilityImpl; | 1562 exports.CapabilityImpl = CapabilityImpl; |
| 1563 }); | 1563 }); |
| OLD | NEW |