Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #library("dart:coreimpl"); | 5 #library("dart:coreimpl"); |
| 6 | 6 |
| 7 #source("../../corelib/src/implementation/dual_pivot_quicksort.dart"); | 7 #source("../../corelib/src/implementation/dual_pivot_quicksort.dart"); |
| 8 #source("../../corelib/src/implementation/duration_implementation.dart"); | 8 #source("../../corelib/src/implementation/duration_implementation.dart"); |
| 9 #source("../../corelib/src/implementation/exceptions.dart"); | 9 #source("../../corelib/src/implementation/exceptions.dart"); |
| 10 #source("../../corelib/src/implementation/future_implementation.dart"); | 10 #source("../../corelib/src/implementation/future_implementation.dart"); |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 228 // We can't do it yet because we'd need a way to redirect the const | 228 // We can't do it yet because we'd need a way to redirect the const |
| 229 // default constructor. | 229 // default constructor. |
| 230 // TODO(jimhug): One way to resolve this is to make the const constructor | 230 // TODO(jimhug): One way to resolve this is to make the const constructor |
| 231 // very special in order for it to generate JS regex literals into the code | 231 // very special in order for it to generate JS regex literals into the code |
| 232 // and then treat the constructor as a factory. | 232 // and then treat the constructor as a factory. |
| 233 class JSSyntaxRegExp implements RegExp { | 233 class JSSyntaxRegExp implements RegExp { |
| 234 final String pattern; | 234 final String pattern; |
| 235 final bool multiLine; | 235 final bool multiLine; |
| 236 final bool ignoreCase; | 236 final bool ignoreCase; |
| 237 | 237 |
| 238 const JSSyntaxRegExp(String pattern, | 238 const JSSyntaxRegExp(String pattern, [bool multiLine, bool ignoreCase]): |
|
Jennifer Messerly
2011/11/11 02:36:01
this is an unrelated fix I noticed in co19 checked
| |
| 239 [bool multiLine = false, bool ignoreCase = false]): | 239 this._create(pattern, |
| 240 this._create(pattern, (multiLine ? 'm' : '') + (ignoreCase ? 'i' : '')); | 240 (multiLine == true ? 'm' : '') + (ignoreCase == true ? 'i' : '')); |
| 241 | 241 |
| 242 const JSSyntaxRegExp._create(String pattern, String flags) native | 242 const JSSyntaxRegExp._create(String pattern, String flags) native |
| 243 '''this.re = new RegExp(pattern, flags); | 243 '''this.re = new RegExp(pattern, flags); |
| 244 this.pattern = pattern; | 244 this.pattern = pattern; |
| 245 this.multiLine = this.re.multiline; | 245 this.multiLine = this.re.multiline; |
| 246 this.ignoreCase = this.re.ignoreCase;'''; | 246 this.ignoreCase = this.re.ignoreCase;'''; |
| 247 | 247 |
| 248 Match firstMatch(String str) native | 248 Match firstMatch(String str) native |
| 249 '''var m = this.re.exec(str); | 249 '''var m = this.re.exec(str); |
| 250 return m && new MatchImplementation( | 250 return m && new MatchImplementation( |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 406 } else if (isNaN()) { | 406 } else if (isNaN()) { |
| 407 if (other.isNaN()) { | 407 if (other.isNaN()) { |
| 408 return 0; | 408 return 0; |
| 409 } | 409 } |
| 410 return 1; | 410 return 1; |
| 411 } else { | 411 } else { |
| 412 return -1; | 412 return -1; |
| 413 } | 413 } |
| 414 } | 414 } |
| 415 } | 415 } |
| OLD | NEW |