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

Unified Diff: lib/runtime/dart/isolate.js

Issue 1484263002: Use destructuring assignments for named parameters (#180) (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/runtime/dart/core.js ('k') | lib/runtime/dart/js.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/runtime/dart/isolate.js
diff --git a/lib/runtime/dart/isolate.js b/lib/runtime/dart/isolate.js
index 7fbf20a752d57fcb73350161f7b84aa910c3f8b6..8891606ec4d2b2a7b4ec116c2a7d2fd66d2e7c80 100644
--- a/lib/runtime/dart/isolate.js
+++ b/lib/runtime/dart/isolate.js
@@ -29,9 +29,7 @@ dart_library.library('dart/isolate', null, /* Imports */[
});
const _pause = Symbol('_pause');
class Isolate extends core.Object {
- Isolate(controlPort, opts) {
- let pauseCapability = opts && 'pauseCapability' in opts ? opts.pauseCapability : null;
- let terminateCapability = opts && 'terminateCapability' in opts ? opts.terminateCapability : null;
+ Isolate(controlPort, {pauseCapability = null, terminateCapability = null} = {}) {
this.controlPort = controlPort;
this.pauseCapability = pauseCapability;
this.terminateCapability = terminateCapability;
@@ -39,8 +37,7 @@ dart_library.library('dart/isolate', null, /* Imports */[
static get current() {
return Isolate._currentIsolateCache;
}
- static spawn(entryPoint, message, opts) {
- let paused = opts && 'paused' in opts ? opts.paused : false;
+ static spawn(entryPoint, message, {paused = false} = {}) {
try {
return _isolate_helper.IsolateNatives.spawnFunction(entryPoint, message, paused).then(dart.fn(msg => new Isolate(dart.as(dart.dindex(msg, 1), SendPort), {pauseCapability: dart.as(dart.dindex(msg, 2), Capability), terminateCapability: dart.as(dart.dindex(msg, 3), Capability)}), Isolate, [dart.dynamic]));
} catch (e) {
@@ -49,9 +46,7 @@ dart_library.library('dart/isolate', null, /* Imports */[
}
}
- static spawnUri(uri, args, message, opts) {
- let paused = opts && 'paused' in opts ? opts.paused : false;
- let packageRoot = opts && 'packageRoot' in opts ? opts.packageRoot : null;
+ static spawnUri(uri, args, message, {paused = false, packageRoot = null} = {}) {
if (packageRoot != null)
dart.throw(new core.UnimplementedError("packageRoot"));
try {
« 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