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

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

Issue 1178523004: fixes #215, removes special case for length (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 dart.library('BenchmarkBase', null, /* Imports */[ 1 dart.library('BenchmarkBase', null, /* Imports */[
2 'dart/core' 2 'dart/core'
3 ], /* Lazy imports */[ 3 ], /* Lazy imports */[
4 ], function(exports, core) { 4 ], function(exports, core) {
5 'use strict'; 5 'use strict';
6 class Expect extends core.Object { 6 class Expect extends core.Object {
7 static equals(expected, actual) { 7 static equals(expected, actual) {
8 if (!dart.equals(expected, actual)) { 8 if (!dart.equals(expected, actual)) {
9 throw `Values not equal: ${expected} vs ${actual}`; 9 throw `Values not equal: ${expected} vs ${actual}`;
10 } 10 }
11 } 11 }
12 static listEquals(expected, actual) { 12 static listEquals(expected, actual) {
13 if (expected.length != actual.length) { 13 if (expected[dartx.length] != actual[dartx.length]) {
14 throw `Lists have different lengths: ${expected.length} vs ${actual.leng th}`; 14 throw `Lists have different lengths: ${expected[dartx.length]} vs ${actu al[dartx.length]}`;
15 } 15 }
16 for (let i = 0; dart.notNull(i) < dart.notNull(actual.length); i = dart.no tNull(i) + 1) { 16 for (let i = 0; dart.notNull(i) < dart.notNull(actual[dartx.length]); i = dart.notNull(i) + 1) {
17 Expect.equals(expected[dartx.get](i), actual[dartx.get](i)); 17 Expect.equals(expected[dartx.get](i), actual[dartx.get](i));
18 } 18 }
19 } 19 }
20 fail(message) { 20 fail(message) {
21 throw message; 21 throw message;
22 } 22 }
23 } 23 }
24 dart.setSignature(Expect, { 24 dart.setSignature(Expect, {
25 methods: () => ({fail: [core.Object, [core.Object]]}), 25 methods: () => ({fail: [core.Object, [core.Object]]}),
26 statics: () => ({ 26 statics: () => ({
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 measure: [core.double, []], 84 measure: [core.double, []],
85 report: [dart.void, []] 85 report: [dart.void, []]
86 }), 86 }),
87 statics: () => ({measureFor: [core.double, [core.Function, core.int]]}), 87 statics: () => ({measureFor: [core.double, [core.Function, core.int]]}),
88 names: ['measureFor'] 88 names: ['measureFor']
89 }); 89 });
90 // Exports: 90 // Exports:
91 exports.Expect = Expect; 91 exports.Expect = Expect;
92 exports.BenchmarkBase = BenchmarkBase; 92 exports.BenchmarkBase = BenchmarkBase;
93 }); 93 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698