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

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

Issue 1152583002: Add constructors to signatures (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 7 months 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 var BenchmarkBase = dart.defineLibrary(BenchmarkBase, {}); 1 var BenchmarkBase = dart.defineLibrary(BenchmarkBase, {});
2 var core = dart.import(core); 2 var core = dart.import(core);
3 (function(exports, core) { 3 (function(exports, core) {
4 'use strict'; 4 'use strict';
5 class Expect extends core.Object { 5 class Expect extends core.Object {
6 static equals(expected, actual) { 6 static equals(expected, actual) {
7 if (!dart.equals(expected, actual)) { 7 if (!dart.equals(expected, actual)) {
8 throw `Values not equal: ${expected} vs ${actual}`; 8 throw `Values not equal: ${expected} vs ${actual}`;
9 } 9 }
10 } 10 }
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 }).bind(this)), 2000); 66 }).bind(this)), 2000);
67 this.teardown(); 67 this.teardown();
68 return result; 68 return result;
69 } 69 }
70 report() { 70 report() {
71 let score = this.measure(); 71 let score = this.measure();
72 core.print(`${this.name}(RunTime): ${score} us.`); 72 core.print(`${this.name}(RunTime): ${score} us.`);
73 } 73 }
74 } 74 }
75 dart.setSignature(BenchmarkBase, { 75 dart.setSignature(BenchmarkBase, {
76 constructors: () => ({BenchmarkBase: [BenchmarkBase, [core.String]]}),
76 methods: () => ({ 77 methods: () => ({
77 run: [dart.void, []], 78 run: [dart.void, []],
78 warmup: [dart.void, []], 79 warmup: [dart.void, []],
79 exercise: [dart.void, []], 80 exercise: [dart.void, []],
80 setup: [dart.void, []], 81 setup: [dart.void, []],
81 teardown: [dart.void, []], 82 teardown: [dart.void, []],
82 measure: [core.double, []], 83 measure: [core.double, []],
83 report: [dart.void, []] 84 report: [dart.void, []]
84 }), 85 }),
85 statics: () => ({measureFor: [core.double, [core.Function, core.int]]}), 86 statics: () => ({measureFor: [core.double, [core.Function, core.int]]}),
86 names: ['measureFor'] 87 names: ['measureFor']
87 }); 88 });
88 // Exports: 89 // Exports:
89 exports.Expect = Expect; 90 exports.Expect = Expect;
90 exports.BenchmarkBase = BenchmarkBase; 91 exports.BenchmarkBase = BenchmarkBase;
91 })(BenchmarkBase, core); 92 })(BenchmarkBase, core);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698