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

Side by Side Diff: lib/html/frog/html_frog.dart

Issue 9969001: Typed array constructors with optional buffer offset and length. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #library('html'); 1 #library('html');
2 2
3 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 3 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
4 // for details. All rights reserved. Use of this source code is governed by a 4 // for details. All rights reserved. Use of this source code is governed by a
5 // BSD-style license that can be found in the LICENSE file. 5 // BSD-style license that can be found in the LICENSE file.
6 6
7 // DO NOT EDIT 7 // DO NOT EDIT
8 // Auto-generated dart:html library. 8 // Auto-generated dart:html library.
9 9
10 10
(...skipping 31882 matching lines...) Expand 10 before | Expand all | Expand 10 after
31893 // BSD-style license that can be found in the LICENSE file. 31893 // BSD-style license that can be found in the LICENSE file.
31894 31894
31895 class _AudioContextFactoryProvider { 31895 class _AudioContextFactoryProvider {
31896 31896
31897 factory AudioContext() native ''' 31897 factory AudioContext() native '''
31898 var constructor = window.AudioContext || window.webkitAudioContext; 31898 var constructor = window.AudioContext || window.webkitAudioContext;
31899 return new constructor(); 31899 return new constructor();
31900 '''; 31900 ''';
31901 } 31901 }
31902 31902
31903 class _PointFactoryProvider {
31904
31905 factory Point(num x, num y) native 'return new WebKitPoint(x, y);';
31906 }
31907
31908 class _WebSocketFactoryProvider {
31909
31910 factory WebSocket(String url) native '''return new WebSocket(url);''';
31911 }
31912
31913 class _TextFactoryProvider {
31914 factory Text(String data) native "return document.createTextNode(data);";
31915 }
31916 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
31917 // for details. All rights reserved. Use of this source code is governed by a
31918 // BSD-style license that can be found in the LICENSE file.
31919
31903 class _TypedArrayFactoryProvider { 31920 class _TypedArrayFactoryProvider {
31904 31921
31905 factory Float32Array(int length) => _F32(length); 31922 factory Float32Array(int length) => _F32(length);
31906 factory Float32Array.fromList(List<num> list) => _F32(ensureNative(list)); 31923 factory Float32Array.fromList(List<num> list) => _F32(ensureNative(list));
31907 factory Float32Array.fromBuffer(ArrayBuffer buffer) => _F32(buffer); 31924 factory Float32Array.fromBuffer(ArrayBuffer buffer,
31925 [int byteOffset = 0, int length]) {
31926 if (length == null) return _F32_2(buffer, byteOffset);
31927 return _F32_3(buffer, byteOffset, length);
31928 }
31908 31929
31909 factory Float64Array(int length) => _F64(length); 31930 factory Float64Array(int length) => _F64(length);
31910 factory Float64Array.fromList(List<num> list) => _F64(ensureNative(list)); 31931 factory Float64Array.fromList(List<num> list) => _F64(ensureNative(list));
31911 factory Float64Array.fromBuffer(ArrayBuffer buffer) => _F64(buffer); 31932 factory Float64Array.fromBuffer(ArrayBuffer buffer,
31933 [int byteOffset = 0, int length]) {
31934 if (length == null) return _F64_2(buffer, byteOffset);
31935 return _F64_3(buffer, byteOffset, length);
31936 }
31912 31937
31913 factory Int8Array(int length) => _I8(length); 31938 factory Int8Array(int length) => _I8(length);
31914 factory Int8Array.fromList(List<num> list) => _I8(ensureNative(list)); 31939 factory Int8Array.fromList(List<num> list) => _I8(ensureNative(list));
31915 factory Int8Array.fromBuffer(ArrayBuffer buffer) => _I8(buffer); 31940 factory Int8Array.fromBuffer(ArrayBuffer buffer,
31941 [int byteOffset = 0, int length]) {
31942 if (length == null) return _I8_2(buffer, byteOffset);
31943 return _I8_3(buffer, byteOffset, length);
31944 }
31916 31945
31917 factory Int16Array(int length) => _I16(length); 31946 factory Int16Array(int length) => _I16(length);
31918 factory Int16Array.fromList(List<num> list) => _I16(ensureNative(list)); 31947 factory Int16Array.fromList(List<num> list) => _I16(ensureNative(list));
31919 factory Int16Array.fromBuffer(ArrayBuffer buffer) => _I16(buffer); 31948 factory Int16Array.fromBuffer(ArrayBuffer buffer,
31949 [int byteOffset = 0, int length]) {
31950 if (length == null) return _I16_2(buffer, byteOffset);
31951 return _I16_3(buffer, byteOffset, length);
31952 }
31920 31953
31921 factory Int32Array(int length) => _I32(length); 31954 factory Int32Array(int length) => _I32(length);
31922 factory Int32Array.fromList(List<num> list) => _I32(ensureNative(list)); 31955 factory Int32Array.fromList(List<num> list) => _I32(ensureNative(list));
31923 factory Int32Array.fromBuffer(ArrayBuffer buffer) => _I32(buffer); 31956 factory Int32Array.fromBuffer(ArrayBuffer buffer,
31957 [int byteOffset = 0, int length]) {
31958 if (length == null) return _I32_2(buffer, byteOffset);
31959 return _I32_3(buffer, byteOffset, length);
31960 }
31924 31961
31925 factory Uint8Array(int length) => _U8(length); 31962 factory Uint8Array(int length) => _U8(length);
31926 factory Uint8Array.fromList(List<num> list) => _U8(ensureNative(list)); 31963 factory Uint8Array.fromList(List<num> list) => _U8(ensureNative(list));
31927 factory Uint8Array.fromBuffer(ArrayBuffer buffer) => _U8(buffer); 31964 factory Uint8Array.fromBuffer(ArrayBuffer buffer,
31965 [int byteOffset = 0, int length]) {
31966 if (length == null) return _U8_2(buffer, byteOffset);
31967 return _U8_3(buffer, byteOffset, length);
31968 }
31928 31969
31929 factory Uint16Array(int length) => _U16(length); 31970 factory Uint16Array(int length) => _U16(length);
31930 factory Uint16Array.fromList(List<num> list) => _U16(ensureNative(list)); 31971 factory Uint16Array.fromList(List<num> list) => _U16(ensureNative(list));
31931 factory Uint16Array.fromBuffer(ArrayBuffer buffer) => _U16(buffer); 31972 factory Uint16Array.fromBuffer(ArrayBuffer buffer,
31973 [int byteOffset = 0, int length]) {
31974 if (length == null) return _U16_2(buffer, byteOffset);
31975 return _U16_3(buffer, byteOffset, length);
31976 }
31932 31977
31933 factory Uint32Array(int length) => _U32(length); 31978 factory Uint32Array(int length) => _U32(length);
31934 factory Uint32Array.fromList(List<num> list) => _U32(ensureNative(list)); 31979 factory Uint32Array.fromList(List<num> list) => _U32(ensureNative(list));
31935 factory Uint32Array.fromBuffer(ArrayBuffer buffer) => _U32(buffer); 31980 factory Uint32Array.fromBuffer(ArrayBuffer buffer,
31981 [int byteOffset = 0, int length]) {
31982 if (length == null) return _U32_2(buffer, byteOffset);
31983 return _U32_3(buffer, byteOffset, length);
31984 }
31936 31985
31937 factory Uint8ClampedArray(int length) => _U8C(length); 31986 factory Uint8ClampedArray(int length) => _U8C(length);
31938 factory Uint8ClampedArray.fromList(List<num> list) => _U8C(ensureNative(list)) ; 31987 factory Uint8ClampedArray.fromList(List<num> list) => _U8C(ensureNative(list)) ;
31939 factory Uint8ClampedArray.fromBuffer(ArrayBuffer buffer) => _U8C(buffer); 31988 factory Uint8ClampedArray.fromBuffer(ArrayBuffer buffer,
31989 [int byteOffset = 0, int length]) {
31990 if (length == null) return _U8C_2(buffer, byteOffset);
31991 return _U8C_3(buffer, byteOffset, length);
31992 }
31940 31993
31941 static Float32Array _F32(arg) native 'return new Float32Array(arg);'; 31994 static Float32Array _F32(arg) native 'return new Float32Array(arg);';
31942 static Float64Array _F64(arg) native 'return new Float64Array(arg);'; 31995 static Float64Array _F64(arg) native 'return new Float64Array(arg);';
31943 static Int8Array _I8(arg) native 'return new Int8Array(arg);'; 31996 static Int8Array _I8(arg) native 'return new Int8Array(arg);';
31944 static Int16Array _I16(arg) native 'return new Int16Array(arg);'; 31997 static Int16Array _I16(arg) native 'return new Int16Array(arg);';
31945 static Int32Array _I32(arg) native 'return new Int32Array(arg);'; 31998 static Int32Array _I32(arg) native 'return new Int32Array(arg);';
31946 static Uint8Array _U8(arg) native 'return new Uint8Array(arg);'; 31999 static Uint8Array _U8(arg) native 'return new Uint8Array(arg);';
31947 static Uint16Array _U16(arg) native 'return new Uint16Array(arg);'; 32000 static Uint16Array _U16(arg) native 'return new Uint16Array(arg);';
31948 static Uint32Array _U32(arg) native 'return new Uint32Array(arg);'; 32001 static Uint32Array _U32(arg) native 'return new Uint32Array(arg);';
31949 static Uint8ClampedArray _U8C(arg) native 'return new Uint8ClampedArray(arg);' ; 32002 static Uint8ClampedArray _U8C(arg) native 'return new Uint8ClampedArray(arg);' ;
31950 32003
32004 static Float32Array _F32_2(arg1, arg2) native 'return new Float32Array(arg1, a rg2);';
32005 static Float64Array _F64_2(arg1, arg2) native 'return new Float64Array(arg1, a rg2);';
32006 static Int8Array _I8_2(arg1, arg2) native 'return new Int8Array(arg1, arg2);';
32007 static Int16Array _I16_2(arg1, arg2) native 'return new Int16Array(arg1, arg2) ;';
32008 static Int32Array _I32_2(arg1, arg2) native 'return new Int32Array(arg1, arg2) ;';
32009 static Uint8Array _U8_2(arg1, arg2) native 'return new Uint8Array(arg1, arg2); ';
32010 static Uint16Array _U16_2(arg1, arg2) native 'return new Uint16Array(arg1, arg 2);';
32011 static Uint32Array _U32_2(arg1, arg2) native 'return new Uint32Array(arg1, arg 2);';
32012 static Uint8ClampedArray _U8C_2(arg1, arg2) native 'return new Uint8ClampedArr ay(arg1, arg2);';
32013
32014 static Float32Array _F32_3(arg1, arg2, arg3) native 'return new Float32Array(a rg1, arg2, arg3);';
32015 static Float64Array _F64_3(arg1, arg2, arg3) native 'return new Float64Array(a rg1, arg2, arg3);';
32016 static Int8Array _I8_3(arg1, arg2, arg3) native 'return new Int8Array(arg1, ar g2, arg3);';
32017 static Int16Array _I16_3(arg1, arg2, arg3) native 'return new Int16Array(arg1, arg2, arg3);';
32018 static Int32Array _I32_3(arg1, arg2, arg3) native 'return new Int32Array(arg1, arg2, arg3);';
32019 static Uint8Array _U8_3(arg1, arg2, arg3) native 'return new Uint8Array(arg1, arg2, arg3);';
32020 static Uint16Array _U16_3(arg1, arg2, arg3) native 'return new Uint16Array(arg 1, arg2, arg3);';
32021 static Uint32Array _U32_3(arg1, arg2, arg3) native 'return new Uint32Array(arg 1, arg2, arg3);';
32022 static Uint8ClampedArray _U8C_3(arg1, arg2, arg3) native 'return new Uint8Clam pedArray(arg1, arg2, arg3);';
32023
32024
32025 // Ensures that [list] is a JavaScript Array or a typed array. If necessary,
32026 // copies the list.
31951 static ensureNative(List list) => list; // TODO: make sure. 32027 static ensureNative(List list) => list; // TODO: make sure.
31952 } 32028 }
31953 32029 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
31954 class _PointFactoryProvider {
31955
31956 factory Point(num x, num y) native 'return new WebKitPoint(x, y);';
31957 }
31958
31959 class _WebSocketFactoryProvider {
31960
31961 factory WebSocket(String url) native '''return new WebSocket(url);''';
31962 }
31963
31964 class _TextFactoryProvider {
31965 factory Text(String data) native "return document.createTextNode(data);";
31966 }// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
31967 // for details. All rights reserved. Use of this source code is governed by a 32030 // for details. All rights reserved. Use of this source code is governed by a
31968 // BSD-style license that can be found in the LICENSE file. 32031 // BSD-style license that can be found in the LICENSE file.
31969 32032
31970 // TODO(rnystrom): add a way to supress public classes from DartDoc output. 32033 // TODO(rnystrom): add a way to supress public classes from DartDoc output.
31971 // TODO(jacobr): we can remove this class now that we are using the $dom_ 32034 // TODO(jacobr): we can remove this class now that we are using the $dom_
31972 // convention for deprecated methods rather than truly private methods. 32035 // convention for deprecated methods rather than truly private methods.
31973 /** 32036 /**
31974 * This class is intended for testing purposes only. 32037 * This class is intended for testing purposes only.
31975 */ 32038 */
31976 class Testing { 32039 class Testing {
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
32097 if (length < 0) throw new IllegalArgumentException('length'); 32160 if (length < 0) throw new IllegalArgumentException('length');
32098 if (start < 0) throw new IndexOutOfRangeException(start); 32161 if (start < 0) throw new IndexOutOfRangeException(start);
32099 int end = start + length; 32162 int end = start + length;
32100 if (end > a.length) throw new IndexOutOfRangeException(end); 32163 if (end > a.length) throw new IndexOutOfRangeException(end);
32101 for (int i = start; i < end; i++) { 32164 for (int i = start; i < end; i++) {
32102 accumulator.add(a[i]); 32165 accumulator.add(a[i]);
32103 } 32166 }
32104 return accumulator; 32167 return accumulator;
32105 } 32168 }
32106 } 32169 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698