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

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

Issue 392043003: The dart version of typeddata library has changed to be compatible with the dart2js implementation (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 5 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/include/dart_api.h ('k') | runtime/vm/class_finalizer.cc » ('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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 classes for Int8List ..... Float64List and ByteData implementations. 5 // patch classes for Int8List ..... Float64List and ByteData implementations.
6 6
7 import "dart:_internal"; 7 import "dart:_internal";
8 import 'dart:math' show Random; 8 import 'dart:math' show Random;
9 9
10 patch class Int8List { 10 patch class Int8List {
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 int toCid, int fromCid) 531 int toCid, int fromCid)
532 native "TypedData_setRange"; 532 native "TypedData_setRange";
533 } 533 }
534 534
535 535
536 class _ByteBuffer implements ByteBuffer { 536 class _ByteBuffer implements ByteBuffer {
537 final _TypedList _data; 537 final _TypedList _data;
538 538
539 _ByteBuffer(this._data); 539 _ByteBuffer(this._data);
540 540
541 factory _ByteBuffer._New(data) => new _ByteBuffer(data);
542
541 // Forward calls to _data. 543 // Forward calls to _data.
542 int get lengthInBytes => _data.lengthInBytes; 544 int get lengthInBytes => _data.lengthInBytes;
543 int get hashCode => _data.hashCode; 545 int get hashCode => _data.hashCode;
544 bool operator==(Object other) => 546 bool operator==(Object other) =>
545 (other is _ByteBuffer) && identical(_data, other._data); 547 (other is _ByteBuffer) && identical(_data, other._data);
546 548
547 ByteData asByteData([int offsetInBytes = 0, int length]) { 549 ByteData asByteData([int offsetInBytes = 0, int length]) {
548 if (length == null) { 550 if (length == null) {
549 length = this.lengthInBytes - offsetInBytes; 551 length = this.lengthInBytes - offsetInBytes;
550 } 552 }
(...skipping 3008 matching lines...) Expand 10 before | Expand all | Expand 10 after
3559 return value; 3561 return value;
3560 } 3562 }
3561 return object; 3563 return object;
3562 } 3564 }
3563 3565
3564 3566
3565 void _throwRangeError(int index, int length) { 3567 void _throwRangeError(int index, int length) {
3566 String message = "$index must be in the range [0..$length)"; 3568 String message = "$index must be in the range [0..$length)";
3567 throw new RangeError(message); 3569 throw new RangeError(message);
3568 } 3570 }
OLDNEW
« no previous file with comments | « runtime/include/dart_api.h ('k') | runtime/vm/class_finalizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698