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

Unified Diff: lib/runtime/dart/_js_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/_isolate_helper.js ('k') | lib/runtime/dart/async.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/runtime/dart/_js_helper.js
diff --git a/lib/runtime/dart/_js_helper.js b/lib/runtime/dart/_js_helper.js
index 9c0b80121381bb158fc0386fffd91314bdd693be..55fbaf9b2695a2ca638e0daa01916efa06dedad2 100644
--- a/lib/runtime/dart/_js_helper.js
+++ b/lib/runtime/dart/_js_helper.js
@@ -31,8 +31,7 @@ dart_library.library('dart/_js_helper', null, /* Imports */[
constructors: () => ({Native: [Native, [core.String]]})
});
class JsPeerInterface extends core.Object {
- JsPeerInterface(opts) {
- let name = opts && 'name' in opts ? opts.name : null;
+ JsPeerInterface({name = null} = {}) {
this.name = name;
}
}
@@ -79,9 +78,7 @@ dart_library.library('dart/_js_helper', null, /* Imports */[
toString() {
return `RegExp/${this.pattern}/`;
}
- JSSyntaxRegExp(source, opts) {
- let multiLine = opts && 'multiLine' in opts ? opts.multiLine : false;
- let caseSensitive = opts && 'caseSensitive' in opts ? opts.caseSensitive : true;
+ JSSyntaxRegExp(source, {multiLine = false, caseSensitive = true} = {}) {
this.pattern = source;
this[_nativeRegExp] = JSSyntaxRegExp.makeNative(source, multiLine, caseSensitive, false);
this[_nativeGlobalRegExp] = null;
« no previous file with comments | « lib/runtime/dart/_isolate_helper.js ('k') | lib/runtime/dart/async.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698