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

Unified Diff: sdk/lib/_internal/js_runtime/lib/native_typed_data.dart

Issue 2981483002: Use more single quotes in js_runtime (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_internal/js_runtime/lib/math_patch.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/js_runtime/lib/native_typed_data.dart
diff --git a/sdk/lib/_internal/js_runtime/lib/native_typed_data.dart b/sdk/lib/_internal/js_runtime/lib/native_typed_data.dart
index 7e660e1f23d1e6f1847a313cc87f5d3bafb96fff..adc055204b6b46ba6e35c3b09b3ab490cad67ffa 100644
--- a/sdk/lib/_internal/js_runtime/lib/native_typed_data.dart
+++ b/sdk/lib/_internal/js_runtime/lib/native_typed_data.dart
@@ -25,7 +25,7 @@ import 'dart:math' as Math;
import 'dart:typed_data';
-@Native("ArrayBuffer")
+@Native('ArrayBuffer')
class NativeByteBuffer implements ByteBuffer {
@JSName('byteLength')
final int lengthInBytes;
@@ -61,11 +61,11 @@ class NativeByteBuffer implements ByteBuffer {
}
Uint64List asUint64List([int offsetInBytes = 0, int length]) {
- throw new UnsupportedError("Uint64List not supported by dart2js.");
+ throw new UnsupportedError('Uint64List not supported by dart2js.');
}
Int64List asInt64List([int offsetInBytes = 0, int length]) {
- throw new UnsupportedError("Int64List not supported by dart2js.");
+ throw new UnsupportedError('Int64List not supported by dart2js.');
}
Int32x4List asInt32x4List([int offsetInBytes = 0, int length]) {
@@ -329,7 +329,7 @@ class NativeFloat64x2List extends Object
}
}
-@Native("ArrayBufferView")
+@Native('ArrayBufferView')
class NativeTypedData implements TypedData {
/**
* Returns the byte buffer associated with this object.
@@ -410,7 +410,7 @@ List _ensureNativeList(List list) {
return result;
}
-@Native("DataView")
+@Native('DataView')
class NativeByteData extends NativeTypedData implements ByteData {
/**
* Creates a [ByteData] of the specified length (in elements), all of
@@ -755,8 +755,8 @@ abstract class NativeTypedArray extends NativeTypedData
void _setRangeFast(
int start, int end, NativeTypedArray source, int skipCount) {
int targetLength = this.length;
- _checkPosition(start, targetLength, "start");
- _checkPosition(end, targetLength, "end");
+ _checkPosition(start, targetLength, 'start');
+ _checkPosition(end, targetLength, 'end');
if (start > end) throw new RangeError.range(start, 0, end);
int count = end - start;
@@ -818,7 +818,7 @@ abstract class NativeTypedArrayOfInt extends NativeTypedArray
}
}
-@Native("Float32Array")
+@Native('Float32Array')
class NativeFloat32List extends NativeTypedArrayOfDouble
implements Float32List {
factory NativeFloat32List(int length) => _create1(_checkLength(length));
@@ -852,7 +852,7 @@ class NativeFloat32List extends NativeTypedArrayOfDouble
JS('NativeFloat32List', 'new Float32Array(#, #, #)', arg1, arg2, arg3);
}
-@Native("Float64Array")
+@Native('Float64Array')
class NativeFloat64List extends NativeTypedArrayOfDouble
implements Float64List {
factory NativeFloat64List(int length) => _create1(_checkLength(length));
@@ -886,7 +886,7 @@ class NativeFloat64List extends NativeTypedArrayOfDouble
JS('NativeFloat64List', 'new Float64Array(#, #, #)', arg1, arg2, arg3);
}
-@Native("Int16Array")
+@Native('Int16Array')
class NativeInt16List extends NativeTypedArrayOfInt implements Int16List {
factory NativeInt16List(int length) => _create1(_checkLength(length));
@@ -924,7 +924,7 @@ class NativeInt16List extends NativeTypedArrayOfInt implements Int16List {
JS('NativeInt16List', 'new Int16Array(#, #, #)', arg1, arg2, arg3);
}
-@Native("Int32Array")
+@Native('Int32Array')
class NativeInt32List extends NativeTypedArrayOfInt implements Int32List {
factory NativeInt32List(int length) => _create1(_checkLength(length));
@@ -962,7 +962,7 @@ class NativeInt32List extends NativeTypedArrayOfInt implements Int32List {
JS('NativeInt32List', 'new Int32Array(#, #, #)', arg1, arg2, arg3);
}
-@Native("Int8Array")
+@Native('Int8Array')
class NativeInt8List extends NativeTypedArrayOfInt implements Int8List {
factory NativeInt8List(int length) => _create1(_checkLength(length));
@@ -1000,7 +1000,7 @@ class NativeInt8List extends NativeTypedArrayOfInt implements Int8List {
JS('NativeInt8List', 'new Int8Array(#, #, #)', arg1, arg2, arg3);
}
-@Native("Uint16Array")
+@Native('Uint16Array')
class NativeUint16List extends NativeTypedArrayOfInt implements Uint16List {
factory NativeUint16List(int length) => _create1(_checkLength(length));
@@ -1038,7 +1038,7 @@ class NativeUint16List extends NativeTypedArrayOfInt implements Uint16List {
JS('NativeUint16List', 'new Uint16Array(#, #, #)', arg1, arg2, arg3);
}
-@Native("Uint32Array")
+@Native('Uint32Array')
class NativeUint32List extends NativeTypedArrayOfInt implements Uint32List {
factory NativeUint32List(int length) => _create1(_checkLength(length));
@@ -1076,7 +1076,7 @@ class NativeUint32List extends NativeTypedArrayOfInt implements Uint32List {
JS('NativeUint32List', 'new Uint32Array(#, #, #)', arg1, arg2, arg3);
}
-@Native("Uint8ClampedArray,CanvasPixelArray")
+@Native('Uint8ClampedArray,CanvasPixelArray')
class NativeUint8ClampedList extends NativeTypedArrayOfInt
implements Uint8ClampedList {
factory NativeUint8ClampedList(int length) => _create1(_checkLength(length));
@@ -1126,7 +1126,7 @@ class NativeUint8ClampedList extends NativeTypedArrayOfInt
// Uint8List as !nonleaf ensures that the native dispatch correctly handles
// the potential for Uint8ClampedArray to 'accidentally' pick up the
// dispatch record for Uint8List.
-@Native("Uint8Array,!nonleaf")
+@Native('Uint8Array,!nonleaf')
class NativeUint8List extends NativeTypedArrayOfInt implements Uint8List {
factory NativeUint8List(int length) => _create1(_checkLength(length));
@@ -1398,7 +1398,7 @@ class NativeFloat32x4 implements Float32x4 {
/// Shuffle the lane values. [mask] must be one of the 256 shuffle constants.
Float32x4 shuffle(int mask) {
if ((mask < 0) || (mask > 255)) {
- throw new RangeError.range(mask, 0, 255, "mask");
+ throw new RangeError.range(mask, 0, 255, 'mask');
}
_list[0] = x;
_list[1] = y;
@@ -1417,7 +1417,7 @@ class NativeFloat32x4 implements Float32x4 {
/// Uses the same [mask] as [shuffle].
Float32x4 shuffleMix(Float32x4 other, int mask) {
if ((mask < 0) || (mask > 255)) {
- throw new RangeError.range(mask, 0, 255, "mask");
+ throw new RangeError.range(mask, 0, 255, 'mask');
}
_list[0] = x;
_list[1] = y;
@@ -1556,10 +1556,10 @@ class NativeInt32x4 implements Int32x4 {
// Dart2js uses unsigned results for bit-operations.
// We use "JS" to fall back to the signed versions.
return new NativeInt32x4._truncated(
- JS("int", "# | #", x, other.x),
- JS("int", "# | #", y, other.y),
- JS("int", "# | #", z, other.z),
- JS("int", "# | #", w, other.w));
+ JS('int', '# | #', x, other.x),
+ JS('int', '# | #', y, other.y),
+ JS('int', '# | #', z, other.z),
+ JS('int', '# | #', w, other.w));
}
/// The bit-wise and operator.
@@ -1567,10 +1567,10 @@ class NativeInt32x4 implements Int32x4 {
// Dart2js uses unsigned results for bit-operations.
// We use "JS" to fall back to the signed versions.
return new NativeInt32x4._truncated(
- JS("int", "# & #", x, other.x),
- JS("int", "# & #", y, other.y),
- JS("int", "# & #", z, other.z),
- JS("int", "# & #", w, other.w));
+ JS('int', '# & #', x, other.x),
+ JS('int', '# & #', y, other.y),
+ JS('int', '# & #', z, other.z),
+ JS('int', '# & #', w, other.w));
}
/// The bit-wise xor operator.
@@ -1578,37 +1578,37 @@ class NativeInt32x4 implements Int32x4 {
// Dart2js uses unsigned results for bit-operations.
// We use "JS" to fall back to the signed versions.
return new NativeInt32x4._truncated(
- JS("int", "# ^ #", x, other.x),
- JS("int", "# ^ #", y, other.y),
- JS("int", "# ^ #", z, other.z),
- JS("int", "# ^ #", w, other.w));
+ JS('int', '# ^ #', x, other.x),
+ JS('int', '# ^ #', y, other.y),
+ JS('int', '# ^ #', z, other.z),
+ JS('int', '# ^ #', w, other.w));
}
Int32x4 operator +(Int32x4 other) {
// Avoid going through the typed array by "| 0" the result.
return new NativeInt32x4._truncated(
- JS("int", "(# + #) | 0", x, other.x),
- JS("int", "(# + #) | 0", y, other.y),
- JS("int", "(# + #) | 0", z, other.z),
- JS("int", "(# + #) | 0", w, other.w));
+ JS('int', '(# + #) | 0', x, other.x),
+ JS('int', '(# + #) | 0', y, other.y),
+ JS('int', '(# + #) | 0', z, other.z),
+ JS('int', '(# + #) | 0', w, other.w));
}
Int32x4 operator -(Int32x4 other) {
// Avoid going through the typed array by "| 0" the result.
return new NativeInt32x4._truncated(
- JS("int", "(# - #) | 0", x, other.x),
- JS("int", "(# - #) | 0", y, other.y),
- JS("int", "(# - #) | 0", z, other.z),
- JS("int", "(# - #) | 0", w, other.w));
+ JS('int', '(# - #) | 0', x, other.x),
+ JS('int', '(# - #) | 0', y, other.y),
+ JS('int', '(# - #) | 0', z, other.z),
+ JS('int', '(# - #) | 0', w, other.w));
}
Int32x4 operator -() {
// Avoid going through the typed array by "| 0" the result.
return new NativeInt32x4._truncated(
- JS("int", "(-#) | 0", x),
- JS("int", "(-#) | 0", y),
- JS("int", "(-#) | 0", z),
- JS("int", "(-#) | 0", w));
+ JS('int', '(-#) | 0', x),
+ JS('int', '(-#) | 0', y),
+ JS('int', '(-#) | 0', z),
+ JS('int', '(-#) | 0', w));
}
/// Extract the top bit from each lane return them in the first 4 bits.
@@ -1623,7 +1623,7 @@ class NativeInt32x4 implements Int32x4 {
/// Shuffle the lane values. [mask] must be one of the 256 shuffle constants.
Int32x4 shuffle(int mask) {
if ((mask < 0) || (mask > 255)) {
- throw new RangeError.range(mask, 0, 255, "mask");
+ throw new RangeError.range(mask, 0, 255, 'mask');
}
_list[0] = x;
_list[1] = y;
@@ -1641,7 +1641,7 @@ class NativeInt32x4 implements Int32x4 {
/// Uses the same [mask] as [shuffle].
Int32x4 shuffleMix(Int32x4 other, int mask) {
if ((mask < 0) || (mask > 255)) {
- throw new RangeError.range(mask, 0, 255, "mask");
+ throw new RangeError.range(mask, 0, 255, 'mask');
}
_list[0] = x;
_list[1] = y;
« no previous file with comments | « sdk/lib/_internal/js_runtime/lib/math_patch.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698