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

Unified Diff: test/codegen/expect/unittest.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: test/codegen/expect/unittest.js
diff --git a/test/codegen/expect/unittest.js b/test/codegen/expect/unittest.js
index b5223f0c526f1ae2b11eba8e27246f40364fbaae..c38e337c49428247ac9aa62f3740556d6bd14919 100644
--- a/test/codegen/expect/unittest.js
+++ b/test/codegen/expect/unittest.js
@@ -16,8 +16,7 @@ dart_library.library('unittest', null, /* Imports */[
return dart.dsend(dom.window, 'suite', name, body);
}
dart.fn(group, dart.void, [core.String, dart.functionType(dart.void, [])]);
- function test(name, body, opts) {
- let skip = opts && 'skip' in opts ? opts.skip : null;
+ function test(name, body, {skip = null} = {}) {
if (skip != null) {
core.print(`SKIP ${name}: ${skip}`);
return;
@@ -47,10 +46,7 @@ dart_library.library('unittest', null, /* Imports */[
constructors: () => ({TestFailure: [TestFailure, [core.String]]})
});
let ErrorFormatter = dart.typedef('ErrorFormatter', () => dart.functionType(core.String, [dart.dynamic, interfaces.Matcher, core.String, core.Map, core.bool]));
- function expect(actual, matcher, opts) {
- let reason = opts && 'reason' in opts ? opts.reason : null;
- let verbose = opts && 'verbose' in opts ? opts.verbose : false;
- let formatter = opts && 'formatter' in opts ? opts.formatter : null;
+ function expect(actual, matcher, {reason = null, verbose = false, formatter = null} = {}) {
matcher = util.wrapMatcher(matcher);
let matchState = dart.map();
try {

Powered by Google App Engine
This is Rietveld 408576698