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

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

Issue 1090313002: fixes #52, fields shadowing getters/setters or other fields (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « lib/src/codegen/js_field_storage.dart ('k') | test/codegen/expect/DeltaBlue.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 var BenchmarkBase; 1 var BenchmarkBase;
2 (function(exports) { 2 (function(exports) {
3 'use strict'; 3 'use strict';
4 class Expect extends core.Object { 4 class Expect extends core.Object {
5 static equals(expected, actual) { 5 static equals(expected, actual) {
6 if (!dart.equals(expected, actual)) { 6 if (!dart.equals(expected, actual)) {
7 throw `Values not equal: ${expected} vs ${actual}`; 7 throw `Values not equal: ${expected} vs ${actual}`;
8 } 8 }
9 } 9 }
10 static listEquals(expected, actual) { 10 static listEquals(expected, actual) {
11 if (expected[core.$length] != actual[core.$length]) { 11 if (expected[core.$length] != actual[core.$length]) {
12 throw `Lists have different lengths: ${expected[core.$length]} vs ${actu al[core.$length]}`; 12 throw `Lists have different lengths: ${expected[core.$length]} vs ${actu al[core.$length]}`;
13 } 13 }
14 for (let i = 0; dart.notNull(i) < dart.notNull(actual[core.$length]); i = dart.notNull(i) + 1) { 14 for (let i = 0; dart.notNull(i) < dart.notNull(actual[core.$length]); i = dart.notNull(i) + 1) {
15 Expect.equals(expected[core.$get](i), actual[core.$get](i)); 15 Expect.equals(expected[core.$get](i), actual[core.$get](i));
16 } 16 }
17 } 17 }
18 fail(message) { 18 fail(message) {
19 throw message; 19 throw message;
20 } 20 }
21 } 21 }
22 let name$ = Symbol('name');
22 class BenchmarkBase extends core.Object { 23 class BenchmarkBase extends core.Object {
24 get name() {
25 return this[name$];
26 }
23 BenchmarkBase(name) { 27 BenchmarkBase(name) {
24 this.name = name; 28 this[name$] = name;
25 } 29 }
26 run() {} 30 run() {}
27 warmup() { 31 warmup() {
28 this.run(); 32 this.run();
29 } 33 }
30 exercise() { 34 exercise() {
31 for (let i = 0; dart.notNull(i) < 10; i = dart.notNull(i) + 1) { 35 for (let i = 0; dart.notNull(i) < 10; i = dart.notNull(i) + 1) {
32 this.run(); 36 this.run();
33 } 37 }
34 } 38 }
(...skipping 25 matching lines...) Expand all
60 } 64 }
61 report() { 65 report() {
62 let score = this.measure(); 66 let score = this.measure();
63 core.print(`${this.name}(RunTime): ${score} us.`); 67 core.print(`${this.name}(RunTime): ${score} us.`);
64 } 68 }
65 } 69 }
66 // Exports: 70 // Exports:
67 exports.Expect = Expect; 71 exports.Expect = Expect;
68 exports.BenchmarkBase = BenchmarkBase; 72 exports.BenchmarkBase = BenchmarkBase;
69 })(BenchmarkBase || (BenchmarkBase = {})); 73 })(BenchmarkBase || (BenchmarkBase = {}));
OLDNEW
« no previous file with comments | « lib/src/codegen/js_field_storage.dart ('k') | test/codegen/expect/DeltaBlue.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698