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

Side by Side Diff: pkg/analyzer/lib/src/generated/java_core.dart

Issue 221483002: Fix for translation of \!= to \!identical(), but use == and \!= for Enum. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
1 library java.core; 1 library java.core;
2 2
3 import "dart:math" as math; 3 import "dart:math" as math;
4 4
5 final Stopwatch nanoTimeStopwatch = new Stopwatch(); 5 final Stopwatch nanoTimeStopwatch = new Stopwatch();
6 6
7 class JavaSystem { 7 class JavaSystem {
8 static int currentTimeMillis() { 8 static int currentTimeMillis() {
9 return (new DateTime.now()).millisecondsSinceEpoch; 9 return (new DateTime.now()).millisecondsSinceEpoch;
10 } 10 }
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 } 379 }
380 380
381 bool javaBooleanOr(bool a, bool b) { 381 bool javaBooleanOr(bool a, bool b) {
382 return a || b; 382 return a || b;
383 } 383 }
384 384
385 bool javaBooleanAnd(bool a, bool b) { 385 bool javaBooleanAnd(bool a, bool b) {
386 return a && b; 386 return a && b;
387 } 387 }
388 388
389 int javaByte(Object o) {
390 return (o as int) & 0xFF;
391 }
392
389 class JavaStringBuilder { 393 class JavaStringBuilder {
390 StringBuffer sb = new StringBuffer(); 394 StringBuffer sb = new StringBuffer();
391 String toString() => sb.toString(); 395 String toString() => sb.toString();
392 JavaStringBuilder append(x) { 396 JavaStringBuilder append(x) {
393 sb.write(x); 397 sb.write(x);
394 return this; 398 return this;
395 } 399 }
396 JavaStringBuilder appendChar(int c) { 400 JavaStringBuilder appendChar(int c) {
397 sb.writeCharCode(c); 401 sb.writeCharCode(c);
398 return this; 402 return this;
(...skipping 15 matching lines...) Expand all
414 void clear() { 418 void clear() {
415 sb = new StringBuffer(); 419 sb = new StringBuffer();
416 } 420 }
417 } 421 }
418 422
419 abstract class Enum<E extends Enum> implements Comparable<E> { 423 abstract class Enum<E extends Enum> implements Comparable<E> {
420 /// The name of this enum constant, as declared in the enum declaration. 424 /// The name of this enum constant, as declared in the enum declaration.
421 final String name; 425 final String name;
422 /// The position in the enum declaration. 426 /// The position in the enum declaration.
423 final int ordinal; 427 final int ordinal;
424 Enum(this.name, this.ordinal); 428 const Enum(this.name, this.ordinal);
425 int get hashCode => ordinal; 429 int get hashCode => ordinal;
426 String toString() => name; 430 String toString() => name;
427 int compareTo(E other) => ordinal - other.ordinal; 431 int compareTo(E other) => ordinal - other.ordinal;
428 } 432 }
429 433
430 class JavaPatternMatcher { 434 class JavaPatternMatcher {
431 Iterator<Match> _matches; 435 Iterator<Match> _matches;
432 Match _match; 436 Match _match;
433 JavaPatternMatcher(RegExp re, String input) { 437 JavaPatternMatcher(RegExp re, String input) {
434 _matches = re.allMatches(input).iterator; 438 _matches = re.allMatches(input).iterator;
435 } 439 }
436 bool find() { 440 bool find() {
437 if (!_matches.moveNext()) { 441 if (!_matches.moveNext()) {
438 return false; 442 return false;
439 } 443 }
440 _match = _matches.current; 444 _match = _matches.current;
441 return true; 445 return true;
442 } 446 }
443 String group(int i) => _match[i]; 447 String group(int i) => _match[i];
444 int start() => _match.start; 448 int start() => _match.start;
445 int end() => _match.end; 449 int end() => _match.end;
446 } 450 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/instrumentation.dart ('k') | pkg/analyzer/lib/src/generated/parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698