OLD | NEW |
1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 part of dart.core_patch; | 5 part of dart.core_patch; |
6 | 6 |
7 class StringMatch implements Match { | 7 class StringMatch implements Match { |
8 final int start; | 8 final int start; |
9 final String input; | 9 final String input; |
10 final String pattern; | 10 final String pattern; |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 } | 440 } |
441 | 441 |
442 List<int> get codeUnits => new CodeUnits(this); | 442 List<int> get codeUnits => new CodeUnits(this); |
443 | 443 |
444 Runes get runes => new Runes(this); | 444 Runes get runes => new Runes(this); |
445 | 445 |
446 String toLowerCase() => internalToLowerCase(this); | 446 String toLowerCase() => internalToLowerCase(this); |
447 | 447 |
448 String toUpperCase() => internalToUpperCase(this); | 448 String toUpperCase() => internalToUpperCase(this); |
449 | 449 |
450 @fletch.native external int get length; | 450 @dartino.native external int get length; |
451 } | 451 } |
452 | 452 |
453 class _OneByteString extends _StringBase { | 453 class _OneByteString extends _StringBase { |
454 factory _OneByteString(int length) => _create(length); | 454 factory _OneByteString(int length) => _create(length); |
455 | 455 |
456 @fletch.native int codeUnitAt(int index) { | 456 @dartino.native int codeUnitAt(int index) { |
457 switch (fletch.nativeError) { | 457 switch (dartino.nativeError) { |
458 case fletch.wrongArgumentType: | 458 case dartino.wrongArgumentType: |
459 throw new ArgumentError(); | 459 throw new ArgumentError(); |
460 case fletch.indexOutOfBounds: | 460 case dartino.indexOutOfBounds: |
461 throw new IndexError(index, this); | 461 throw new IndexError(index, this); |
462 } | 462 } |
463 } | 463 } |
464 | 464 |
465 @fletch.native external bool operator ==(Object other); | 465 @dartino.native external bool operator ==(Object other); |
466 | 466 |
467 int get hashCode => identityHashCode(this); | 467 int get hashCode => identityHashCode(this); |
468 | 468 |
469 @fletch.native String operator +(String other) { | 469 @dartino.native String operator +(String other) { |
470 throw new ArgumentError(other); | 470 throw new ArgumentError(other); |
471 } | 471 } |
472 | 472 |
473 @fletch.native String _substring(int start, int end) { | 473 @dartino.native String _substring(int start, int end) { |
474 switch (fletch.nativeError) { | 474 switch (dartino.nativeError) { |
475 case fletch.wrongArgumentType: | 475 case dartino.wrongArgumentType: |
476 throw new ArgumentError(); | 476 throw new ArgumentError(); |
477 case fletch.indexOutOfBounds: | 477 case dartino.indexOutOfBounds: |
478 throw new IndexError(start, this); | 478 throw new IndexError(start, this); |
479 } | 479 } |
480 } | 480 } |
481 | 481 |
482 @fletch.native external void _setContent(int offset, _StringBase content); | 482 @dartino.native external void _setContent(int offset, _StringBase content); |
483 | 483 |
484 @fletch.native void _setCodeUnitAt(int index, int char) { | 484 @dartino.native void _setCodeUnitAt(int index, int char) { |
485 switch (fletch.nativeError) { | 485 switch (dartino.nativeError) { |
486 case fletch.wrongArgumentType: | 486 case dartino.wrongArgumentType: |
487 throw new ArgumentError(); | 487 throw new ArgumentError(); |
488 case fletch.indexOutOfBounds: | 488 case dartino.indexOutOfBounds: |
489 throw new IndexError(index, this); | 489 throw new IndexError(index, this); |
490 } | 490 } |
491 } | 491 } |
492 | 492 |
493 @fletch.native external static _OneByteString _create(int length); | 493 @dartino.native external static _OneByteString _create(int length); |
494 } | 494 } |
495 | 495 |
496 class _TwoByteString extends _StringBase { | 496 class _TwoByteString extends _StringBase { |
497 factory _TwoByteString(int length) => _create(length); | 497 factory _TwoByteString(int length) => _create(length); |
498 | 498 |
499 @fletch.native int codeUnitAt(int index) { | 499 @dartino.native int codeUnitAt(int index) { |
500 switch (fletch.nativeError) { | 500 switch (dartino.nativeError) { |
501 case fletch.wrongArgumentType: | 501 case dartino.wrongArgumentType: |
502 throw new ArgumentError(); | 502 throw new ArgumentError(); |
503 case fletch.indexOutOfBounds: | 503 case dartino.indexOutOfBounds: |
504 throw new IndexError(index, this); | 504 throw new IndexError(index, this); |
505 } | 505 } |
506 } | 506 } |
507 | 507 |
508 @fletch.native external bool operator ==(Object other); | 508 @dartino.native external bool operator ==(Object other); |
509 | 509 |
510 int get hashCode => identityHashCode(this); | 510 int get hashCode => identityHashCode(this); |
511 | 511 |
512 @fletch.native String operator +(String other) { | 512 @dartino.native String operator +(String other) { |
513 throw new ArgumentError(other); | 513 throw new ArgumentError(other); |
514 } | 514 } |
515 | 515 |
516 @fletch.native String _substring(int start, int end) { | 516 @dartino.native String _substring(int start, int end) { |
517 switch (fletch.nativeError) { | 517 switch (dartino.nativeError) { |
518 case fletch.wrongArgumentType: | 518 case dartino.wrongArgumentType: |
519 throw new ArgumentError(); | 519 throw new ArgumentError(); |
520 case fletch.indexOutOfBounds: | 520 case dartino.indexOutOfBounds: |
521 throw new IndexError(start, this); | 521 throw new IndexError(start, this); |
522 } | 522 } |
523 } | 523 } |
524 | 524 |
525 @fletch.native external void _setContent(int offset, _StringBase content); | 525 @dartino.native external void _setContent(int offset, _StringBase content); |
526 | 526 |
527 @fletch.native void _setCodeUnitAt(int index, int char) { | 527 @dartino.native void _setCodeUnitAt(int index, int char) { |
528 switch (fletch.nativeError) { | 528 switch (dartino.nativeError) { |
529 case fletch.wrongArgumentType: | 529 case dartino.wrongArgumentType: |
530 throw new ArgumentError(); | 530 throw new ArgumentError(); |
531 case fletch.indexOutOfBounds: | 531 case dartino.indexOutOfBounds: |
532 throw new IndexError(index, this); | 532 throw new IndexError(index, this); |
533 } | 533 } |
534 } | 534 } |
535 | 535 |
536 @fletch.native external static _TwoByteString _create(int length); | 536 @dartino.native external static _TwoByteString _create(int length); |
537 } | 537 } |
OLD | NEW |