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

Side by Side Diff: lib/runtime/dart/isolate.js

Issue 1145283002: Use short array syntax in method signatures (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 7 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 = dart.defineLibrary(isolate, {}); 1 var isolate = dart.defineLibrary(isolate, {});
2 var core = dart.import(core); 2 var core = dart.import(core);
3 var _isolate_helper = dart.lazyImport(_isolate_helper); 3 var _isolate_helper = dart.lazyImport(_isolate_helper);
4 var async = dart.import(async); 4 var async = dart.import(async);
5 (function(exports, core, _isolate_helper, async) { 5 (function(exports, core, _isolate_helper, async) {
6 'use strict'; 6 'use strict';
7 class Capability extends core.Object { 7 class Capability extends core.Object {
8 Capability() { 8 Capability() {
9 return new _isolate_helper.CapabilityImpl(); 9 return new _isolate_helper.CapabilityImpl();
10 } 10 }
11 } 11 }
12 dart.setSignature(Capability, {}); 12 dart.setSignature(Capability, {});
13 class IsolateSpawnException extends core.Object { 13 class IsolateSpawnException extends core.Object {
14 IsolateSpawnException(message) { 14 IsolateSpawnException(message) {
15 this.message = message; 15 this.message = message;
16 } 16 }
17 toString() { 17 toString() {
18 return `IsolateSpawnException: ${this.message}`; 18 return `IsolateSpawnException: ${this.message}`;
19 } 19 }
20 } 20 }
21 IsolateSpawnException[dart.implements] = () => [core.Exception]; 21 IsolateSpawnException[dart.implements] = () => [core.Exception];
22 dart.setSignature(IsolateSpawnException, { 22 dart.setSignature(IsolateSpawnException, {
23 methods: () => ({toString: dart.functionType(core.String, [])}) 23 methods: () => ({toString: [core.String, []]})
24 }); 24 });
25 let _pause = Symbol('_pause'); 25 let _pause = Symbol('_pause');
26 class Isolate extends core.Object { 26 class Isolate extends core.Object {
27 Isolate(controlPort, opts) { 27 Isolate(controlPort, opts) {
28 let pauseCapability = opts && 'pauseCapability' in opts ? opts.pauseCapabi lity : null; 28 let pauseCapability = opts && 'pauseCapability' in opts ? opts.pauseCapabi lity : null;
29 let terminateCapability = opts && 'terminateCapability' in opts ? opts.ter minateCapability : null; 29 let terminateCapability = opts && 'terminateCapability' in opts ? opts.ter minateCapability : null;
30 this.controlPort = controlPort; 30 this.controlPort = controlPort;
31 this.pauseCapability = pauseCapability; 31 this.pauseCapability = pauseCapability;
32 this.terminateCapability = terminateCapability; 32 this.terminateCapability = terminateCapability;
33 } 33 }
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 }).bind(this)), onCancel: dart.fn((() => { 148 }).bind(this)), onCancel: dart.fn((() => {
149 this.removeErrorListener(port.sendPort); 149 this.removeErrorListener(port.sendPort);
150 port.close(); 150 port.close();
151 port = null; 151 port = null;
152 }).bind(this))}); 152 }).bind(this))});
153 return controller.stream; 153 return controller.stream;
154 } 154 }
155 } 155 }
156 dart.setSignature(Isolate, { 156 dart.setSignature(Isolate, {
157 methods: () => ({ 157 methods: () => ({
158 pause: dart.functionType(Capability, [], [Capability]), 158 pause: [Capability, [], [Capability]],
159 [_pause]: dart.functionType(dart.void, [Capability]), 159 [_pause]: [dart.void, [Capability]],
160 resume: dart.functionType(dart.void, [Capability]), 160 resume: [dart.void, [Capability]],
161 addOnExitListener: dart.functionType(dart.void, [SendPort]), 161 addOnExitListener: [dart.void, [SendPort]],
162 removeOnExitListener: dart.functionType(dart.void, [SendPort]), 162 removeOnExitListener: [dart.void, [SendPort]],
163 setErrorsFatal: dart.functionType(dart.void, [core.bool]), 163 setErrorsFatal: [dart.void, [core.bool]],
164 kill: dart.functionType(dart.void, [], [core.int]), 164 kill: [dart.void, [], [core.int]],
165 ping: dart.functionType(dart.void, [SendPort], [core.int]), 165 ping: [dart.void, [SendPort], [core.int]],
166 addErrorListener: dart.functionType(dart.void, [SendPort]), 166 addErrorListener: [dart.void, [SendPort]],
167 removeErrorListener: dart.functionType(dart.void, [SendPort]) 167 removeErrorListener: [dart.void, [SendPort]]
168 }), 168 }),
169 statics: () => ({ 169 statics: () => ({
170 spawn: dart.functionType(async.Future$(Isolate), [dart.functionType(dart.v oid, [dart.dynamic]), dart.dynamic], {ause: core.bool}), 170 spawn: [async.Future$(Isolate), [dart.functionType(dart.void, [dart.dynami c]), dart.dynamic], {ause: core.bool}],
171 spawnUri: dart.functionType(async.Future$(Isolate), [core.Uri, core.List$( core.String), dart.dynamic], {ause: core.bool, ackageRoo: core.Uri}) 171 spawnUri: [async.Future$(Isolate), [core.Uri, core.List$(core.String), dar t.dynamic], {ause: core.bool, ackageRoo: core.Uri}]
172 }), 172 }),
173 names: ['spawn', 'spawnUri'] 173 names: ['spawn', 'spawnUri']
174 }); 174 });
175 Isolate.IMMEDIATE = 0; 175 Isolate.IMMEDIATE = 0;
176 Isolate.BEFORE_NEXT_EVENT = 1; 176 Isolate.BEFORE_NEXT_EVENT = 1;
177 Isolate.AS_EVENT = 2; 177 Isolate.AS_EVENT = 2;
178 dart.defineLazyProperties(Isolate, { 178 dart.defineLazyProperties(Isolate, {
179 get _currentIsolateCache() { 179 get _currentIsolateCache() {
180 return _isolate_helper.IsolateNatives.currentIsolate; 180 return _isolate_helper.IsolateNatives.currentIsolate;
181 } 181 }
(...skipping 25 matching lines...) Expand all
207 this.message = message; 207 this.message = message;
208 this.source = source; 208 this.source = source;
209 this.stackTrace = stackTrace; 209 this.stackTrace = stackTrace;
210 } 210 }
211 toString() { 211 toString() {
212 return 'IsolateUnhandledException: exception while handling message: ' + ` ${this.message} \n ` + `${dart.toString(this.source).replaceAll("\n", "\n ")}\ n` + 'original stack trace:\n ' + `${dart.toString(this.stackTrace).replaceAll( "\n", "\n ")}`; 212 return 'IsolateUnhandledException: exception while handling message: ' + ` ${this.message} \n ` + `${dart.toString(this.source).replaceAll("\n", "\n ")}\ n` + 'original stack trace:\n ' + `${dart.toString(this.stackTrace).replaceAll( "\n", "\n ")}`;
213 } 213 }
214 } 214 }
215 _IsolateUnhandledException[dart.implements] = () => [core.Exception]; 215 _IsolateUnhandledException[dart.implements] = () => [core.Exception];
216 dart.setSignature(_IsolateUnhandledException, { 216 dart.setSignature(_IsolateUnhandledException, {
217 methods: () => ({toString: dart.functionType(core.String, [])}) 217 methods: () => ({toString: [core.String, []]})
218 }); 218 });
219 let _description = Symbol('_description'); 219 let _description = Symbol('_description');
220 class RemoteError extends core.Object { 220 class RemoteError extends core.Object {
221 RemoteError(description, stackDescription) { 221 RemoteError(description, stackDescription) {
222 this[_description] = description; 222 this[_description] = description;
223 this.stackTrace = new _RemoteStackTrace(stackDescription); 223 this.stackTrace = new _RemoteStackTrace(stackDescription);
224 } 224 }
225 toString() { 225 toString() {
226 return this[_description]; 226 return this[_description];
227 } 227 }
228 } 228 }
229 RemoteError[dart.implements] = () => [core.Error]; 229 RemoteError[dart.implements] = () => [core.Error];
230 dart.setSignature(RemoteError, { 230 dart.setSignature(RemoteError, {
231 methods: () => ({toString: dart.functionType(core.String, [])}) 231 methods: () => ({toString: [core.String, []]})
232 }); 232 });
233 let _trace = Symbol('_trace'); 233 let _trace = Symbol('_trace');
234 class _RemoteStackTrace extends core.Object { 234 class _RemoteStackTrace extends core.Object {
235 _RemoteStackTrace(trace) { 235 _RemoteStackTrace(trace) {
236 this[_trace] = trace; 236 this[_trace] = trace;
237 } 237 }
238 toString() { 238 toString() {
239 return this[_trace]; 239 return this[_trace];
240 } 240 }
241 } 241 }
242 _RemoteStackTrace[dart.implements] = () => [core.StackTrace]; 242 _RemoteStackTrace[dart.implements] = () => [core.StackTrace];
243 dart.setSignature(_RemoteStackTrace, { 243 dart.setSignature(_RemoteStackTrace, {
244 methods: () => ({toString: dart.functionType(core.String, [])}) 244 methods: () => ({toString: [core.String, []]})
245 }); 245 });
246 // Exports: 246 // Exports:
247 exports.Capability = Capability; 247 exports.Capability = Capability;
248 exports.IsolateSpawnException = IsolateSpawnException; 248 exports.IsolateSpawnException = IsolateSpawnException;
249 exports.Isolate = Isolate; 249 exports.Isolate = Isolate;
250 exports.SendPort = SendPort; 250 exports.SendPort = SendPort;
251 exports.ReceivePort = ReceivePort; 251 exports.ReceivePort = ReceivePort;
252 exports.RawReceivePort = RawReceivePort; 252 exports.RawReceivePort = RawReceivePort;
253 exports.RemoteError = RemoteError; 253 exports.RemoteError = RemoteError;
254 })(isolate, core, _isolate_helper, async); 254 })(isolate, core, _isolate_helper, async);
OLDNEW
« no previous file with comments | « lib/runtime/dart/core.js ('k') | lib/runtime/dart/math.js » ('j') | lib/runtime/dart_runtime.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698