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

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

Issue 1233553005: Fixes #254 - Better stacktrace support (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: format fix Created 5 years, 5 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
« no previous file with comments | « lib/runtime/dart/core.js ('k') | lib/runtime/dart/js.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 dart_library.library('dart/isolate', null, /* Imports */[ 1 dart_library.library('dart/isolate', null, /* Imports */[
2 "dart_runtime/dart", 2 "dart_runtime/dart",
3 'dart/core', 3 'dart/core',
4 'dart/async' 4 'dart/async'
5 ], /* Lazy imports */[ 5 ], /* Lazy imports */[
6 'dart/_isolate_helper' 6 'dart/_isolate_helper'
7 ], function(exports, dart, core, async, _isolate_helper) { 7 ], function(exports, dart, core, async, _isolate_helper) {
8 'use strict'; 8 'use strict';
9 let dartx = dart.dartx; 9 let dartx = dart.dartx;
10 class Capability extends core.Object { 10 class Capability extends core.Object {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 } catch (e) { 46 } catch (e) {
47 let st = dart.stackTrace(e); 47 let st = dart.stackTrace(e);
48 return async.Future$(Isolate).error(e, st); 48 return async.Future$(Isolate).error(e, st);
49 } 49 }
50 50
51 } 51 }
52 static spawnUri(uri, args, message, opts) { 52 static spawnUri(uri, args, message, opts) {
53 let paused = opts && 'paused' in opts ? opts.paused : false; 53 let paused = opts && 'paused' in opts ? opts.paused : false;
54 let packageRoot = opts && 'packageRoot' in opts ? opts.packageRoot : null; 54 let packageRoot = opts && 'packageRoot' in opts ? opts.packageRoot : null;
55 if (packageRoot != null) 55 if (packageRoot != null)
56 throw new core.UnimplementedError("packageRoot"); 56 dart.throw(new core.UnimplementedError("packageRoot"));
57 try { 57 try {
58 if (dart.is(args, core.List)) { 58 if (dart.is(args, core.List)) {
59 for (let i = 0; dart.notNull(i) < dart.notNull(args[dartx.length]); i = dart.notNull(i) + 1) { 59 for (let i = 0; dart.notNull(i) < dart.notNull(args[dartx.length]); i = dart.notNull(i) + 1) {
60 if (!(typeof args[dartx.get](i) == 'string')) { 60 if (!(typeof args[dartx.get](i) == 'string')) {
61 throw new core.ArgumentError(`Args must be a list of Strings ${arg s}`); 61 dart.throw(new core.ArgumentError(`Args must be a list of Strings ${args}`));
62 } 62 }
63 } 63 }
64 } else if (args != null) { 64 } else if (args != null) {
65 throw new core.ArgumentError(`Args must be a list of Strings ${args}`) ; 65 dart.throw(new core.ArgumentError(`Args must be a list of Strings ${ar gs}`));
66 } 66 }
67 return dart.as(_isolate_helper.IsolateNatives.spawnUri(uri, args, messag e, paused).then(dart.fn(msg => new Isolate(dart.as(dart.dindex(msg, 1), SendPort ), {pauseCapability: dart.as(dart.dindex(msg, 2), Capability), terminateCapabili ty: dart.as(dart.dindex(msg, 3), Capability)}), Isolate, [dart.dynamic])), async .Future$(Isolate)); 67 return dart.as(_isolate_helper.IsolateNatives.spawnUri(uri, args, messag e, paused).then(dart.fn(msg => new Isolate(dart.as(dart.dindex(msg, 1), SendPort ), {pauseCapability: dart.as(dart.dindex(msg, 2), Capability), terminateCapabili ty: dart.as(dart.dindex(msg, 3), Capability)}), Isolate, [dart.dynamic])), async .Future$(Isolate));
68 } catch (e) { 68 } catch (e) {
69 let st = dart.stackTrace(e); 69 let st = dart.stackTrace(e);
70 return async.Future$(Isolate).error(e, st); 70 return async.Future$(Isolate).error(e, st);
71 } 71 }
72 72
73 } 73 }
74 pause(resumeCapability) { 74 pause(resumeCapability) {
75 if (resumeCapability === void 0) 75 if (resumeCapability === void 0)
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 }); 256 });
257 // Exports: 257 // Exports:
258 exports.Capability = Capability; 258 exports.Capability = Capability;
259 exports.IsolateSpawnException = IsolateSpawnException; 259 exports.IsolateSpawnException = IsolateSpawnException;
260 exports.Isolate = Isolate; 260 exports.Isolate = Isolate;
261 exports.SendPort = SendPort; 261 exports.SendPort = SendPort;
262 exports.ReceivePort = ReceivePort; 262 exports.ReceivePort = ReceivePort;
263 exports.RawReceivePort = RawReceivePort; 263 exports.RawReceivePort = RawReceivePort;
264 exports.RemoteError = RemoteError; 264 exports.RemoteError = RemoteError;
265 }); 265 });
OLDNEW
« no previous file with comments | « lib/runtime/dart/core.js ('k') | lib/runtime/dart/js.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698