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

Unified Diff: lib/runtime/dart/_isolate_helper.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/_internal.js ('k') | lib/runtime/dart/_js_helper.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/runtime/dart/_isolate_helper.js
diff --git a/lib/runtime/dart/_isolate_helper.js b/lib/runtime/dart/_isolate_helper.js
index 5606797fd67382611b5d17a8df8eec444f770444..2dea3969717a9f9c5703b62971bdb3309effbd2d 100644
--- a/lib/runtime/dart/_isolate_helper.js
+++ b/lib/runtime/dart/_isolate_helper.js
@@ -34,8 +34,7 @@ dart_library.library('dart/_isolate_helper', null, /* Imports */[
const _id = Symbol('_id');
const _receivePort = Symbol('_receivePort');
class _Serializer extends core.Object {
- _Serializer(opts) {
- let serializeSendPorts = opts && 'serializeSendPorts' in opts ? opts.serializeSendPorts : true;
+ _Serializer({serializeSendPorts = true} = {}) {
this.serializedObjectIds = core.Map$(dart.dynamic, core.int).identity();
this[_serializeSendPorts] = dart.as(serializeSendPorts, core.bool);
}
@@ -191,8 +190,7 @@ dart_library.library('dart/_isolate_helper', null, /* Imports */[
});
const _adjustSendPorts = Symbol('_adjustSendPorts');
class _Deserializer extends core.Object {
- _Deserializer(opts) {
- let adjustSendPorts = opts && 'adjustSendPorts' in opts ? opts.adjustSendPorts : true;
+ _Deserializer({adjustSendPorts = true} = {}) {
this.deserializedObjects = core.List.new();
this[_adjustSendPorts] = dart.as(adjustSendPorts, core.bool);
}
@@ -1412,10 +1410,7 @@ dart_library.library('dart/_isolate_helper', null, /* Imports */[
this[_controller] = async.StreamController.new({onCancel: dart.bind(this, 'close'), sync: true});
this[_rawPort].handler = dart.bind(this[_controller], 'add');
}
- listen(onData, opts) {
- let onError = opts && 'onError' in opts ? opts.onError : null;
- let onDone = opts && 'onDone' in opts ? opts.onDone : null;
- let cancelOnError = opts && 'cancelOnError' in opts ? opts.cancelOnError : null;
+ listen(onData, {onError = null, onDone = null, cancelOnError = null} = {}) {
return this[_controller].stream.listen(onData, {onError: onError, onDone: onDone, cancelOnError: cancelOnError});
}
close() {
« no previous file with comments | « lib/runtime/dart/_internal.js ('k') | lib/runtime/dart/_js_helper.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698