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

Side by Side Diff: dart/frog/leg/lib/core.dart

Issue 9146011: Nested comments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | dart/frog/leg/scanner/scanner.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 void print(var obj) { 5 void print(var obj) {
6 // TODO(ngeoffray): enable when the parser accepts it. 6 // TODO(ngeoffray): enable when the parser accepts it.
7 // obj = obj.toString(); 7 // obj = obj.toString();
8 var hasConsole = JS("bool", @"typeof console == 'object'"); 8 var hasConsole = JS("bool", @"typeof console == 'object'");
9 if (hasConsole) { 9 if (hasConsole) {
10 JS("void", @"console.log($0)", obj); 10 JS("void", @"console.log($0)", obj);
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 '>, actual:<' + actual.toString() + '> fails.'); 328 '>, actual:<' + actual.toString() + '> fails.');
329 } 329 }
330 330
331 static void fail(String message) { 331 static void fail(String message) {
332 _fail("Expect.fail('" + message + "')"); 332 _fail("Expect.fail('" + message + "')");
333 } 333 }
334 334
335 static void _fail(String message) { 335 static void _fail(String message) {
336 throw message; 336 throw message;
337 } 337 }
338
339 static void isTrue(var actual) {
340 if (actual === true) return;
341 _fail("Expect.isTrue($actual) fails.");
342 }
338 } 343 }
339 344
340 class Stopwatch { 345 class Stopwatch {
341 double startMs; 346 double startMs;
342 double elapsedMs; 347 double elapsedMs;
343 348
344 Stopwatch() { 349 Stopwatch() {
345 elapsedMs = 0.0; 350 elapsedMs = 0.0;
346 } 351 }
347 352
(...skipping 29 matching lines...) Expand all
377 } else { 382 } else {
378 return 383 return
379 JS("num", @"Math.floor($0 + (Date.now() - $1))", elapsedMs, startMs); 384 JS("num", @"Math.floor($0 + (Date.now() - $1))", elapsedMs, startMs);
380 } 385 }
381 } 386 }
382 387
383 int frequency() { 388 int frequency() {
384 return 1000; 389 return 1000;
385 } 390 }
386 } 391 }
OLDNEW
« no previous file with comments | « no previous file | dart/frog/leg/scanner/scanner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698