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

Side by Side Diff: sdk/lib/html/dart2js/html_dart2js.dart

Issue 11308075: Add custom annotations to some APIs for native tree shaking. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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
« no previous file with comments | « no previous file | sdk/lib/html/scripts/generator.py » ('j') | sdk/lib/html/scripts/generator.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 library html; 1 library html;
2 2
3 import 'dart:isolate'; 3 import 'dart:isolate';
4 import 'dart:json'; 4 import 'dart:json';
5 import 'dart:svg' as svg; 5 import 'dart:svg' as svg;
6 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 6 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
7 // for details. All rights reserved. Use of this source code is governed by a 7 // for details. All rights reserved. Use of this source code is governed by a
8 // BSD-style license that can be found in the LICENSE file. 8 // BSD-style license that can be found in the LICENSE file.
9 9
10 // DO NOT EDIT 10 // DO NOT EDIT
(...skipping 4909 matching lines...) Expand 10 before | Expand all | Expand 10 after
4920 if ((?imagedata_OR_sw && (imagedata_OR_sw is ImageData || imagedata_OR_sw == null)) && 4920 if ((?imagedata_OR_sw && (imagedata_OR_sw is ImageData || imagedata_OR_sw == null)) &&
4921 !?sh) { 4921 !?sh) {
4922 var imagedata_1 = _convertDartToNative_ImageData(imagedata_OR_sw); 4922 var imagedata_1 = _convertDartToNative_ImageData(imagedata_OR_sw);
4923 return _convertNativeToDart_ImageData(_createImageData_1(imagedata_1)); 4923 return _convertNativeToDart_ImageData(_createImageData_1(imagedata_1));
4924 } 4924 }
4925 if ((?imagedata_OR_sw && (imagedata_OR_sw is num || imagedata_OR_sw == null) )) { 4925 if ((?imagedata_OR_sw && (imagedata_OR_sw is num || imagedata_OR_sw == null) )) {
4926 return _convertNativeToDart_ImageData(_createImageData_2(imagedata_OR_sw, sh)); 4926 return _convertNativeToDart_ImageData(_createImageData_2(imagedata_OR_sw, sh));
4927 } 4927 }
4928 throw const Exception("Incorrect number or type of arguments"); 4928 throw const Exception("Incorrect number or type of arguments");
4929 } 4929 }
4930 @Creates('ImageData|=Object')
4930 _createImageData_1(imagedata) native "createImageData"; 4931 _createImageData_1(imagedata) native "createImageData";
4932 @Creates('ImageData|=Object')
4931 _createImageData_2(num sw, sh) native "createImageData"; 4933 _createImageData_2(num sw, sh) native "createImageData";
4932 4934
4933 /** @domName CanvasRenderingContext2D.createLinearGradient */ 4935 /** @domName CanvasRenderingContext2D.createLinearGradient */
4934 CanvasGradient createLinearGradient(num x0, num y0, num x1, num y1) native; 4936 CanvasGradient createLinearGradient(num x0, num y0, num x1, num y1) native;
4935 4937
4936 /** @domName CanvasRenderingContext2D.createPattern */ 4938 /** @domName CanvasRenderingContext2D.createPattern */
4937 CanvasPattern createPattern(canvas_OR_image, String repetitionType) native; 4939 CanvasPattern createPattern(canvas_OR_image, String repetitionType) native;
4938 4940
4939 /** @domName CanvasRenderingContext2D.createRadialGradient */ 4941 /** @domName CanvasRenderingContext2D.createRadialGradient */
4940 CanvasGradient createRadialGradient(num x0, num y0, num r0, num x1, num y1, nu m r1) native; 4942 CanvasGradient createRadialGradient(num x0, num y0, num r0, num x1, num y1, nu m r1) native;
(...skipping 10 matching lines...) Expand all
4951 /** @domName CanvasRenderingContext2D.fillRect */ 4953 /** @domName CanvasRenderingContext2D.fillRect */
4952 void fillRect(num x, num y, num width, num height) native; 4954 void fillRect(num x, num y, num width, num height) native;
4953 4955
4954 /** @domName CanvasRenderingContext2D.fillText */ 4956 /** @domName CanvasRenderingContext2D.fillText */
4955 void fillText(String text, num x, num y, [num maxWidth]) native; 4957 void fillText(String text, num x, num y, [num maxWidth]) native;
4956 4958
4957 /** @domName CanvasRenderingContext2D.getImageData */ 4959 /** @domName CanvasRenderingContext2D.getImageData */
4958 ImageData getImageData(num sx, num sy, num sw, num sh) { 4960 ImageData getImageData(num sx, num sy, num sw, num sh) {
4959 return _convertNativeToDart_ImageData(_getImageData_1(sx, sy, sw, sh)); 4961 return _convertNativeToDart_ImageData(_getImageData_1(sx, sy, sw, sh));
4960 } 4962 }
4963 @Creates('ImageData|=Object')
4961 _getImageData_1(sx, sy, sw, sh) native "getImageData"; 4964 _getImageData_1(sx, sy, sw, sh) native "getImageData";
4962 4965
4963 /** @domName CanvasRenderingContext2D.getLineDash */ 4966 /** @domName CanvasRenderingContext2D.getLineDash */
4964 List<num> getLineDash() native; 4967 List<num> getLineDash() native;
4965 4968
4966 /** @domName CanvasRenderingContext2D.isPointInPath */ 4969 /** @domName CanvasRenderingContext2D.isPointInPath */
4967 bool isPointInPath(num x, num y) native; 4970 bool isPointInPath(num x, num y) native;
4968 4971
4969 /** @domName CanvasRenderingContext2D.lineTo */ 4972 /** @domName CanvasRenderingContext2D.lineTo */
4970 void lineTo(num x, num y) native; 4973 void lineTo(num x, num y) native;
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
5050 /** @domName CanvasRenderingContext2D.transform */ 5053 /** @domName CanvasRenderingContext2D.transform */
5051 void transform(num m11, num m12, num m21, num m22, num dx, num dy) native; 5054 void transform(num m11, num m12, num m21, num m22, num dx, num dy) native;
5052 5055
5053 /** @domName CanvasRenderingContext2D.translate */ 5056 /** @domName CanvasRenderingContext2D.translate */
5054 void translate(num tx, num ty) native; 5057 void translate(num tx, num ty) native;
5055 5058
5056 /** @domName CanvasRenderingContext2D.webkitGetImageDataHD */ 5059 /** @domName CanvasRenderingContext2D.webkitGetImageDataHD */
5057 ImageData webkitGetImageDataHD(num sx, num sy, num sw, num sh) { 5060 ImageData webkitGetImageDataHD(num sx, num sy, num sw, num sh) {
5058 return _convertNativeToDart_ImageData(_webkitGetImageDataHD_1(sx, sy, sw, sh )); 5061 return _convertNativeToDart_ImageData(_webkitGetImageDataHD_1(sx, sy, sw, sh ));
5059 } 5062 }
5063 @Creates('ImageData|=Object')
5060 _webkitGetImageDataHD_1(sx, sy, sw, sh) native "webkitGetImageDataHD"; 5064 _webkitGetImageDataHD_1(sx, sy, sw, sh) native "webkitGetImageDataHD";
5061 5065
5062 /** @domName CanvasRenderingContext2D.webkitPutImageDataHD */ 5066 /** @domName CanvasRenderingContext2D.webkitPutImageDataHD */
5063 void webkitPutImageDataHD(ImageData imagedata, num dx, num dy, [num dirtyX, nu m dirtyY, num dirtyWidth, num dirtyHeight]) { 5067 void webkitPutImageDataHD(ImageData imagedata, num dx, num dy, [num dirtyX, nu m dirtyY, num dirtyWidth, num dirtyHeight]) {
5064 if (!?dirtyX && 5068 if (!?dirtyX &&
5065 !?dirtyY && 5069 !?dirtyY &&
5066 !?dirtyWidth && 5070 !?dirtyWidth &&
5067 !?dirtyHeight) { 5071 !?dirtyHeight) {
5068 var imagedata_1 = _convertDartToNative_ImageData(imagedata); 5072 var imagedata_1 = _convertDartToNative_ImageData(imagedata);
5069 _webkitPutImageDataHD_1(imagedata_1, dx, dy); 5073 _webkitPutImageDataHD_1(imagedata_1, dx, dy);
(...skipping 1708 matching lines...) Expand 10 before | Expand all | Expand 10 after
6778 6782
6779 class DocumentFragment extends Node native "*DocumentFragment" { 6783 class DocumentFragment extends Node native "*DocumentFragment" {
6780 factory DocumentFragment() => _DocumentFragmentFactoryProvider.createDocumentF ragment(); 6784 factory DocumentFragment() => _DocumentFragmentFactoryProvider.createDocumentF ragment();
6781 6785
6782 factory DocumentFragment.html(String html) => 6786 factory DocumentFragment.html(String html) =>
6783 _DocumentFragmentFactoryProvider.createDocumentFragment_html(html); 6787 _DocumentFragmentFactoryProvider.createDocumentFragment_html(html);
6784 6788
6785 factory DocumentFragment.svg(String svgContent) => 6789 factory DocumentFragment.svg(String svgContent) =>
6786 new _DocumentFragmentFactoryProvider.createDocumentFragment_svg(svgContent ); 6790 new _DocumentFragmentFactoryProvider.createDocumentFragment_svg(svgContent );
6787 6791
6792 // This is a field of a native object, but used only from Dart code, so does
6793 // not instantiate any native classes.
6794 @Creates('Null')
6788 List<Element> _elements; 6795 List<Element> _elements;
6789 6796
6790 List<Element> get elements { 6797 List<Element> get elements {
6791 if (_elements == null) { 6798 if (_elements == null) {
6792 _elements = new FilteredElementList(this); 6799 _elements = new FilteredElementList(this);
6793 } 6800 }
6794 return _elements; 6801 return _elements;
6795 } 6802 }
6796 6803
6797 // TODO: The type of value should be Collection<Element>. See http://b/5392897 6804 // TODO: The type of value should be Collection<Element>. See http://b/5392897
(...skipping 1958 matching lines...) Expand 10 before | Expand all | Expand 10 after
8756 8763
8757 static const int LOADING = 1; 8764 static const int LOADING = 1;
8758 8765
8759 /** @domName FileReader.error */ 8766 /** @domName FileReader.error */
8760 final FileError error; 8767 final FileError error;
8761 8768
8762 /** @domName FileReader.readyState */ 8769 /** @domName FileReader.readyState */
8763 final int readyState; 8770 final int readyState;
8764 8771
8765 /** @domName FileReader.result */ 8772 /** @domName FileReader.result */
8773 @Creates('String|ArrayBuffer|Null')
8766 final Object result; 8774 final Object result;
8767 8775
8768 /** @domName FileReader.abort */ 8776 /** @domName FileReader.abort */
8769 void abort() native; 8777 void abort() native;
8770 8778
8771 /** @domName FileReader.addEventListener */ 8779 /** @domName FileReader.addEventListener */
8772 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native "addEventListener"; 8780 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native "addEventListener";
8773 8781
8774 /** @domName FileReader.dispatchEvent */ 8782 /** @domName FileReader.dispatchEvent */
8775 bool $dom_dispatchEvent(Event evt) native "dispatchEvent"; 8783 bool $dom_dispatchEvent(Event evt) native "dispatchEvent";
(...skipping 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after
9820 static const int LOADING = 3; 9828 static const int LOADING = 3;
9821 9829
9822 static const int OPENED = 1; 9830 static const int OPENED = 1;
9823 9831
9824 static const int UNSENT = 0; 9832 static const int UNSENT = 0;
9825 9833
9826 /** @domName XMLHttpRequest.readyState */ 9834 /** @domName XMLHttpRequest.readyState */
9827 final int readyState; 9835 final int readyState;
9828 9836
9829 /** @domName XMLHttpRequest.response */ 9837 /** @domName XMLHttpRequest.response */
9838 @Creates('ArrayBuffer|Blob|Document|=Object|=List|String|num')
9830 final Object response; 9839 final Object response;
9831 9840
9832 /** @domName XMLHttpRequest.responseText */ 9841 /** @domName XMLHttpRequest.responseText */
9833 final String responseText; 9842 final String responseText;
9834 9843
9835 /** @domName XMLHttpRequest.responseType */ 9844 /** @domName XMLHttpRequest.responseType */
9836 String responseType; 9845 String responseType;
9837 9846
9838 /** @domName XMLHttpRequest.responseXML */ 9847 /** @domName XMLHttpRequest.responseXML */
9839 final Document responseXML; 9848 final Document responseXML;
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
9997 static const int NEXT_NO_DUPLICATE = 1; 10006 static const int NEXT_NO_DUPLICATE = 1;
9998 10007
9999 static const int PREV = 2; 10008 static const int PREV = 2;
10000 10009
10001 static const int PREV_NO_DUPLICATE = 3; 10010 static const int PREV_NO_DUPLICATE = 3;
10002 10011
10003 /** @domName IDBCursor.direction */ 10012 /** @domName IDBCursor.direction */
10004 final String direction; 10013 final String direction;
10005 10014
10006 /** @domName IDBCursor.key */ 10015 /** @domName IDBCursor.key */
10016 @annotation_Creates_IDBKey @annotation_Returns_IDBKey
10007 final Object key; 10017 final Object key;
10008 10018
10009 /** @domName IDBCursor.primaryKey */ 10019 /** @domName IDBCursor.primaryKey */
10010 final Object primaryKey; 10020 final Object primaryKey;
10011 10021
10012 /** @domName IDBCursor.source */ 10022 /** @domName IDBCursor.source */
10013 final dynamic source; 10023 final dynamic source;
10014 10024
10015 /** @domName IDBCursor.advance */ 10025 /** @domName IDBCursor.advance */
10016 void advance(int count) native; 10026 void advance(int count) native;
(...skipping 23 matching lines...) Expand all
10040 } 10050 }
10041 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 10051 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
10042 // for details. All rights reserved. Use of this source code is governed by a 10052 // for details. All rights reserved. Use of this source code is governed by a
10043 // BSD-style license that can be found in the LICENSE file. 10053 // BSD-style license that can be found in the LICENSE file.
10044 10054
10045 10055
10046 /// @domName IDBCursorWithValue 10056 /// @domName IDBCursorWithValue
10047 class IDBCursorWithValue extends IDBCursor native "*IDBCursorWithValue" { 10057 class IDBCursorWithValue extends IDBCursor native "*IDBCursorWithValue" {
10048 10058
10049 /** @domName IDBCursorWithValue.value */ 10059 /** @domName IDBCursorWithValue.value */
10060 @annotation_Creates_SerializedScriptValue @annotation_Returns_SerializedScript Value
10050 final Object value; 10061 final Object value;
10051 } 10062 }
10052 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 10063 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
10053 // for details. All rights reserved. Use of this source code is governed by a 10064 // for details. All rights reserved. Use of this source code is governed by a
10054 // BSD-style license that can be found in the LICENSE file. 10065 // BSD-style license that can be found in the LICENSE file.
10055 10066
10056 10067
10057 class IDBDatabase extends EventTarget native "*IDBDatabase" { 10068 class IDBDatabase extends EventTarget native "*IDBDatabase" {
10058 10069
10059 IDBTransaction transaction(storeName_OR_storeNames, String mode) { 10070 IDBTransaction transaction(storeName_OR_storeNames, String mode) {
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
10215 var first_1 = _convertDartToNative_IDBKey(first); 10226 var first_1 = _convertDartToNative_IDBKey(first);
10216 var second_2 = _convertDartToNative_IDBKey(second); 10227 var second_2 = _convertDartToNative_IDBKey(second);
10217 return _cmp_1(first_1, second_2); 10228 return _cmp_1(first_1, second_2);
10218 } 10229 }
10219 int _cmp_1(first, second) native "cmp"; 10230 int _cmp_1(first, second) native "cmp";
10220 10231
10221 /** @domName IDBFactory.deleteDatabase */ 10232 /** @domName IDBFactory.deleteDatabase */
10222 IDBVersionChangeRequest deleteDatabase(String name) native; 10233 IDBVersionChangeRequest deleteDatabase(String name) native;
10223 10234
10224 /** @domName IDBFactory.open */ 10235 /** @domName IDBFactory.open */
10236 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBDatabase')
10225 IDBOpenDBRequest open(String name, [int version]) native; 10237 IDBOpenDBRequest open(String name, [int version]) native;
10226 10238
10227 /** @domName IDBFactory.webkitGetDatabaseNames */ 10239 /** @domName IDBFactory.webkitGetDatabaseNames */
10228 IDBRequest webkitGetDatabaseNames() native; 10240 IDBRequest webkitGetDatabaseNames() native;
10229 } 10241 }
10230 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 10242 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
10231 // for details. All rights reserved. Use of this source code is governed by a 10243 // for details. All rights reserved. Use of this source code is governed by a
10232 // BSD-style license that can be found in the LICENSE file. 10244 // BSD-style license that can be found in the LICENSE file.
10233 10245
10234 10246
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
10272 IDBRequest get(key) { 10284 IDBRequest get(key) {
10273 if ((?key && (key is IDBKeyRange || key == null))) { 10285 if ((?key && (key is IDBKeyRange || key == null))) {
10274 return _get_1(key); 10286 return _get_1(key);
10275 } 10287 }
10276 if (?key) { 10288 if (?key) {
10277 var key_1 = _convertDartToNative_IDBKey(key); 10289 var key_1 = _convertDartToNative_IDBKey(key);
10278 return _get_2(key_1); 10290 return _get_2(key_1);
10279 } 10291 }
10280 throw const Exception("Incorrect number or type of arguments"); 10292 throw const Exception("Incorrect number or type of arguments");
10281 } 10293 }
10294 @Returns('IDBRequest') @Creates('IDBRequest') @annotation_Creates_SerializedSc riptValue
10282 IDBRequest _get_1(IDBKeyRange key) native "get"; 10295 IDBRequest _get_1(IDBKeyRange key) native "get";
10296 @Returns('IDBRequest') @Creates('IDBRequest') @annotation_Creates_SerializedSc riptValue
10283 IDBRequest _get_2(key) native "get"; 10297 IDBRequest _get_2(key) native "get";
10284 10298
10285 /** @domName IDBIndex.getKey */ 10299 /** @domName IDBIndex.getKey */
10286 IDBRequest getKey(key) { 10300 IDBRequest getKey(key) {
10287 if ((?key && (key is IDBKeyRange || key == null))) { 10301 if ((?key && (key is IDBKeyRange || key == null))) {
10288 return _getKey_1(key); 10302 return _getKey_1(key);
10289 } 10303 }
10290 if (?key) { 10304 if (?key) {
10291 var key_1 = _convertDartToNative_IDBKey(key); 10305 var key_1 = _convertDartToNative_IDBKey(key);
10292 return _getKey_2(key_1); 10306 return _getKey_2(key_1);
10293 } 10307 }
10294 throw const Exception("Incorrect number or type of arguments"); 10308 throw const Exception("Incorrect number or type of arguments");
10295 } 10309 }
10310 @Returns('IDBRequest') @Creates('IDBRequest') @annotation_Creates_SerializedSc riptValue @Creates('IDBObjectStore')
10296 IDBRequest _getKey_1(IDBKeyRange key) native "getKey"; 10311 IDBRequest _getKey_1(IDBKeyRange key) native "getKey";
10312 @Returns('IDBRequest') @Creates('IDBRequest') @annotation_Creates_SerializedSc riptValue @Creates('IDBObjectStore')
10297 IDBRequest _getKey_2(key) native "getKey"; 10313 IDBRequest _getKey_2(key) native "getKey";
10298 10314
10299 /** @domName IDBIndex.openCursor */ 10315 /** @domName IDBIndex.openCursor */
10300 IDBRequest openCursor([key_OR_range, String direction]) { 10316 IDBRequest openCursor([key_OR_range, String direction]) {
10301 if (!?key_OR_range && 10317 if (!?key_OR_range &&
10302 !?direction) { 10318 !?direction) {
10303 return _openCursor_1(); 10319 return _openCursor_1();
10304 } 10320 }
10305 if ((?key_OR_range && (key_OR_range is IDBKeyRange || key_OR_range == null)) && 10321 if ((?key_OR_range && (key_OR_range is IDBKeyRange || key_OR_range == null)) &&
10306 !?direction) { 10322 !?direction) {
10307 return _openCursor_2(key_OR_range); 10323 return _openCursor_2(key_OR_range);
10308 } 10324 }
10309 if ((?key_OR_range && (key_OR_range is IDBKeyRange || key_OR_range == null)) ) { 10325 if ((?key_OR_range && (key_OR_range is IDBKeyRange || key_OR_range == null)) ) {
10310 return _openCursor_3(key_OR_range, direction); 10326 return _openCursor_3(key_OR_range, direction);
10311 } 10327 }
10312 if (?key_OR_range && 10328 if (?key_OR_range &&
10313 !?direction) { 10329 !?direction) {
10314 var key_1 = _convertDartToNative_IDBKey(key_OR_range); 10330 var key_1 = _convertDartToNative_IDBKey(key_OR_range);
10315 return _openCursor_4(key_1); 10331 return _openCursor_4(key_1);
10316 } 10332 }
10317 if (?key_OR_range) { 10333 if (?key_OR_range) {
10318 var key_2 = _convertDartToNative_IDBKey(key_OR_range); 10334 var key_2 = _convertDartToNative_IDBKey(key_OR_range);
10319 return _openCursor_5(key_2, direction); 10335 return _openCursor_5(key_2, direction);
10320 } 10336 }
10321 throw const Exception("Incorrect number or type of arguments"); 10337 throw const Exception("Incorrect number or type of arguments");
10322 } 10338 }
10339 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor')
10323 IDBRequest _openCursor_1() native "openCursor"; 10340 IDBRequest _openCursor_1() native "openCursor";
10341 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor')
10324 IDBRequest _openCursor_2(IDBKeyRange range) native "openCursor"; 10342 IDBRequest _openCursor_2(IDBKeyRange range) native "openCursor";
10343 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor')
10325 IDBRequest _openCursor_3(IDBKeyRange range, direction) native "openCursor"; 10344 IDBRequest _openCursor_3(IDBKeyRange range, direction) native "openCursor";
10345 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor')
10326 IDBRequest _openCursor_4(key) native "openCursor"; 10346 IDBRequest _openCursor_4(key) native "openCursor";
10347 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor')
10327 IDBRequest _openCursor_5(key, direction) native "openCursor"; 10348 IDBRequest _openCursor_5(key, direction) native "openCursor";
10328 10349
10329 /** @domName IDBIndex.openKeyCursor */ 10350 /** @domName IDBIndex.openKeyCursor */
10330 IDBRequest openKeyCursor([key_OR_range, String direction]) { 10351 IDBRequest openKeyCursor([key_OR_range, String direction]) {
10331 if (!?key_OR_range && 10352 if (!?key_OR_range &&
10332 !?direction) { 10353 !?direction) {
10333 return _openKeyCursor_1(); 10354 return _openKeyCursor_1();
10334 } 10355 }
10335 if ((?key_OR_range && (key_OR_range is IDBKeyRange || key_OR_range == null)) && 10356 if ((?key_OR_range && (key_OR_range is IDBKeyRange || key_OR_range == null)) &&
10336 !?direction) { 10357 !?direction) {
10337 return _openKeyCursor_2(key_OR_range); 10358 return _openKeyCursor_2(key_OR_range);
10338 } 10359 }
10339 if ((?key_OR_range && (key_OR_range is IDBKeyRange || key_OR_range == null)) ) { 10360 if ((?key_OR_range && (key_OR_range is IDBKeyRange || key_OR_range == null)) ) {
10340 return _openKeyCursor_3(key_OR_range, direction); 10361 return _openKeyCursor_3(key_OR_range, direction);
10341 } 10362 }
10342 if (?key_OR_range && 10363 if (?key_OR_range &&
10343 !?direction) { 10364 !?direction) {
10344 var key_1 = _convertDartToNative_IDBKey(key_OR_range); 10365 var key_1 = _convertDartToNative_IDBKey(key_OR_range);
10345 return _openKeyCursor_4(key_1); 10366 return _openKeyCursor_4(key_1);
10346 } 10367 }
10347 if (?key_OR_range) { 10368 if (?key_OR_range) {
10348 var key_2 = _convertDartToNative_IDBKey(key_OR_range); 10369 var key_2 = _convertDartToNative_IDBKey(key_OR_range);
10349 return _openKeyCursor_5(key_2, direction); 10370 return _openKeyCursor_5(key_2, direction);
10350 } 10371 }
10351 throw const Exception("Incorrect number or type of arguments"); 10372 throw const Exception("Incorrect number or type of arguments");
10352 } 10373 }
10374 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor')
10353 IDBRequest _openKeyCursor_1() native "openKeyCursor"; 10375 IDBRequest _openKeyCursor_1() native "openKeyCursor";
10376 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor')
10354 IDBRequest _openKeyCursor_2(IDBKeyRange range) native "openKeyCursor"; 10377 IDBRequest _openKeyCursor_2(IDBKeyRange range) native "openKeyCursor";
10378 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor')
10355 IDBRequest _openKeyCursor_3(IDBKeyRange range, direction) native "openKeyCurso r"; 10379 IDBRequest _openKeyCursor_3(IDBKeyRange range, direction) native "openKeyCurso r";
10380 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor')
10356 IDBRequest _openKeyCursor_4(key) native "openKeyCursor"; 10381 IDBRequest _openKeyCursor_4(key) native "openKeyCursor";
10382 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor')
10357 IDBRequest _openKeyCursor_5(key, direction) native "openKeyCursor"; 10383 IDBRequest _openKeyCursor_5(key, direction) native "openKeyCursor";
10358 } 10384 }
10359 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 10385 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
10360 // for details. All rights reserved. Use of this source code is governed by a 10386 // for details. All rights reserved. Use of this source code is governed by a
10361 // BSD-style license that can be found in the LICENSE file. 10387 // BSD-style license that can be found in the LICENSE file.
10362 10388
10363 10389
10364 /// @domName IDBKey 10390 /// @domName IDBKey
10365 class IDBKey native "*IDBKey" { 10391 class IDBKey native "*IDBKey" {
10366 } 10392 }
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
10489 /** @domName IDBObjectStore.add */ 10515 /** @domName IDBObjectStore.add */
10490 IDBRequest add(/*any*/ value, [/*IDBKey*/ key]) { 10516 IDBRequest add(/*any*/ value, [/*IDBKey*/ key]) {
10491 if (?key) { 10517 if (?key) {
10492 var value_1 = _convertDartToNative_SerializedScriptValue(value); 10518 var value_1 = _convertDartToNative_SerializedScriptValue(value);
10493 var key_2 = _convertDartToNative_IDBKey(key); 10519 var key_2 = _convertDartToNative_IDBKey(key);
10494 return _add_1(value_1, key_2); 10520 return _add_1(value_1, key_2);
10495 } 10521 }
10496 var value_3 = _convertDartToNative_SerializedScriptValue(value); 10522 var value_3 = _convertDartToNative_SerializedScriptValue(value);
10497 return _add_2(value_3); 10523 return _add_2(value_3);
10498 } 10524 }
10525 @Returns('IDBRequest') @Creates('IDBRequest') @annotation_Creates_IDBKey
10499 IDBRequest _add_1(value, key) native "add"; 10526 IDBRequest _add_1(value, key) native "add";
10527 @Returns('IDBRequest') @Creates('IDBRequest') @annotation_Creates_IDBKey
10500 IDBRequest _add_2(value) native "add"; 10528 IDBRequest _add_2(value) native "add";
10501 10529
10502 /** @domName IDBObjectStore.clear */ 10530 /** @domName IDBObjectStore.clear */
10503 IDBRequest clear() native; 10531 IDBRequest clear() native;
10504 10532
10505 /** @domName IDBObjectStore.count */ 10533 /** @domName IDBObjectStore.count */
10506 IDBRequest count([key_OR_range]) { 10534 IDBRequest count([key_OR_range]) {
10507 if (!?key_OR_range) { 10535 if (!?key_OR_range) {
10508 return _count_1(); 10536 return _count_1();
10509 } 10537 }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
10568 IDBRequest getObject(key) { 10596 IDBRequest getObject(key) {
10569 if ((?key && (key is IDBKeyRange || key == null))) { 10597 if ((?key && (key is IDBKeyRange || key == null))) {
10570 return _getObject_1(key); 10598 return _getObject_1(key);
10571 } 10599 }
10572 if (?key) { 10600 if (?key) {
10573 var key_1 = _convertDartToNative_IDBKey(key); 10601 var key_1 = _convertDartToNative_IDBKey(key);
10574 return _getObject_2(key_1); 10602 return _getObject_2(key_1);
10575 } 10603 }
10576 throw const Exception("Incorrect number or type of arguments"); 10604 throw const Exception("Incorrect number or type of arguments");
10577 } 10605 }
10606 @Returns('IDBRequest') @Creates('IDBRequest') @annotation_Creates_SerializedSc riptValue
10578 IDBRequest _getObject_1(IDBKeyRange key) native "get"; 10607 IDBRequest _getObject_1(IDBKeyRange key) native "get";
10608 @Returns('IDBRequest') @Creates('IDBRequest') @annotation_Creates_SerializedSc riptValue
10579 IDBRequest _getObject_2(key) native "get"; 10609 IDBRequest _getObject_2(key) native "get";
10580 10610
10581 /** @domName IDBObjectStore.index */ 10611 /** @domName IDBObjectStore.index */
10582 IDBIndex index(String name) native; 10612 IDBIndex index(String name) native;
10583 10613
10584 /** @domName IDBObjectStore.openCursor */ 10614 /** @domName IDBObjectStore.openCursor */
10585 IDBRequest openCursor([key_OR_range, String direction]) { 10615 IDBRequest openCursor([key_OR_range, String direction]) {
10586 if (!?key_OR_range && 10616 if (!?key_OR_range &&
10587 !?direction) { 10617 !?direction) {
10588 return _openCursor_1(); 10618 return _openCursor_1();
10589 } 10619 }
10590 if ((?key_OR_range && (key_OR_range is IDBKeyRange || key_OR_range == null)) && 10620 if ((?key_OR_range && (key_OR_range is IDBKeyRange || key_OR_range == null)) &&
10591 !?direction) { 10621 !?direction) {
10592 return _openCursor_2(key_OR_range); 10622 return _openCursor_2(key_OR_range);
10593 } 10623 }
10594 if ((?key_OR_range && (key_OR_range is IDBKeyRange || key_OR_range == null)) ) { 10624 if ((?key_OR_range && (key_OR_range is IDBKeyRange || key_OR_range == null)) ) {
10595 return _openCursor_3(key_OR_range, direction); 10625 return _openCursor_3(key_OR_range, direction);
10596 } 10626 }
10597 if (?key_OR_range && 10627 if (?key_OR_range &&
10598 !?direction) { 10628 !?direction) {
10599 var key_1 = _convertDartToNative_IDBKey(key_OR_range); 10629 var key_1 = _convertDartToNative_IDBKey(key_OR_range);
10600 return _openCursor_4(key_1); 10630 return _openCursor_4(key_1);
10601 } 10631 }
10602 if (?key_OR_range) { 10632 if (?key_OR_range) {
10603 var key_2 = _convertDartToNative_IDBKey(key_OR_range); 10633 var key_2 = _convertDartToNative_IDBKey(key_OR_range);
10604 return _openCursor_5(key_2, direction); 10634 return _openCursor_5(key_2, direction);
10605 } 10635 }
10606 throw const Exception("Incorrect number or type of arguments"); 10636 throw const Exception("Incorrect number or type of arguments");
10607 } 10637 }
10638 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor')
10608 IDBRequest _openCursor_1() native "openCursor"; 10639 IDBRequest _openCursor_1() native "openCursor";
10640 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor')
10609 IDBRequest _openCursor_2(IDBKeyRange range) native "openCursor"; 10641 IDBRequest _openCursor_2(IDBKeyRange range) native "openCursor";
10642 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor')
10610 IDBRequest _openCursor_3(IDBKeyRange range, direction) native "openCursor"; 10643 IDBRequest _openCursor_3(IDBKeyRange range, direction) native "openCursor";
10644 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor')
10611 IDBRequest _openCursor_4(key) native "openCursor"; 10645 IDBRequest _openCursor_4(key) native "openCursor";
10646 @Returns('IDBRequest') @Creates('IDBRequest') @Creates('IDBCursor')
10612 IDBRequest _openCursor_5(key, direction) native "openCursor"; 10647 IDBRequest _openCursor_5(key, direction) native "openCursor";
10613 10648
10614 /** @domName IDBObjectStore.put */ 10649 /** @domName IDBObjectStore.put */
10615 IDBRequest put(/*any*/ value, [/*IDBKey*/ key]) { 10650 IDBRequest put(/*any*/ value, [/*IDBKey*/ key]) {
10616 if (?key) { 10651 if (?key) {
10617 var value_1 = _convertDartToNative_SerializedScriptValue(value); 10652 var value_1 = _convertDartToNative_SerializedScriptValue(value);
10618 var key_2 = _convertDartToNative_IDBKey(key); 10653 var key_2 = _convertDartToNative_IDBKey(key);
10619 return _put_1(value_1, key_2); 10654 return _put_1(value_1, key_2);
10620 } 10655 }
10621 var value_3 = _convertDartToNative_SerializedScriptValue(value); 10656 var value_3 = _convertDartToNative_SerializedScriptValue(value);
10622 return _put_2(value_3); 10657 return _put_2(value_3);
10623 } 10658 }
10659 @Returns('IDBRequest') @Creates('IDBRequest') @annotation_Creates_IDBKey
10624 IDBRequest _put_1(value, key) native "put"; 10660 IDBRequest _put_1(value, key) native "put";
10661 @Returns('IDBRequest') @Creates('IDBRequest') @annotation_Creates_IDBKey
10625 IDBRequest _put_2(value) native "put"; 10662 IDBRequest _put_2(value) native "put";
10626 } 10663 }
10627 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 10664 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
10628 // for details. All rights reserved. Use of this source code is governed by a 10665 // for details. All rights reserved. Use of this source code is governed by a
10629 // BSD-style license that can be found in the LICENSE file. 10666 // BSD-style license that can be found in the LICENSE file.
10630 10667
10631 10668
10632 /// @domName IDBOpenDBRequest 10669 /// @domName IDBOpenDBRequest
10633 class IDBOpenDBRequest extends IDBRequest implements EventTarget native "*IDBOpe nDBRequest" { 10670 class IDBOpenDBRequest extends IDBRequest implements EventTarget native "*IDBOpe nDBRequest" {
10634 10671
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
10667 final int errorCode; 10704 final int errorCode;
10668 10705
10669 /** @domName IDBRequest.readyState */ 10706 /** @domName IDBRequest.readyState */
10670 final String readyState; 10707 final String readyState;
10671 10708
10672 /** @domName IDBRequest.result */ 10709 /** @domName IDBRequest.result */
10673 dynamic get result => _convertNativeToDart_IDBAny(this._result); 10710 dynamic get result => _convertNativeToDart_IDBAny(this._result);
10674 dynamic get _result => JS("dynamic", "#.result", this); 10711 dynamic get _result => JS("dynamic", "#.result", this);
10675 10712
10676 /** @domName IDBRequest.source */ 10713 /** @domName IDBRequest.source */
10714 @Creates('Null')
10677 final dynamic source; 10715 final dynamic source;
10678 10716
10679 /** @domName IDBRequest.transaction */ 10717 /** @domName IDBRequest.transaction */
10680 final IDBTransaction transaction; 10718 final IDBTransaction transaction;
10681 10719
10682 /** @domName IDBRequest.webkitErrorMessage */ 10720 /** @domName IDBRequest.webkitErrorMessage */
10683 final String webkitErrorMessage; 10721 final String webkitErrorMessage;
10684 10722
10685 /** @domName IDBRequest.addEventListener */ 10723 /** @domName IDBRequest.addEventListener */
10686 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native "addEventListener"; 10724 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native "addEventListener";
(...skipping 5256 matching lines...) Expand 10 before | Expand all | Expand 10 after
15943 15981
15944 List<Map> getRange(int start, int rangeLength) => 15982 List<Map> getRange(int start, int rangeLength) =>
15945 _Lists.getRange(this, start, rangeLength, <Map>[]); 15983 _Lists.getRange(this, start, rangeLength, <Map>[]);
15946 15984
15947 // -- end List<Map> mixins. 15985 // -- end List<Map> mixins.
15948 15986
15949 /** @domName SQLResultSetRowList.item */ 15987 /** @domName SQLResultSetRowList.item */
15950 Map item(int index) { 15988 Map item(int index) {
15951 return _convertNativeToDart_Dictionary(_item_1(index)); 15989 return _convertNativeToDart_Dictionary(_item_1(index));
15952 } 15990 }
15991 @Creates('=Object')
15953 _item_1(index) native "item"; 15992 _item_1(index) native "item";
15954 } 15993 }
15955 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 15994 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
15956 // for details. All rights reserved. Use of this source code is governed by a 15995 // for details. All rights reserved. Use of this source code is governed by a
15957 // BSD-style license that can be found in the LICENSE file. 15996 // BSD-style license that can be found in the LICENSE file.
15958 15997
15959 // WARNING: Do not edit - generated code. 15998 // WARNING: Do not edit - generated code.
15960 15999
15961 16000
15962 typedef void SQLStatementCallback(SQLTransaction transaction, SQLResultSet resul tSet); 16001 typedef void SQLStatementCallback(SQLTransaction transaction, SQLResultSet resul tSet);
(...skipping 8488 matching lines...) Expand 10 before | Expand all | Expand 10 after
24451 } 24490 }
24452 return imageData; 24491 return imageData;
24453 } 24492 }
24454 24493
24455 24494
24456 /// Converts a JavaScript object with properties into a Dart Map. 24495 /// Converts a JavaScript object with properties into a Dart Map.
24457 /// Not suitable for nested objects. 24496 /// Not suitable for nested objects.
24458 Map _convertNativeToDart_Dictionary(object) { 24497 Map _convertNativeToDart_Dictionary(object) {
24459 if (object == null) return null; 24498 if (object == null) return null;
24460 var dict = {}; 24499 var dict = {};
24461 for (final key in JS('List', 'Object.getOwnPropertyNames(#)', object)) { 24500 for (final key in JS('=List', 'Object.getOwnPropertyNames(#)', object)) {
24462 dict[key] = JS('var', '#[#]', object, key); 24501 dict[key] = JS('var', '#[#]', object, key);
24463 } 24502 }
24464 return dict; 24503 return dict;
24465 } 24504 }
24466 24505
24467 /// Converts a flat Dart map into a JavaScript object with properties. 24506 /// Converts a flat Dart map into a JavaScript object with properties.
24468 _convertDartToNative_Dictionary(Map dict) { 24507 _convertDartToNative_Dictionary(Map dict) {
24469 if (dict == null) return null; 24508 if (dict == null) return null;
24470 var object = JS('var', '{}'); 24509 var object = JS('var', '{}');
24471 dict.forEach((String key, value) { 24510 dict.forEach((String key, value) {
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
24628 if (e is List) { 24667 if (e is List) {
24629 // Since a JavaScript Array is an instance of Dart List it is possible to 24668 // Since a JavaScript Array is an instance of Dart List it is possible to
24630 // avoid making a copy of the list if there is no need to copy anything 24669 // avoid making a copy of the list if there is no need to copy anything
24631 // reachable from the array. We defer creating a new array until a cycle 24670 // reachable from the array. We defer creating a new array until a cycle
24632 // is detected or a subgraph was copied. 24671 // is detected or a subgraph was copied.
24633 int length = e.length; 24672 int length = e.length;
24634 var slot = findSlot(e); 24673 var slot = findSlot(e);
24635 var copy = readSlot(slot); 24674 var copy = readSlot(slot);
24636 if (copy != null) { 24675 if (copy != null) {
24637 if (true == copy) { // Cycle, so commit to making a copy. 24676 if (true == copy) { // Cycle, so commit to making a copy.
24638 copy = JS('List', 'new Array(#)', length); 24677 copy = JS('=List', 'new Array(#)', length);
24639 writeSlot(slot, copy); 24678 writeSlot(slot, copy);
24640 } 24679 }
24641 return copy; 24680 return copy;
24642 } 24681 }
24643 24682
24644 int i = 0; 24683 int i = 0;
24645 24684
24646 if (_isJavaScriptArray(e) && 24685 if (_isJavaScriptArray(e) &&
24647 // We have to copy immutable lists, otherwise the structured clone 24686 // We have to copy immutable lists, otherwise the structured clone
24648 // algorithm will copy the .immutable$list marker property, making the 24687 // algorithm will copy the .immutable$list marker property, making the
24649 // list immutable when received! 24688 // list immutable when received!
24650 !_isImmutableJavaScriptArray(e)) { 24689 !_isImmutableJavaScriptArray(e)) {
24651 writeSlot(slot, true); // Deferred copy. 24690 writeSlot(slot, true); // Deferred copy.
24652 for ( ; i < length; i++) { 24691 for ( ; i < length; i++) {
24653 var element = e[i]; 24692 var element = e[i];
24654 var elementCopy = walk(element); 24693 var elementCopy = walk(element);
24655 if (!identical(elementCopy, element)) { 24694 if (!identical(elementCopy, element)) {
24656 copy = readSlot(slot); // Cyclic reference may have created it. 24695 copy = readSlot(slot); // Cyclic reference may have created it.
24657 if (true == copy) { 24696 if (true == copy) {
24658 copy = JS('List', 'new Array(#)', length); 24697 copy = JS('=List', 'new Array(#)', length);
24659 writeSlot(slot, copy); 24698 writeSlot(slot, copy);
24660 } 24699 }
24661 for (int j = 0; j < i; j++) { 24700 for (int j = 0; j < i; j++) {
24662 copy[j] = e[j]; 24701 copy[j] = e[j];
24663 } 24702 }
24664 copy[i] = elementCopy; 24703 copy[i] = elementCopy;
24665 i++; 24704 i++;
24666 break; 24705 break;
24667 } 24706 }
24668 } 24707 }
24669 if (copy == null) { 24708 if (copy == null) {
24670 copy = e; 24709 copy = e;
24671 writeSlot(slot, copy); 24710 writeSlot(slot, copy);
24672 } 24711 }
24673 } else { 24712 } else {
24674 // Not a JavaScript Array. We are forced to make a copy. 24713 // Not a JavaScript Array. We are forced to make a copy.
24675 copy = JS('List', 'new Array(#)', length); 24714 copy = JS('=List', 'new Array(#)', length);
24676 writeSlot(slot, copy); 24715 writeSlot(slot, copy);
24677 } 24716 }
24678 24717
24679 for ( ; i < length; i++) { 24718 for ( ; i < length; i++) {
24680 copy[i] = walk(e[i]); 24719 copy[i] = walk(e[i]);
24681 } 24720 }
24682 return copy; 24721 return copy;
24683 } 24722 }
24684 24723
24685 throw new UnimplementedError('structured clone of other type'); 24724 throw new UnimplementedError('structured clone of other type');
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
24745 24784
24746 if (_isJavaScriptSimpleObject(e)) { 24785 if (_isJavaScriptSimpleObject(e)) {
24747 // TODO(sra): If mustCopy is false, swizzle the prototype for one of a Map 24786 // TODO(sra): If mustCopy is false, swizzle the prototype for one of a Map
24748 // implementation that uses the properies as storage. 24787 // implementation that uses the properies as storage.
24749 var slot = findSlot(e); 24788 var slot = findSlot(e);
24750 var copy = readSlot(slot); 24789 var copy = readSlot(slot);
24751 if (copy != null) return copy; 24790 if (copy != null) return copy;
24752 copy = {}; 24791 copy = {};
24753 24792
24754 writeSlot(slot, copy); 24793 writeSlot(slot, copy);
24755 for (final key in JS('List', 'Object.keys(#)', e)) { 24794 for (final key in JS('=List', 'Object.keys(#)', e)) {
24756 copy[key] = walk(JS('var', '#[#]', e, key)); 24795 copy[key] = walk(JS('var', '#[#]', e, key));
24757 } 24796 }
24758 return copy; 24797 return copy;
24759 } 24798 }
24760 24799
24761 if (_isJavaScriptArray(e)) { 24800 if (_isJavaScriptArray(e)) {
24762 var slot = findSlot(e); 24801 var slot = findSlot(e);
24763 var copy = readSlot(slot); 24802 var copy = readSlot(slot);
24764 if (copy != null) return copy; 24803 if (copy != null) return copy;
24765 24804
24766 int length = e.length; 24805 int length = e.length;
24767 // Since a JavaScript Array is an instance of Dart List, we can modify it 24806 // Since a JavaScript Array is an instance of Dart List, we can modify it
24768 // in-place unless we must copy. 24807 // in-place unless we must copy.
24769 copy = mustCopy ? JS('List', 'new Array(#)', length) : e; 24808 copy = mustCopy ? JS('=List', 'new Array(#)', length) : e;
24770 writeSlot(slot, copy); 24809 writeSlot(slot, copy);
24771 24810
24772 for (int i = 0; i < length; i++) { 24811 for (int i = 0; i < length; i++) {
24773 copy[i] = walk(e[i]); 24812 copy[i] = walk(e[i]);
24774 } 24813 }
24775 return copy; 24814 return copy;
24776 } 24815 }
24777 24816
24778 // Assume anything else is already a valid Dart object, either by having 24817 // Assume anything else is already a valid Dart object, either by having
24779 // already been processed, or e.g. a clonable native class. 24818 // already been processed, or e.g. a clonable native class.
24780 return e; 24819 return e;
24781 } 24820 }
24782 24821
24783 var copy = walk(object); 24822 var copy = walk(object);
24784 return copy; 24823 return copy;
24785 } 24824 }
24786 24825
24787 24826
24788 bool _isJavaScriptDate(value) => JS('bool', '# instanceof Date', value); 24827 bool _isJavaScriptDate(value) => JS('bool', '# instanceof Date', value);
24789 bool _isJavaScriptRegExp(value) => JS('bool', '# instanceof RegExp', value); 24828 bool _isJavaScriptRegExp(value) => JS('bool', '# instanceof RegExp', value);
24790 bool _isJavaScriptArray(value) => JS('bool', '# instanceof Array', value); 24829 bool _isJavaScriptArray(value) => JS('bool', '# instanceof Array', value);
24791 bool _isJavaScriptSimpleObject(value) => 24830 bool _isJavaScriptSimpleObject(value) =>
24792 JS('bool', 'Object.getPrototypeOf(#) === Object.prototype', value); 24831 JS('bool', 'Object.getPrototypeOf(#) === Object.prototype', value);
24793 bool _isImmutableJavaScriptArray(value) => 24832 bool _isImmutableJavaScriptArray(value) =>
24794 JS('bool', r'!!(#.immutable$list)', value); 24833 JS('bool', r'!!(#.immutable$list)', value);
24834
24835
24836
24837 const String _serializedScriptValue =
24838 'num|String|bool|'
24839 '=List|=Object|'
24840 'Blob|File|ArrayBuffer|ArrayBufferView'
24841 // TODO(sra): Add Date, RegExp.
24842 ;
24843
24844 const annotation_Creates_SerializedScriptValue =
24845 const Creates(_serializedScriptValue);
24846 const annotation_Returns_SerializedScriptValue =
24847 const Returns(_serializedScriptValue);
24848
24849 const String _idbKey = '=List|=Object|num|String'; // TODO(sra): Add Date.
24850 const annotation_Creates_IDBKey = const Creates(_idbKey);
24851 const annotation_Returns_IDBKey = const Returns(_idbKey);
24795 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 24852 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
24796 // for details. All rights reserved. Use of this source code is governed by a 24853 // for details. All rights reserved. Use of this source code is governed by a
24797 // BSD-style license that can be found in the LICENSE file. 24854 // BSD-style license that can be found in the LICENSE file.
24798 24855
24799 24856
24800 // TODO(vsm): Unify with Dartium version. 24857 // TODO(vsm): Unify with Dartium version.
24801 class _DOMWindowCrossFrame implements Window { 24858 class _DOMWindowCrossFrame implements Window {
24802 // Private window. Note, this is a window in another frame, so it 24859 // Private window. Note, this is a window in another frame, so it
24803 // cannot be typed as "Window" as its prototype is not patched 24860 // cannot be typed as "Window" as its prototype is not patched
24804 // properly. Its fields and methods can only be accessed via JavaScript. 24861 // properly. Its fields and methods can only be accessed via JavaScript.
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
25332 if (length < 0) throw new ArgumentError('length'); 25389 if (length < 0) throw new ArgumentError('length');
25333 if (start < 0) throw new RangeError.value(start); 25390 if (start < 0) throw new RangeError.value(start);
25334 int end = start + length; 25391 int end = start + length;
25335 if (end > a.length) throw new RangeError.value(end); 25392 if (end > a.length) throw new RangeError.value(end);
25336 for (int i = start; i < end; i++) { 25393 for (int i = start; i < end; i++) {
25337 accumulator.add(a[i]); 25394 accumulator.add(a[i]);
25338 } 25395 }
25339 return accumulator; 25396 return accumulator;
25340 } 25397 }
25341 } 25398 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/html/scripts/generator.py » ('j') | sdk/lib/html/scripts/generator.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698