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

Side by Side Diff: test/codegen/expect/unittest.js

Issue 1483813002: Use const for const/final top-levels, types, symbols. (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 unified diff | Download patch
OLDNEW
1 dart_library.library('unittest', null, /* Imports */[ 1 dart_library.library('unittest', null, /* Imports */[
2 "dart/_runtime", 2 "dart/_runtime",
3 'matcher/matcher', 3 'matcher/matcher',
4 'dom/dom', 4 'dom/dom',
5 'dart/core', 5 'dart/core',
6 'dart/async', 6 'dart/async',
7 'matcher/src/interfaces', 7 'matcher/src/interfaces',
8 'matcher/src/util', 8 'matcher/src/util',
9 'matcher/src/description' 9 'matcher/src/description'
10 ], /* Lazy imports */[ 10 ], /* Lazy imports */[
(...skipping 28 matching lines...) Expand all
39 TestFailure(message) { 39 TestFailure(message) {
40 this.message = message; 40 this.message = message;
41 } 41 }
42 toString() { 42 toString() {
43 return this.message; 43 return this.message;
44 } 44 }
45 } 45 }
46 dart.setSignature(TestFailure, { 46 dart.setSignature(TestFailure, {
47 constructors: () => ({TestFailure: [TestFailure, [core.String]]}) 47 constructors: () => ({TestFailure: [TestFailure, [core.String]]})
48 }); 48 });
49 let ErrorFormatter = dart.typedef('ErrorFormatter', () => dart.functionType(co re.String, [dart.dynamic, interfaces.Matcher, core.String, core.Map, core.bool]) ); 49 const ErrorFormatter = dart.typedef('ErrorFormatter', () => dart.functionType( core.String, [dart.dynamic, interfaces.Matcher, core.String, core.Map, core.bool ]));
50 function expect(actual, matcher, opts) { 50 function expect(actual, matcher, opts) {
51 let reason = opts && 'reason' in opts ? opts.reason : null; 51 let reason = opts && 'reason' in opts ? opts.reason : null;
52 let verbose = opts && 'verbose' in opts ? opts.verbose : false; 52 let verbose = opts && 'verbose' in opts ? opts.verbose : false;
53 let formatter = opts && 'formatter' in opts ? opts.formatter : null; 53 let formatter = opts && 'formatter' in opts ? opts.formatter : null;
54 matcher = util.wrapMatcher(matcher); 54 matcher = util.wrapMatcher(matcher);
55 let matchState = dart.map(); 55 let matchState = dart.map();
56 try { 56 try {
57 if (dart.notNull(dart.as(dart.dsend(matcher, 'matches', actual, matchState ), core.bool))) 57 if (dart.notNull(dart.as(dart.dsend(matcher, 'matches', actual, matchState ), core.bool)))
58 return; 58 return;
59 } catch (e) { 59 } catch (e) {
(...skipping 27 matching lines...) Expand all
87 } 87 }
88 dart.fn(_defaultFailFormatter, core.String, [dart.dynamic, interfaces.Matcher, core.String, core.Map, core.bool]); 88 dart.fn(_defaultFailFormatter, core.String, [dart.dynamic, interfaces.Matcher, core.String, core.Map, core.bool]);
89 // Exports: 89 // Exports:
90 exports.group = group; 90 exports.group = group;
91 exports.test = test; 91 exports.test = test;
92 exports.TestFailure = TestFailure; 92 exports.TestFailure = TestFailure;
93 exports.ErrorFormatter = ErrorFormatter; 93 exports.ErrorFormatter = ErrorFormatter;
94 exports.expect = expect; 94 exports.expect = expect;
95 exports.fail = fail; 95 exports.fail = fail;
96 }); 96 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698