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

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: Destructure function params directly (no more opts in most cases) Created 5 years, 1 month 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
Index: lib/runtime/dart/_js_helper.js
diff --git a/lib/runtime/dart/_js_helper.js b/lib/runtime/dart/_js_helper.js
index aaead27ed700b32b3d71a0d0f79aad3556ebc3ee..9a043a2df2462461613cf599c9cf16f87144bb06 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;

Powered by Google App Engine
This is Rietveld 408576698