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

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

Issue 1152583002: Add constructors to 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, {
13 constructors: () => ({Capability: [Capability, []]})
14 });
12 class IsolateSpawnException extends core.Object { 15 class IsolateSpawnException extends core.Object {
13 IsolateSpawnException(message) { 16 IsolateSpawnException(message) {
14 this.message = message; 17 this.message = message;
15 } 18 }
16 toString() { 19 toString() {
17 return `IsolateSpawnException: ${this.message}`; 20 return `IsolateSpawnException: ${this.message}`;
18 } 21 }
19 } 22 }
20 IsolateSpawnException[dart.implements] = () => [core.Exception]; 23 IsolateSpawnException[dart.implements] = () => [core.Exception];
24 dart.setSignature(IsolateSpawnException, {
25 constructors: () => ({IsolateSpawnException: [IsolateSpawnException, [core.S tring]]})
26 });
21 let _pause = Symbol('_pause'); 27 let _pause = Symbol('_pause');
22 class Isolate extends core.Object { 28 class Isolate extends core.Object {
23 Isolate(controlPort, opts) { 29 Isolate(controlPort, opts) {
24 let pauseCapability = opts && 'pauseCapability' in opts ? opts.pauseCapabi lity : null; 30 let pauseCapability = opts && 'pauseCapability' in opts ? opts.pauseCapabi lity : null;
25 let terminateCapability = opts && 'terminateCapability' in opts ? opts.ter minateCapability : null; 31 let terminateCapability = opts && 'terminateCapability' in opts ? opts.ter minateCapability : null;
26 this.controlPort = controlPort; 32 this.controlPort = controlPort;
27 this.pauseCapability = pauseCapability; 33 this.pauseCapability = pauseCapability;
28 this.terminateCapability = terminateCapability; 34 this.terminateCapability = terminateCapability;
29 } 35 }
30 static get current() { 36 static get current() {
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 this.addErrorListener(port.sendPort); 149 this.addErrorListener(port.sendPort);
144 }).bind(this)), onCancel: dart.fn((() => { 150 }).bind(this)), onCancel: dart.fn((() => {
145 this.removeErrorListener(port.sendPort); 151 this.removeErrorListener(port.sendPort);
146 port.close(); 152 port.close();
147 port = null; 153 port = null;
148 }).bind(this))}); 154 }).bind(this))});
149 return controller.stream; 155 return controller.stream;
150 } 156 }
151 } 157 }
152 dart.setSignature(Isolate, { 158 dart.setSignature(Isolate, {
159 constructors: () => ({Isolate: [Isolate, [SendPort], {auseCapabilit: Capabil ity, erminateCapabilit: Capability}]}),
153 methods: () => ({ 160 methods: () => ({
154 pause: [Capability, [], [Capability]], 161 pause: [Capability, [], [Capability]],
155 [_pause]: [dart.void, [Capability]], 162 [_pause]: [dart.void, [Capability]],
156 resume: [dart.void, [Capability]], 163 resume: [dart.void, [Capability]],
157 addOnExitListener: [dart.void, [SendPort]], 164 addOnExitListener: [dart.void, [SendPort]],
158 removeOnExitListener: [dart.void, [SendPort]], 165 removeOnExitListener: [dart.void, [SendPort]],
159 setErrorsFatal: [dart.void, [core.bool]], 166 setErrorsFatal: [dart.void, [core.bool]],
160 kill: [dart.void, [], [core.int]], 167 kill: [dart.void, [], [core.int]],
161 ping: [dart.void, [SendPort], [core.int]], 168 ping: [dart.void, [SendPort], [core.int]],
162 addErrorListener: [dart.void, [SendPort]], 169 addErrorListener: [dart.void, [SendPort]],
(...skipping 18 matching lines...) Expand all
181 class ReceivePort extends core.Object { 188 class ReceivePort extends core.Object {
182 ReceivePort() { 189 ReceivePort() {
183 return new _isolate_helper.ReceivePortImpl(); 190 return new _isolate_helper.ReceivePortImpl();
184 } 191 }
185 fromRawReceivePort(rawPort) { 192 fromRawReceivePort(rawPort) {
186 return new _isolate_helper.ReceivePortImpl.fromRawReceivePort(rawPort); 193 return new _isolate_helper.ReceivePortImpl.fromRawReceivePort(rawPort);
187 } 194 }
188 } 195 }
189 ReceivePort[dart.implements] = () => [async.Stream]; 196 ReceivePort[dart.implements] = () => [async.Stream];
190 dart.defineNamedConstructor(ReceivePort, 'fromRawReceivePort'); 197 dart.defineNamedConstructor(ReceivePort, 'fromRawReceivePort');
198 dart.setSignature(ReceivePort, {
199 constructors: () => ({
200 ReceivePort: [ReceivePort, []],
201 fromRawReceivePort: [ReceivePort, [RawReceivePort]]
202 })
203 });
191 class RawReceivePort extends core.Object { 204 class RawReceivePort extends core.Object {
192 RawReceivePort(handler) { 205 RawReceivePort(handler) {
193 if (handler === void 0) 206 if (handler === void 0)
194 handler = null; 207 handler = null;
195 return new _isolate_helper.RawReceivePortImpl(handler); 208 return new _isolate_helper.RawReceivePortImpl(handler);
196 } 209 }
197 } 210 }
211 dart.setSignature(RawReceivePort, {
212 constructors: () => ({RawReceivePort: [RawReceivePort, [], [dart.functionTyp e(dart.void, [dart.bottom])]]})
213 });
198 class _IsolateUnhandledException extends core.Object { 214 class _IsolateUnhandledException extends core.Object {
199 _IsolateUnhandledException(message, source, stackTrace) { 215 _IsolateUnhandledException(message, source, stackTrace) {
200 this.message = message; 216 this.message = message;
201 this.source = source; 217 this.source = source;
202 this.stackTrace = stackTrace; 218 this.stackTrace = stackTrace;
203 } 219 }
204 toString() { 220 toString() {
205 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 ")}`; 221 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 ")}`;
206 } 222 }
207 } 223 }
208 _IsolateUnhandledException[dart.implements] = () => [core.Exception]; 224 _IsolateUnhandledException[dart.implements] = () => [core.Exception];
225 dart.setSignature(_IsolateUnhandledException, {
226 constructors: () => ({_IsolateUnhandledException: [_IsolateUnhandledExceptio n, [core.Object, core.Object, core.StackTrace]]})
227 });
209 let _description = Symbol('_description'); 228 let _description = Symbol('_description');
210 class RemoteError extends core.Object { 229 class RemoteError extends core.Object {
211 RemoteError(description, stackDescription) { 230 RemoteError(description, stackDescription) {
212 this[_description] = description; 231 this[_description] = description;
213 this.stackTrace = new _RemoteStackTrace(stackDescription); 232 this.stackTrace = new _RemoteStackTrace(stackDescription);
214 } 233 }
215 toString() { 234 toString() {
216 return this[_description]; 235 return this[_description];
217 } 236 }
218 } 237 }
219 RemoteError[dart.implements] = () => [core.Error]; 238 RemoteError[dart.implements] = () => [core.Error];
239 dart.setSignature(RemoteError, {
240 constructors: () => ({RemoteError: [RemoteError, [core.String, core.String]] })
241 });
220 let _trace = Symbol('_trace'); 242 let _trace = Symbol('_trace');
221 class _RemoteStackTrace extends core.Object { 243 class _RemoteStackTrace extends core.Object {
222 _RemoteStackTrace(trace) { 244 _RemoteStackTrace(trace) {
223 this[_trace] = trace; 245 this[_trace] = trace;
224 } 246 }
225 toString() { 247 toString() {
226 return this[_trace]; 248 return this[_trace];
227 } 249 }
228 } 250 }
229 _RemoteStackTrace[dart.implements] = () => [core.StackTrace]; 251 _RemoteStackTrace[dart.implements] = () => [core.StackTrace];
252 dart.setSignature(_RemoteStackTrace, {
253 constructors: () => ({_RemoteStackTrace: [_RemoteStackTrace, [core.String]]} )
254 });
230 // Exports: 255 // Exports:
231 exports.Capability = Capability; 256 exports.Capability = Capability;
232 exports.IsolateSpawnException = IsolateSpawnException; 257 exports.IsolateSpawnException = IsolateSpawnException;
233 exports.Isolate = Isolate; 258 exports.Isolate = Isolate;
234 exports.SendPort = SendPort; 259 exports.SendPort = SendPort;
235 exports.ReceivePort = ReceivePort; 260 exports.ReceivePort = ReceivePort;
236 exports.RawReceivePort = RawReceivePort; 261 exports.RawReceivePort = RawReceivePort;
237 exports.RemoteError = RemoteError; 262 exports.RemoteError = RemoteError;
238 })(isolate, core, _isolate_helper, async); 263 })(isolate, core, _isolate_helper, async);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698