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

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

Issue 1153003003: fixes #40, extension methods for primitive types (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 6 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 }
11 static listEquals(expected, actual) { 11 static listEquals(expected, actual) {
12 if (expected[core.$length] != actual[core.$length]) { 12 if (expected.length != actual.length) {
13 throw `Lists have different lengths: ${expected[core.$length]} vs ${actu al[core.$length]}`; 13 throw `Lists have different lengths: ${expected.length} vs ${actual.leng th}`;
14 } 14 }
15 for (let i = 0; dart.notNull(i) < dart.notNull(actual[core.$length]); i = dart.notNull(i) + 1) { 15 for (let i = 0; dart.notNull(i) < dart.notNull(actual.length); i = dart.no tNull(i) + 1) {
16 Expect.equals(expected[core.$get](i), actual[core.$get](i)); 16 Expect.equals(expected[dartx.get](i), actual[dartx.get](i));
17 } 17 }
18 } 18 }
19 fail(message) { 19 fail(message) {
20 throw message; 20 throw message;
21 } 21 }
22 } 22 }
23 dart.setSignature(Expect, { 23 dart.setSignature(Expect, {
24 methods: () => ({fail: [core.Object, [core.Object]]}), 24 methods: () => ({fail: [core.Object, [core.Object]]}),
25 statics: () => ({ 25 statics: () => ({
26 equals: [dart.void, [core.Object, core.Object]], 26 equals: [dart.void, [core.Object, core.Object]],
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 measure: [core.double, []], 83 measure: [core.double, []],
84 report: [dart.void, []] 84 report: [dart.void, []]
85 }), 85 }),
86 statics: () => ({measureFor: [core.double, [core.Function, core.int]]}), 86 statics: () => ({measureFor: [core.double, [core.Function, core.int]]}),
87 names: ['measureFor'] 87 names: ['measureFor']
88 }); 88 });
89 // Exports: 89 // Exports:
90 exports.Expect = Expect; 90 exports.Expect = Expect;
91 exports.BenchmarkBase = BenchmarkBase; 91 exports.BenchmarkBase = BenchmarkBase;
92 })(BenchmarkBase, core); 92 })(BenchmarkBase, core);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698