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

Unified Diff: runtime/lib/typed_data.dart

Issue 14383016: Move negative length checks from Dart into the native. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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 | « runtime/lib/typed_data.cc ('k') | runtime/vm/flow_graph_builder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/typed_data.dart
===================================================================
--- runtime/lib/typed_data.dart (revision 22079)
+++ runtime/lib/typed_data.dart (working copy)
@@ -579,10 +579,6 @@
// Factory constructors.
factory _Int8Array(int length) {
- if (length < 0) {
- String message = "$length must be greater than 0";
- throw new ArgumentError(message);
- }
return _new(length);
}
@@ -637,10 +633,6 @@
// Factory constructors.
factory _Uint8Array(int length) {
- if (length < 0) {
- String message = "$length must be greater than 0";
- throw new ArgumentError(message);
- }
return _new(length);
}
@@ -693,10 +685,6 @@
// Factory constructors.
factory _Uint8ClampedArray(int length) {
- if (length < 0) {
- String message = "$length must be greater than 0";
- throw new ArgumentError(message);
- }
return _new(length);
}
@@ -751,10 +739,6 @@
// Factory constructors.
factory _Int16Array(int length) {
- if (length < 0) {
- String message = "$length must be greater than 0";
- throw new ArgumentError(message);
- }
return _new(length);
}
@@ -818,10 +802,6 @@
// Factory constructors.
factory _Uint16Array(int length) {
- if (length < 0) {
- String message = "$length must be greater than 0";
- throw new ArgumentError(message);
- }
return _new(length);
}
@@ -885,10 +865,6 @@
// Factory constructors.
factory _Int32Array(int length) {
- if (length < 0) {
- String message = "$length must be greater than 0";
- throw new ArgumentError(message);
- }
return _new(length);
}
@@ -952,10 +928,6 @@
// Factory constructors.
factory _Uint32Array(int length) {
- if (length < 0) {
- String message = "$length must be greater than 0";
- throw new ArgumentError(message);
- }
return _new(length);
}
@@ -1019,10 +991,6 @@
// Factory constructors.
factory _Int64Array(int length) {
- if (length < 0) {
- String message = "$length must be greater than 0";
- throw new ArgumentError(message);
- }
return _new(length);
}
@@ -1086,10 +1054,6 @@
// Factory constructors.
factory _Uint64Array(int length) {
- if (length < 0) {
- String message = "$length must be greater than 0";
- throw new ArgumentError(message);
- }
return _new(length);
}
@@ -1153,10 +1117,6 @@
// Factory constructors.
factory _Float32Array(int length) {
- if (length < 0) {
- String message = "$length must be greater than 0";
- throw new ArgumentError(message);
- }
return _new(length);
}
@@ -1220,10 +1180,6 @@
// Factory constructors.
factory _Float64Array(int length) {
- if (length < 0) {
- String message = "$length must be greater than 0";
- throw new ArgumentError(message);
- }
return _new(length);
}
@@ -1286,10 +1242,6 @@
// Factory constructors.
factory _Float32x4Array(int length) {
- if (length < 0) {
- String message = "$length must be greater than 0";
- throw new ArgumentError(message);
- }
return _new(length);
}
@@ -1351,10 +1303,6 @@
// Factory constructors.
factory _ExternalInt8Array(int length) {
- if (length < 0) {
- String message = "$length must be greater than 0";
- throw new ArgumentError(message);
- }
return _new(length);
}
@@ -1401,10 +1349,6 @@
// Factory constructors.
factory _ExternalUint8Array(int length) {
- if (length < 0) {
- String message = "$length must be greater than 0";
- throw new ArgumentError(message);
- }
return _new(length);
}
@@ -1452,10 +1396,6 @@
// Factory constructors.
factory _ExternalUint8ClampedArray(int length) {
- if (length < 0) {
- String message = "$length must be greater than 0";
- throw new ArgumentError(message);
- }
return _new(length);
}
@@ -1503,10 +1443,6 @@
// Factory constructors.
factory _ExternalInt16Array(int length) {
- if (length < 0) {
- String message = "$length must be greater than 0";
- throw new ArgumentError(message);
- }
return _new(length);
}
@@ -1562,10 +1498,6 @@
// Factory constructors.
factory _ExternalUint16Array(int length) {
- if (length < 0) {
- String message = "$length must be greater than 0";
- throw new ArgumentError(message);
- }
return _new(length);
}
@@ -1621,10 +1553,6 @@
// Factory constructors.
factory _ExternalInt32Array(int length) {
- if (length < 0) {
- String message = "$length must be greater than 0";
- throw new ArgumentError(message);
- }
return _new(length);
}
@@ -1680,10 +1608,6 @@
// Factory constructors.
factory _ExternalUint32Array(int length) {
- if (length < 0) {
- String message = "$length must be greater than 0";
- throw new ArgumentError(message);
- }
return _new(length);
}
@@ -1739,10 +1663,6 @@
// Factory constructors.
factory _ExternalInt64Array(int length) {
- if (length < 0) {
- String message = "$length must be greater than 0";
- throw new ArgumentError(message);
- }
return _new(length);
}
@@ -1798,10 +1718,6 @@
// Factory constructors.
factory _ExternalUint64Array(int length) {
- if (length < 0) {
- String message = "$length must be greater than 0";
- throw new ArgumentError(message);
- }
return _new(length);
}
@@ -1857,10 +1773,6 @@
// Factory constructors.
factory _ExternalFloat32Array(int length) {
- if (length < 0) {
- String message = "$length must be greater than 0";
- throw new ArgumentError(message);
- }
return _new(length);
}
@@ -1916,10 +1828,6 @@
// Factory constructors.
factory _ExternalFloat64Array(int length) {
- if (length < 0) {
- String message = "$length must be greater than 0";
- throw new ArgumentError(message);
- }
return _new(length);
}
@@ -1975,10 +1883,6 @@
// Factory constructors.
factory _ExternalFloat32x4Array(int length) {
- if (length < 0) {
- String message = "$length must be greater than 0";
- throw new ArgumentError(message);
- }
return _new(length);
}
« no previous file with comments | « runtime/lib/typed_data.cc ('k') | runtime/vm/flow_graph_builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698