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

Side by Side Diff: runtime/lib/string_buffer_patch.dart

Issue 22685007: Implement updated method overriding rules in the vm. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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 | « runtime/lib/isolate_patch.dart ('k') | runtime/tools/create_snapshot_bin.py » ('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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 patch class StringBuffer { 5 patch class StringBuffer {
6 /** Backing store for collected UTF-16 code units. */ 6 /** Backing store for collected UTF-16 code units. */
7 Uint16List _buffer; 7 Uint16List _buffer;
8 /** Number of code units collected. */ 8 /** Number of code units collected. */
9 int _length = 0; 9 int _length = 0;
10 /** 10 /**
(...skipping 29 matching lines...) Expand all
40 if (str.isEmpty) return; 40 if (str.isEmpty) return;
41 _ensureCapacity(str.length); 41 _ensureCapacity(str.length);
42 for (int i = 0; i < str.length; i++) { 42 for (int i = 0; i < str.length; i++) {
43 int unit = str.codeUnitAt(i); 43 int unit = str.codeUnitAt(i);
44 _buffer[_length + i] = unit; 44 _buffer[_length + i] = unit;
45 _codeUnitMagnitude |= unit; 45 _codeUnitMagnitude |= unit;
46 } 46 }
47 _length += str.length; 47 _length += str.length;
48 } 48 }
49 49
50 /* patch */ writeCharCode(int charCode) { 50 /* patch */ void writeCharCode(int charCode) {
51 if (charCode <= 0xFFFF) { 51 if (charCode <= 0xFFFF) {
52 if (charCode < 0) { 52 if (charCode < 0) {
53 throw new RangeError.range(charCode, 0, 0x10FFFF); 53 throw new RangeError.range(charCode, 0, 0x10FFFF);
54 } 54 }
55 _ensureCapacity(1); 55 _ensureCapacity(1);
56 _buffer[_length++] = charCode; 56 _buffer[_length++] = charCode;
57 _codeUnitMagnitude |= charCode; 57 _codeUnitMagnitude |= charCode;
58 } else { 58 } else {
59 if (charCode > 0x10FFFF) { 59 if (charCode > 0x10FFFF) {
60 throw new RangeError.range(charCode, 0, 0x10FFFF); 60 throw new RangeError.range(charCode, 0, 0x10FFFF);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 newBuffer.setRange(0, _length, _buffer); 98 newBuffer.setRange(0, _length, _buffer);
99 _buffer = newBuffer; 99 _buffer = newBuffer;
100 } 100 }
101 101
102 /** 102 /**
103 * Create a [String] from the UFT-16 code units in buffer. 103 * Create a [String] from the UFT-16 code units in buffer.
104 */ 104 */
105 static String _create(Uint16List buffer, int length, bool isLatin1) 105 static String _create(Uint16List buffer, int length, bool isLatin1)
106 native "StringBuffer_createStringFromUint16Array"; 106 native "StringBuffer_createStringFromUint16Array";
107 } 107 }
OLDNEW
« no previous file with comments | « runtime/lib/isolate_patch.dart ('k') | runtime/tools/create_snapshot_bin.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698