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

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

Issue 12383073: Add List.insert. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use insertBefore and add is-check. Created 7 years, 9 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/array.dart ('k') | runtime/lib/growable_array.dart » ('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 Int8List { 5 patch class Int8List {
6 /* patch */ factory Int8List(int length) { 6 /* patch */ factory Int8List(int length) {
7 return new _Int8Array(length); 7 return new _Int8Array(length);
8 } 8 }
9 9
10 /* patch */ factory Int8List.transferable(int length) { 10 /* patch */ factory Int8List.transferable(int length) {
(...skipping 1992 matching lines...) Expand 10 before | Expand all | Expand 10 after
2003 void clear() { 2003 void clear() {
2004 throw new UnsupportedError( 2004 throw new UnsupportedError(
2005 "Cannot remove from a non-extendable array"); 2005 "Cannot remove from a non-extendable array");
2006 } 2006 }
2007 2007
2008 int removeLast() { 2008 int removeLast() {
2009 throw new UnsupportedError( 2009 throw new UnsupportedError(
2010 "Cannot remove from a non-extendable array"); 2010 "Cannot remove from a non-extendable array");
2011 } 2011 }
2012 2012
2013 void insert(int index, int element) {
2014 throw new UnsupportedError(
2015 "Cannot add to a non-extendable array");
2016 }
2017
2013 int removeAt(int index) { 2018 int removeAt(int index) {
2014 throw new UnsupportedError( 2019 throw new UnsupportedError(
2015 "Cannot remove from a non-extendable array"); 2020 "Cannot remove from a non-extendable array");
2016 } 2021 }
2017 2022
2018 void remove(Object element) { 2023 void remove(Object element) {
2019 throw new UnsupportedError( 2024 throw new UnsupportedError(
2020 "Cannot remove from a non-extendable array"); 2025 "Cannot remove from a non-extendable array");
2021 } 2026 }
2022 2027
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
2707 ByteArray asByteArray([int start = 0, int length]) { 2712 ByteArray asByteArray([int start = 0, int length]) {
2708 if (length == null) { 2713 if (length == null) {
2709 length = this.lengthInBytes(); 2714 length = this.lengthInBytes();
2710 } 2715 }
2711 _rangeCheck(this.length, start, length); 2716 _rangeCheck(this.length, start, length);
2712 return _array.subByteArray(_offset + start, length); 2717 return _array.subByteArray(_offset + start, length);
2713 } 2718 }
2714 2719
2715 static const int _BYTES_PER_ELEMENT = 8; 2720 static const int _BYTES_PER_ELEMENT = 8;
2716 } 2721 }
OLDNEW
« no previous file with comments | « runtime/lib/array.dart ('k') | runtime/lib/growable_array.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698