| OLD | NEW |
| 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 class _AudioContextFactoryProvider { | 5 class _AudioContextFactoryProvider { |
| 6 factory AudioContext() => _createAudioContext(); | 6 factory AudioContext() => _createAudioContext(); |
| 7 static _createAudioContext() native "AudioContext_constructor_Callback"; | 7 static _createAudioContext() native "AudioContext_constructor_Callback"; |
| 8 } | 8 } |
| 9 | 9 |
| 10 class _IDBKeyRangeFactoryProvider { | 10 class _IDBKeyRangeFactoryProvider { |
| 11 | 11 |
| 12 factory IDBKeyRange.only(/*IDBKey*/ value) => | 12 factory IDBKeyRange.only(/*IDBKey*/ value) => |
| 13 _IDBKeyRangeImpl.only(_unwrap(value)); | 13 _IDBKeyRangeImpl.only(value); |
| 14 | 14 |
| 15 factory IDBKeyRange.lowerBound(/*IDBKey*/ bound, [bool open = false]) => | 15 factory IDBKeyRange.lowerBound(/*IDBKey*/ bound, [bool open = false]) => |
| 16 _IDBKeyRangeImpl.lowerBound(_unwrap(bound), open); | 16 _IDBKeyRangeImpl.lowerBound(bound, open); |
| 17 | 17 |
| 18 factory IDBKeyRange.upperBound(/*IDBKey*/ bound, [bool open = false]) => | 18 factory IDBKeyRange.upperBound(/*IDBKey*/ bound, [bool open = false]) => |
| 19 _IDBKeyRangeImpl.upperBound(_unwrap(bound), open); | 19 _IDBKeyRangeImpl.upperBound(bound, open); |
| 20 | 20 |
| 21 factory IDBKeyRange.bound(/*IDBKey*/ lower, /*IDBKey*/ upper, | 21 factory IDBKeyRange.bound(/*IDBKey*/ lower, /*IDBKey*/ upper, |
| 22 [bool lowerOpen = false, bool upperOpen = false]) => | 22 [bool lowerOpen = false, bool upperOpen = false]) => |
| 23 _wrap(_IDBKeyRangeImpl.bound(_unwrap(lower), _unwrap(upper), | 23 _wrap(_IDBKeyRangeImpl.bound(lower, upper, |
| 24 lowerOpen, upperOpen)); | 24 lowerOpen, upperOpen)); |
| 25 } | 25 } |
| 26 | 26 |
| 27 class _TypedArrayFactoryProvider { | 27 class _TypedArrayFactoryProvider { |
| 28 factory Float32Array(int length) => _F32(length); | 28 factory Float32Array(int length) => _F32(length); |
| 29 factory Float32Array.fromList(List<num> list) => _F32(ensureNative(list)); | 29 factory Float32Array.fromList(List<num> list) => _F32(ensureNative(list)); |
| 30 factory Float32Array.fromBuffer(ArrayBuffer buffer, | 30 factory Float32Array.fromBuffer(ArrayBuffer buffer, |
| 31 [int byteOffset = 0, int length]) => | 31 [int byteOffset = 0, int length]) => |
| 32 _F32(_unwrap(buffer), byteOffset, length); | 32 _F32(buffer, byteOffset, length); |
| 33 static _F32(_arg0, [_arg1, _arg2]) native "Float32Array_constructor_Callback"; | 33 static _F32(_arg0, [_arg1, _arg2]) native "Float32Array_constructor_Callback"; |
| 34 | 34 |
| 35 factory Float64Array(int length) => _F64(length); | 35 factory Float64Array(int length) => _F64(length); |
| 36 factory Float64Array.fromList(List<num> list) => _F64(ensureNative(list)); | 36 factory Float64Array.fromList(List<num> list) => _F64(ensureNative(list)); |
| 37 factory Float64Array.fromBuffer(ArrayBuffer buffer, | 37 factory Float64Array.fromBuffer(ArrayBuffer buffer, |
| 38 [int byteOffset = 0, int length]) => | 38 [int byteOffset = 0, int length]) => |
| 39 _F64(_unwrap(buffer), byteOffset, length); | 39 _F64(buffer, byteOffset, length); |
| 40 static _F64(_arg0, [_arg1, _arg2]) native "Float64Array_constructor_Callback"; | 40 static _F64(_arg0, [_arg1, _arg2]) native "Float64Array_constructor_Callback"; |
| 41 | 41 |
| 42 factory Int8Array(int length) => _I8(length); | 42 factory Int8Array(int length) => _I8(length); |
| 43 factory Int8Array.fromList(List<num> list) => _I8(ensureNative(list)); | 43 factory Int8Array.fromList(List<num> list) => _I8(ensureNative(list)); |
| 44 factory Int8Array.fromBuffer(ArrayBuffer buffer, | 44 factory Int8Array.fromBuffer(ArrayBuffer buffer, |
| 45 [int byteOffset = 0, int length]) => | 45 [int byteOffset = 0, int length]) => |
| 46 _I8(_unwrap(buffer), byteOffset, length); | 46 _I8(buffer, byteOffset, length); |
| 47 static _I8(_arg0, [_arg1, _arg2]) native "Int8Array_constructor_Callback"; | 47 static _I8(_arg0, [_arg1, _arg2]) native "Int8Array_constructor_Callback"; |
| 48 | 48 |
| 49 factory Int16Array(int length) => _I16(length); | 49 factory Int16Array(int length) => _I16(length); |
| 50 factory Int16Array.fromList(List<num> list) => _I16(ensureNative(list)); | 50 factory Int16Array.fromList(List<num> list) => _I16(ensureNative(list)); |
| 51 factory Int16Array.fromBuffer(ArrayBuffer buffer, | 51 factory Int16Array.fromBuffer(ArrayBuffer buffer, |
| 52 [int byteOffset = 0, int length]) => | 52 [int byteOffset = 0, int length]) => |
| 53 _I16(_unwrap(buffer), byteOffset, length); | 53 _I16(buffer, byteOffset, length); |
| 54 static _I16(_arg0, [_arg1, _arg2]) native "Int16Array_constructor_Callback"; | 54 static _I16(_arg0, [_arg1, _arg2]) native "Int16Array_constructor_Callback"; |
| 55 | 55 |
| 56 factory Int32Array(int length) => _I32(length); | 56 factory Int32Array(int length) => _I32(length); |
| 57 factory Int32Array.fromList(List<num> list) => _I32(ensureNative(list)); | 57 factory Int32Array.fromList(List<num> list) => _I32(ensureNative(list)); |
| 58 factory Int32Array.fromBuffer(ArrayBuffer buffer, | 58 factory Int32Array.fromBuffer(ArrayBuffer buffer, |
| 59 [int byteOffset = 0, int length]) => | 59 [int byteOffset = 0, int length]) => |
| 60 _I32(_unwrap(buffer), byteOffset, length); | 60 _I32(buffer, byteOffset, length); |
| 61 static _I32(_arg0, [_arg1, _arg2]) native "Int32Array_constructor_Callback"; | 61 static _I32(_arg0, [_arg1, _arg2]) native "Int32Array_constructor_Callback"; |
| 62 | 62 |
| 63 factory Uint8Array(int length) => _U8(length); | 63 factory Uint8Array(int length) => _U8(length); |
| 64 factory Uint8Array.fromList(List<num> list) => _U8(ensureNative(list)); | 64 factory Uint8Array.fromList(List<num> list) => _U8(ensureNative(list)); |
| 65 factory Uint8Array.fromBuffer(ArrayBuffer buffer, | 65 factory Uint8Array.fromBuffer(ArrayBuffer buffer, |
| 66 [int byteOffset = 0, int length]) => | 66 [int byteOffset = 0, int length]) => |
| 67 _U8(_unwrap(buffer), byteOffset, length); | 67 _U8(buffer, byteOffset, length); |
| 68 static _U8(_arg0, [_arg1, _arg2]) native "Uint8Array_constructor_Callback"; | 68 static _U8(_arg0, [_arg1, _arg2]) native "Uint8Array_constructor_Callback"; |
| 69 | 69 |
| 70 factory Uint16Array(int length) => _U16(length); | 70 factory Uint16Array(int length) => _U16(length); |
| 71 factory Uint16Array.fromList(List<num> list) => _U16(ensureNative(list)); | 71 factory Uint16Array.fromList(List<num> list) => _U16(ensureNative(list)); |
| 72 factory Uint16Array.fromBuffer(ArrayBuffer buffer, | 72 factory Uint16Array.fromBuffer(ArrayBuffer buffer, |
| 73 [int byteOffset = 0, int length]) => | 73 [int byteOffset = 0, int length]) => |
| 74 _U16(_unwrap(buffer), byteOffset, length); | 74 _U16(buffer, byteOffset, length); |
| 75 static _U16(_arg0, [_arg1, _arg2]) native "Uint16Array_constructor_Callback"; | 75 static _U16(_arg0, [_arg1, _arg2]) native "Uint16Array_constructor_Callback"; |
| 76 | 76 |
| 77 factory Uint32Array(int length) => _U32(length); | 77 factory Uint32Array(int length) => _U32(length); |
| 78 factory Uint32Array.fromList(List<num> list) => _U32(ensureNative(list)); | 78 factory Uint32Array.fromList(List<num> list) => _U32(ensureNative(list)); |
| 79 factory Uint32Array.fromBuffer(ArrayBuffer buffer, | 79 factory Uint32Array.fromBuffer(ArrayBuffer buffer, |
| 80 [int byteOffset = 0, int length]) => | 80 [int byteOffset = 0, int length]) => |
| 81 _U32(_unwrap(buffer), byteOffset, length); | 81 _U32(buffer, byteOffset, length); |
| 82 static _U32(_arg0, [_arg1, _arg2]) native "Uint32Array_constructor_Callback"; | 82 static _U32(_arg0, [_arg1, _arg2]) native "Uint32Array_constructor_Callback"; |
| 83 | 83 |
| 84 factory Uint8ClampedArray(int length) => _U8C(length); | 84 factory Uint8ClampedArray(int length) => _U8C(length); |
| 85 factory Uint8ClampedArray.fromList(List<num> list) => _U8C(ensureNative(list))
; | 85 factory Uint8ClampedArray.fromList(List<num> list) => _U8C(ensureNative(list))
; |
| 86 factory Uint8ClampedArray.fromBuffer(ArrayBuffer buffer, | 86 factory Uint8ClampedArray.fromBuffer(ArrayBuffer buffer, |
| 87 [int byteOffset = 0, int length]) => | 87 [int byteOffset = 0, int length]) => |
| 88 _U8C(_unwrap(buffer), byteOffset, length); | 88 _U8C(buffer, byteOffset, length); |
| 89 static _U8C(_arg0, [_arg1, _arg2]) native "Uint8ClampedArray_constructor_Callb
ack"; | 89 static _U8C(_arg0, [_arg1, _arg2]) native "Uint8ClampedArray_constructor_Callb
ack"; |
| 90 | 90 |
| 91 static ensureNative(List list) => list; // TODO: make sure. | 91 static ensureNative(List list) => list; // TODO: make sure. |
| 92 } | 92 } |
| 93 | 93 |
| 94 class _PointFactoryProvider { | 94 class _PointFactoryProvider { |
| 95 factory Point(num x, num y) => _createWebKitPoint(x, y); | 95 factory Point(num x, num y) => _createWebKitPoint(x, y); |
| 96 static _createWebKitPoint(num x, num y) native "WebKitPoint_constructor_Callba
ck"; | 96 static _createWebKitPoint(num x, num y) native "WebKitPoint_constructor_Callba
ck"; |
| 97 } | 97 } |
| 98 | 98 |
| 99 class _WebSocketFactoryProvider { | 99 class _WebSocketFactoryProvider { |
| 100 factory WebSocket(String url) => _createWebSocket(url); | 100 factory WebSocket(String url) => _createWebSocket(url); |
| 101 static _createWebSocket(String url) native "WebSocket_constructor_Callback"; | 101 static _createWebSocket(String url) native "WebSocket_constructor_Callback"; |
| 102 } | 102 } |
| 103 | 103 |
| 104 class _TextFactoryProvider { | 104 class _TextFactoryProvider { |
| 105 factory Text(String data) => _document.$dom_createTextNode(data); | 105 factory Text(String data) => _document.$dom_createTextNode(data); |
| 106 } | 106 } |
| OLD | NEW |