| OLD | NEW |
| 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 patch class Int8List { | 7 patch class Int8List { |
| 8 /* patch */ factory Int8List(int length) { | 8 /* patch */ factory Int8List(int length) { |
| 9 return new _Int8Array(length); | 9 return new _Int8Array(length); |
| 10 } | 10 } |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 | 221 |
| 222 static _ExternalFloat64Array _newTransferable(int length) { | 222 static _ExternalFloat64Array _newTransferable(int length) { |
| 223 return new _ExternalFloat64Array(length); | 223 return new _ExternalFloat64Array(length); |
| 224 } | 224 } |
| 225 } | 225 } |
| 226 | 226 |
| 227 | 227 |
| 228 patch class ByteData { | 228 patch class ByteData { |
| 229 /* patch */ factory ByteData(int length) { | 229 /* patch */ factory ByteData(int length) { |
| 230 var list = new _Uint8Array(length); | 230 var list = new _Uint8Array(length); |
| 231 return new _ByteDataView(list.buffer); | 231 return new _ByteDataView(list.buffer, 0, length); |
| 232 } | 232 } |
| 233 | 233 |
| 234 /* patch */ factory ByteData.transferable(int length) { | 234 /* patch */ factory ByteData.transferable(int length) { |
| 235 var list = new _Uint8Array.transferable(length); | 235 var list = new _Uint8Array.transferable(length); |
| 236 return new _ByteDataView(list.buffer); | 236 return new _ByteDataView(list.buffer, 0, length); |
| 237 } | 237 } |
| 238 | 238 |
| 239 /* patch */ factory ByteData.view(ByteBuffer buffer, | 239 /* patch */ factory ByteData.view(ByteBuffer buffer, |
| 240 [int offsetInBytes = 0, int length]) { | 240 [int offsetInBytes = 0, int length]) { |
| 241 if (length == null) { | 241 if (length == null) { |
| 242 length = buffer.lengthInBytes; | 242 length = buffer.lengthInBytes; |
| 243 } | 243 } |
| 244 return new _ByteDataView(buffer, offsetInBytes, length); | 244 return new _ByteDataView(buffer, offsetInBytes, length); |
| 245 } | 245 } |
| 246 } | 246 } |
| (...skipping 2381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2628 } | 2628 } |
| 2629 } | 2629 } |
| 2630 | 2630 |
| 2631 | 2631 |
| 2632 int _defaultIfNull(object, value) { | 2632 int _defaultIfNull(object, value) { |
| 2633 if (object == null) { | 2633 if (object == null) { |
| 2634 return value; | 2634 return value; |
| 2635 } | 2635 } |
| 2636 return object; | 2636 return object; |
| 2637 } | 2637 } |
| OLD | NEW |