 Chromium Code Reviews
 Chromium Code Reviews Issue 11230011:
  Make hasNext a getter instead of a method.  (Closed) 
  Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
    
  
    Issue 11230011:
  Make hasNext a getter instead of a method.  (Closed) 
  Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart| Index: lib/compiler/implementation/string_validator.dart | 
| diff --git a/lib/compiler/implementation/string_validator.dart b/lib/compiler/implementation/string_validator.dart | 
| index 2951f568f32714caa873d66d6bdad8897d202920..076b2b18a7faae85f67a9f6c791d86d6e64041f6 100644 | 
| --- a/lib/compiler/implementation/string_validator.dart | 
| +++ b/lib/compiler/implementation/string_validator.dart | 
| @@ -58,16 +58,16 @@ class StringValidator { | 
| // If it only have two, the string must be an empty string literal, | 
| // and end after the second quote. | 
| bool multiline = false; | 
| - if (source.hasNext() && identical(source.next(), quoteChar) && source.hasNext()) { | 
| + if (source.hasNext && identical(source.next(), quoteChar) && source.hasNext) { | 
| 
Mads Ager (google)
2012/10/22 08:12:06
Not your code, but could you reformat to keep with
 
floitsch
2012/10/24 13:02:47
https://codereview.chromium.org/11233035/
 | 
| int code = source.next(); | 
| assert(identical(code, quoteChar)); // If not, there is a bug in the parser. | 
| quoteLength = 3; | 
| // Check if a multiline string starts with a newline (CR, LF or CR+LF). | 
| - if (source.hasNext()) { | 
| + if (source.hasNext) { | 
| code = source.next(); | 
| if (identical(code, $CR)) { | 
| quoteLength += 1; | 
| - if (source.hasNext() && identical(source.next(), $LF)) { | 
| + if (source.hasNext && identical(source.next(), $LF)) { | 
| quoteLength += 1; | 
| } | 
| } else if (identical(code, $LF)) { | 
| @@ -96,13 +96,13 @@ class StringValidator { | 
| int length = 0; | 
| int index = startOffset; | 
| bool containsEscape = false; | 
| - for(Iterator<int> iter = string.iterator(); iter.hasNext(); length++) { | 
| + for(Iterator<int> iter = string.iterator(); iter.hasNext; length++) { | 
| index++; | 
| int code = iter.next(); | 
| if (identical(code, $BACKSLASH)) { | 
| if (quoting.raw) continue; | 
| containsEscape = true; | 
| - if (!iter.hasNext()) { | 
| + if (!iter.hasNext) { | 
| stringParseError("Incomplete escape sequence",token, index); | 
| return null; | 
| } | 
| @@ -110,7 +110,7 @@ class StringValidator { | 
| code = iter.next(); | 
| if (identical(code, $x)) { | 
| for (int i = 0; i < 2; i++) { | 
| - if (!iter.hasNext()) { | 
| + if (!iter.hasNext) { | 
| stringParseError("Incomplete escape sequence", token, index); | 
| return null; | 
| } |