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

Unified Diff: sdk/lib/typed_data/dart2js/typed_data_dart2js.dart

Issue 23464052: Uint8ClampedList no longer inherits from Uint8List (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/typed_data/typed_data.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/typed_data/dart2js/typed_data_dart2js.dart
diff --git a/sdk/lib/typed_data/dart2js/typed_data_dart2js.dart b/sdk/lib/typed_data/dart2js/typed_data_dart2js.dart
index 5933b2ef060271e2e97a6d159e660d7c946ee95a..022231141a4c95fc88d76deaa343051a93e6c556 100644
--- a/sdk/lib/typed_data/dart2js/typed_data_dart2js.dart
+++ b/sdk/lib/typed_data/dart2js/typed_data_dart2js.dart
@@ -563,7 +563,8 @@ class Uint32List
}
-class Uint8ClampedList extends Uint8List
+class Uint8ClampedList extends TypedData with ListMixin<int>,
+ FixedLengthListMixin<int> implements JavaScriptIndexingBehavior, List<int>
native "Uint8ClampedArray,CanvasPixelArray" {
factory Uint8ClampedList(int length) => _create1(length);
@@ -578,8 +579,7 @@ class Uint8ClampedList extends Uint8List
static const int BYTES_PER_ELEMENT = 1;
- // Use implementation from Uint8List
- // final int length;
+ int get length => JS("int", '#(#)', fetchLength, this);
int operator[](int index) {
_checkIndex(index, length);
@@ -660,6 +660,21 @@ class Uint8List
}
+class _Uint8ListSubclass extends Uint8List native "Uint8Array_bogus_subclass" {
+ // The Typed Array specification states that Uint8ClampedArray is _not_
+ // a subclass of Uint8Array and is a subclass of ArrayBufferView.
+ // However, some browsers have implemented Uint8ClampedArray as a subclass of
+ // Uint8Array. Dart follows the specification but in order for dart2js to
+ // generate correct code it needs to know that there might be a subclass of
+ // Uint8Array. See: https://codereview.chromium.org/23093027/
+
+ // Factory constructor is unused but needed since a default
+ // (generative) constructor can't be generated for a class
+ // extending a class with no generative constructor.
+ factory _Uint8ListSubclass() => null;
+}
+
+
class Int64List extends TypedData implements JavaScriptIndexingBehavior, List<int> {
factory Int64List(int length) {
throw new UnsupportedError("Int64List not supported by dart2js.");
« no previous file with comments | « no previous file | sdk/lib/typed_data/typed_data.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698