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

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

Issue 11304021: Add NativeEnqueuer to work with the Enqueuer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review fixes 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
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 4424 matching lines...) Expand 10 before | Expand all | Expand 10 after
4435 class CanvasRenderingContext native "*CanvasRenderingContext" { 4435 class CanvasRenderingContext native "*CanvasRenderingContext" {
4436 4436
4437 /** @domName CanvasRenderingContext.canvas */ 4437 /** @domName CanvasRenderingContext.canvas */
4438 final CanvasElement canvas; 4438 final CanvasElement canvas;
4439 } 4439 }
4440 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 4440 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
4441 // for details. All rights reserved. Use of this source code is governed by a 4441 // for details. All rights reserved. Use of this source code is governed by a
4442 // BSD-style license that can be found in the LICENSE file. 4442 // BSD-style license that can be found in the LICENSE file.
4443 4443
4444 4444
4445 const _createsImageData = const Creates(
4446 'ImageData' /* Chrome */
4447 '|=Object' /* FireFox*/);
4448
4445 class CanvasRenderingContext2D extends CanvasRenderingContext native "*CanvasRen deringContext2D" { 4449 class CanvasRenderingContext2D extends CanvasRenderingContext native "*CanvasRen deringContext2D" {
4446 4450
4447 /** @domName CanvasRenderingContext2D.fillStyle */ 4451 /** @domName CanvasRenderingContext2D.fillStyle */
4448 dynamic fillStyle; 4452 dynamic fillStyle;
4449 4453
4450 /** @domName CanvasRenderingContext2D.font */ 4454 /** @domName CanvasRenderingContext2D.font */
4451 String font; 4455 String font;
4452 4456
4453 /** @domName CanvasRenderingContext2D.globalAlpha */ 4457 /** @domName CanvasRenderingContext2D.globalAlpha */
4454 num globalAlpha; 4458 num globalAlpha;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
4533 if ((?imagedata_OR_sw && (imagedata_OR_sw is ImageData || imagedata_OR_sw == null)) && 4537 if ((?imagedata_OR_sw && (imagedata_OR_sw is ImageData || imagedata_OR_sw == null)) &&
4534 !?sh) { 4538 !?sh) {
4535 var imagedata_1 = _convertDartToNative_ImageData(imagedata_OR_sw); 4539 var imagedata_1 = _convertDartToNative_ImageData(imagedata_OR_sw);
4536 return _convertNativeToDart_ImageData(_createImageData_1(imagedata_1)); 4540 return _convertNativeToDart_ImageData(_createImageData_1(imagedata_1));
4537 } 4541 }
4538 if ((?imagedata_OR_sw && (imagedata_OR_sw is num || imagedata_OR_sw == null) )) { 4542 if ((?imagedata_OR_sw && (imagedata_OR_sw is num || imagedata_OR_sw == null) )) {
4539 return _convertNativeToDart_ImageData(_createImageData_2(imagedata_OR_sw, sh)); 4543 return _convertNativeToDart_ImageData(_createImageData_2(imagedata_OR_sw, sh));
4540 } 4544 }
4541 throw const Exception("Incorrect number or type of arguments"); 4545 throw const Exception("Incorrect number or type of arguments");
4542 } 4546 }
4547
4548 @_createsImageData
4543 _createImageData_1(imagedata) native "createImageData"; 4549 _createImageData_1(imagedata) native "createImageData";
4550
4551 @_createsImageData
4544 _createImageData_2(num sw, sh) native "createImageData"; 4552 _createImageData_2(num sw, sh) native "createImageData";
4545 4553
4546 /** @domName CanvasRenderingContext2D.createLinearGradient */ 4554 /** @domName CanvasRenderingContext2D.createLinearGradient */
4547 CanvasGradient createLinearGradient(num x0, num y0, num x1, num y1) native; 4555 CanvasGradient createLinearGradient(num x0, num y0, num x1, num y1) native;
4548 4556
4549 /** @domName CanvasRenderingContext2D.createPattern */ 4557 /** @domName CanvasRenderingContext2D.createPattern */
4550 CanvasPattern createPattern(canvas_OR_image, String repetitionType) native; 4558 CanvasPattern createPattern(canvas_OR_image, String repetitionType) native;
4551 4559
4552 /** @domName CanvasRenderingContext2D.createRadialGradient */ 4560 /** @domName CanvasRenderingContext2D.createRadialGradient */
4553 CanvasGradient createRadialGradient(num x0, num y0, num r0, num x1, num y1, nu m r1) native; 4561 CanvasGradient createRadialGradient(num x0, num y0, num r0, num x1, num y1, nu m r1) native;
(...skipping 1248 matching lines...) Expand 10 before | Expand all | Expand 10 after
5802 void transaction(SQLTransactionCallback callback, [SQLTransactionErrorCallback errorCallback, VoidCallback successCallback]) native; 5810 void transaction(SQLTransactionCallback callback, [SQLTransactionErrorCallback errorCallback, VoidCallback successCallback]) native;
5803 } 5811 }
5804 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 5812 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
5805 // for details. All rights reserved. Use of this source code is governed by a 5813 // for details. All rights reserved. Use of this source code is governed by a
5806 // BSD-style license that can be found in the LICENSE file. 5814 // BSD-style license that can be found in the LICENSE file.
5807 5815
5808 // WARNING: Do not edit - generated code. 5816 // WARNING: Do not edit - generated code.
5809 5817
5810 5818
5811 typedef void DatabaseCallback(database); 5819 typedef void DatabaseCallback(database);
5820
5821 const _createsDatabase = const Creates('Database|DatabaseSync');
5822
5812 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 5823 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
5813 // for details. All rights reserved. Use of this source code is governed by a 5824 // for details. All rights reserved. Use of this source code is governed by a
5814 // BSD-style license that can be found in the LICENSE file. 5825 // BSD-style license that can be found in the LICENSE file.
5815 5826
5816 5827
5817 /// @domName DatabaseSync 5828 /// @domName DatabaseSync
5818 class DatabaseSync native "*DatabaseSync" { 5829 class DatabaseSync native "*DatabaseSync" {
5819 5830
5820 /** @domName DatabaseSync.lastErrorMessage */ 5831 /** @domName DatabaseSync.lastErrorMessage */
5821 final String lastErrorMessage; 5832 final String lastErrorMessage;
(...skipping 3720 matching lines...) Expand 10 before | Expand all | Expand 10 after
9542 static const int NEXT_NO_DUPLICATE = 1; 9553 static const int NEXT_NO_DUPLICATE = 1;
9543 9554
9544 static const int PREV = 2; 9555 static const int PREV = 2;
9545 9556
9546 static const int PREV_NO_DUPLICATE = 3; 9557 static const int PREV_NO_DUPLICATE = 3;
9547 9558
9548 /** @domName IDBCursor.direction */ 9559 /** @domName IDBCursor.direction */
9549 final String direction; 9560 final String direction;
9550 9561
9551 /** @domName IDBCursor.key */ 9562 /** @domName IDBCursor.key */
9563 @_createsIDBKey
9552 final Object key; 9564 final Object key;
9553 9565
9554 /** @domName IDBCursor.primaryKey */ 9566 /** @domName IDBCursor.primaryKey */
9555 final Object primaryKey; 9567 final Object primaryKey;
9556 9568
9557 /** @domName IDBCursor.source */ 9569 /** @domName IDBCursor.source */
9558 final dynamic source; 9570 final dynamic source;
9559 9571
9560 /** @domName IDBCursor.advance */ 9572 /** @domName IDBCursor.advance */
9561 void advance(int count) native; 9573 void advance(int count) native;
(...skipping 19 matching lines...) Expand all
9581 var value_1 = _convertDartToNative_SerializedScriptValue(value); 9593 var value_1 = _convertDartToNative_SerializedScriptValue(value);
9582 return _update_1(value_1); 9594 return _update_1(value_1);
9583 } 9595 }
9584 IDBRequest _update_1(value) native "update"; 9596 IDBRequest _update_1(value) native "update";
9585 } 9597 }
9586 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 9598 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
9587 // for details. All rights reserved. Use of this source code is governed by a 9599 // for details. All rights reserved. Use of this source code is governed by a
9588 // BSD-style license that can be found in the LICENSE file. 9600 // BSD-style license that can be found in the LICENSE file.
9589 9601
9590 9602
9603 const _createsSSV = const Creates(
9604 '=Object|=List|num|String|bool'
9605 // Date, RegExp,
9606 '|File|Blob|_FileList|ImageData'
9607 '|ArrayBuffer|ArrayBufferView' );
9608
9609 const _createsIDBValue = _createsSSV;
9610
9611 const _createsIDBKey = const Creates(
9612 // Date,
9613 'num|String|bool|=List');
9614
9591 /// @domName IDBCursorWithValue 9615 /// @domName IDBCursorWithValue
9592 class IDBCursorWithValue extends IDBCursor native "*IDBCursorWithValue" { 9616 class IDBCursorWithValue extends IDBCursor native "*IDBCursorWithValue" {
9593 9617
9594 /** @domName IDBCursorWithValue.value */ 9618 /** @domName IDBCursorWithValue.value */
9619 @_createsIDBValue
9595 final Object value; 9620 final Object value;
9596 } 9621 }
9597 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 9622 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
9598 // for details. All rights reserved. Use of this source code is governed by a 9623 // for details. All rights reserved. Use of this source code is governed by a
9599 // BSD-style license that can be found in the LICENSE file. 9624 // BSD-style license that can be found in the LICENSE file.
9600 9625
9601 9626
9602 class IDBDatabase extends EventTarget native "*IDBDatabase" { 9627 class IDBDatabase extends EventTarget native "*IDBDatabase" {
9603 9628
9604 IDBTransaction transaction(storeName_OR_storeNames, String mode) { 9629 IDBTransaction transaction(storeName_OR_storeNames, String mode) {
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
9759 int cmp(/*IDBKey*/ first, /*IDBKey*/ second) { 9784 int cmp(/*IDBKey*/ first, /*IDBKey*/ second) {
9760 var first_1 = _convertDartToNative_IDBKey(first); 9785 var first_1 = _convertDartToNative_IDBKey(first);
9761 var second_2 = _convertDartToNative_IDBKey(second); 9786 var second_2 = _convertDartToNative_IDBKey(second);
9762 return _cmp_1(first_1, second_2); 9787 return _cmp_1(first_1, second_2);
9763 } 9788 }
9764 int _cmp_1(first, second) native "cmp"; 9789 int _cmp_1(first, second) native "cmp";
9765 9790
9766 /** @domName IDBFactory.deleteDatabase */ 9791 /** @domName IDBFactory.deleteDatabase */
9767 IDBVersionChangeRequest deleteDatabase(String name) native; 9792 IDBVersionChangeRequest deleteDatabase(String name) native;
9768 9793
9794 static const _createsIDBDatabase = const Creates('IDBDatabase');
9795 static const _createsIDBRequest = const Creates('IDBRequest');
9769 /** @domName IDBFactory.open */ 9796 /** @domName IDBFactory.open */
9797 @_createsIDBDatabase @_createsIDBRequest
9770 IDBOpenDBRequest open(String name, [int version]) native; 9798 IDBOpenDBRequest open(String name, [int version]) native;
9771 9799
9772 /** @domName IDBFactory.webkitGetDatabaseNames */ 9800 /** @domName IDBFactory.webkitGetDatabaseNames */
9773 IDBRequest webkitGetDatabaseNames() native; 9801 IDBRequest webkitGetDatabaseNames() native;
9774 } 9802 }
9775 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 9803 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
9776 // for details. All rights reserved. Use of this source code is governed by a 9804 // for details. All rights reserved. Use of this source code is governed by a
9777 // BSD-style license that can be found in the LICENSE file. 9805 // BSD-style license that can be found in the LICENSE file.
9778 9806
9779 9807
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
10143 !?direction) { 10171 !?direction) {
10144 var key_1 = _convertDartToNative_IDBKey(key_OR_range); 10172 var key_1 = _convertDartToNative_IDBKey(key_OR_range);
10145 return _openCursor_4(key_1); 10173 return _openCursor_4(key_1);
10146 } 10174 }
10147 if (?key_OR_range) { 10175 if (?key_OR_range) {
10148 var key_2 = _convertDartToNative_IDBKey(key_OR_range); 10176 var key_2 = _convertDartToNative_IDBKey(key_OR_range);
10149 return _openCursor_5(key_2, direction); 10177 return _openCursor_5(key_2, direction);
10150 } 10178 }
10151 throw const Exception("Incorrect number or type of arguments"); 10179 throw const Exception("Incorrect number or type of arguments");
10152 } 10180 }
10181
10182 static const _xx1 = const Creates('IDBCursorWithValue|IDBCursor');
10183 @_xx1
10153 IDBRequest _openCursor_1() native "openCursor"; 10184 IDBRequest _openCursor_1() native "openCursor";
10185
10186 @_xx1
10154 IDBRequest _openCursor_2(IDBKeyRange range) native "openCursor"; 10187 IDBRequest _openCursor_2(IDBKeyRange range) native "openCursor";
10188
10189 @_xx1
10155 IDBRequest _openCursor_3(IDBKeyRange range, direction) native "openCursor"; 10190 IDBRequest _openCursor_3(IDBKeyRange range, direction) native "openCursor";
10191
10192 @_xx1
10156 IDBRequest _openCursor_4(key) native "openCursor"; 10193 IDBRequest _openCursor_4(key) native "openCursor";
10194
10195 @_xx1
10157 IDBRequest _openCursor_5(key, direction) native "openCursor"; 10196 IDBRequest _openCursor_5(key, direction) native "openCursor";
10158 10197
10159 /** @domName IDBObjectStore.put */ 10198 /** @domName IDBObjectStore.put */
10160 IDBRequest put(/*any*/ value, [/*IDBKey*/ key]) { 10199 IDBRequest put(/*any*/ value, [/*IDBKey*/ key]) {
10161 if (?key) { 10200 if (?key) {
10162 var value_1 = _convertDartToNative_SerializedScriptValue(value); 10201 var value_1 = _convertDartToNative_SerializedScriptValue(value);
10163 var key_2 = _convertDartToNative_IDBKey(key); 10202 var key_2 = _convertDartToNative_IDBKey(key);
10164 return _put_1(value_1, key_2); 10203 return _put_1(value_1, key_2);
10165 } 10204 }
10166 var value_3 = _convertDartToNative_SerializedScriptValue(value); 10205 var value_3 = _convertDartToNative_SerializedScriptValue(value);
(...skipping 1537 matching lines...) Expand 10 before | Expand all | Expand 10 after
11704 /** @domName Window.matchMedia */ 11743 /** @domName Window.matchMedia */
11705 MediaQueryList matchMedia(String query) native; 11744 MediaQueryList matchMedia(String query) native;
11706 11745
11707 /** @domName Window.moveBy */ 11746 /** @domName Window.moveBy */
11708 void moveBy(num x, num y) native; 11747 void moveBy(num x, num y) native;
11709 11748
11710 /** @domName Window.moveTo */ 11749 /** @domName Window.moveTo */
11711 void moveTo(num x, num y) native; 11750 void moveTo(num x, num y) native;
11712 11751
11713 /** @domName DOMWindow.openDatabase */ 11752 /** @domName DOMWindow.openDatabase */
11753 @_createsDatabase
11714 Database openDatabase(String name, String version, String displayName, int est imatedSize, [DatabaseCallback creationCallback]) native; 11754 Database openDatabase(String name, String version, String displayName, int est imatedSize, [DatabaseCallback creationCallback]) native;
11715 11755
11716 /** @domName Window.postMessage */ 11756 /** @domName Window.postMessage */
11717 void postMessage(/*SerializedScriptValue*/ message, String targetOrigin, [List messagePorts]) { 11757 void postMessage(/*SerializedScriptValue*/ message, String targetOrigin, [List messagePorts]) {
11718 if (?message && 11758 if (?message &&
11719 !?messagePorts) { 11759 !?messagePorts) {
11720 var message_1 = _convertDartToNative_SerializedScriptValue(message); 11760 var message_1 = _convertDartToNative_SerializedScriptValue(message);
11721 _postMessage_1(message_1, targetOrigin); 11761 _postMessage_1(message_1, targetOrigin);
11722 return; 11762 return;
11723 } 11763 }
(...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after
12667 dynamic get data => _convertNativeToDart_SerializedScriptValue(this._data); 12707 dynamic get data => _convertNativeToDart_SerializedScriptValue(this._data);
12668 dynamic get _data => JS("dynamic", "#.data", this); 12708 dynamic get _data => JS("dynamic", "#.data", this);
12669 12709
12670 /** @domName MessageEvent.lastEventId */ 12710 /** @domName MessageEvent.lastEventId */
12671 final String lastEventId; 12711 final String lastEventId;
12672 12712
12673 /** @domName MessageEvent.origin */ 12713 /** @domName MessageEvent.origin */
12674 final String origin; 12714 final String origin;
12675 12715
12676 /** @domName MessageEvent.ports */ 12716 /** @domName MessageEvent.ports */
12677 final List ports; 12717 final List<MessagePort> ports;
12678 12718
12679 /** @domName MessageEvent.source */ 12719 /** @domName MessageEvent.source */
12680 Window get source => _convertNativeToDart_Window(this._source); 12720 Window get source => _convertNativeToDart_Window(this._source);
12681 dynamic get _source => JS("dynamic", "#.source", this); 12721 dynamic get _source => JS("dynamic", "#.source", this);
12682 12722
12683 /** @domName MessageEvent.initMessageEvent */ 12723 /** @domName MessageEvent.initMessageEvent */
12684 void initMessageEvent(String typeArg, bool canBubbleArg, bool cancelableArg, O bject dataArg, String originArg, String lastEventIdArg, LocalWindow sourceArg, L ist messagePorts) native; 12724 void initMessageEvent(String typeArg, bool canBubbleArg, bool cancelableArg, O bject dataArg, String originArg, String lastEventIdArg, LocalWindow sourceArg, L ist messagePorts) native;
12685 12725
12686 /** @domName MessageEvent.webkitInitMessageEvent */ 12726 /** @domName MessageEvent.webkitInitMessageEvent */
12687 void webkitInitMessageEvent(String typeArg, bool canBubbleArg, bool cancelable Arg, Object dataArg, String originArg, String lastEventIdArg, LocalWindow source Arg, List transferables) native; 12727 void webkitInitMessageEvent(String typeArg, bool canBubbleArg, bool cancelable Arg, Object dataArg, String originArg, String lastEventIdArg, LocalWindow source Arg, List transferables) native;
(...skipping 2806 matching lines...) Expand 10 before | Expand all | Expand 10 after
15494 15534
15495 List<Map> getRange(int start, int rangeLength) => 15535 List<Map> getRange(int start, int rangeLength) =>
15496 _Lists.getRange(this, start, rangeLength, <Map>[]); 15536 _Lists.getRange(this, start, rangeLength, <Map>[]);
15497 15537
15498 // -- end List<Map> mixins. 15538 // -- end List<Map> mixins.
15499 15539
15500 /** @domName SQLResultSetRowList.item */ 15540 /** @domName SQLResultSetRowList.item */
15501 Map item(int index) { 15541 Map item(int index) {
15502 return _convertNativeToDart_Dictionary(_item_1(index)); 15542 return _convertNativeToDart_Dictionary(_item_1(index));
15503 } 15543 }
15544 @_createsJsObject
15504 _item_1(index) native "item"; 15545 _item_1(index) native "item";
15546
15547 static const _createsJsObject = const Creates('=Object');
15505 } 15548 }
15506 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 15549 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
15507 // for details. All rights reserved. Use of this source code is governed by a 15550 // for details. All rights reserved. Use of this source code is governed by a
15508 // BSD-style license that can be found in the LICENSE file. 15551 // BSD-style license that can be found in the LICENSE file.
15509 15552
15510 // WARNING: Do not edit - generated code. 15553 // WARNING: Do not edit - generated code.
15511 15554
15512 15555
15513 typedef void SQLStatementCallback(SQLTransaction transaction, SQLResultSet resul tSet); 15556 typedef void SQLStatementCallback(SQLTransaction transaction, SQLResultSet resul tSet);
15514 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 15557 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
(...skipping 4264 matching lines...) Expand 10 before | Expand all | Expand 10 after
19779 /** @domName WorkerContext.close */ 19822 /** @domName WorkerContext.close */
19780 void close() native; 19823 void close() native;
19781 19824
19782 /** @domName WorkerContext.dispatchEvent */ 19825 /** @domName WorkerContext.dispatchEvent */
19783 bool $dom_dispatchEvent(Event evt) native "dispatchEvent"; 19826 bool $dom_dispatchEvent(Event evt) native "dispatchEvent";
19784 19827
19785 /** @domName WorkerContext.importScripts */ 19828 /** @domName WorkerContext.importScripts */
19786 void importScripts() native; 19829 void importScripts() native;
19787 19830
19788 /** @domName WorkerContext.openDatabase */ 19831 /** @domName WorkerContext.openDatabase */
19832 @_createsDatabase
19789 Database openDatabase(String name, String version, String displayName, int est imatedSize, [DatabaseCallback creationCallback]) native; 19833 Database openDatabase(String name, String version, String displayName, int est imatedSize, [DatabaseCallback creationCallback]) native;
19790 19834
19791 /** @domName WorkerContext.openDatabaseSync */ 19835 /** @domName WorkerContext.openDatabaseSync */
19836 @_createsDatabase
19792 DatabaseSync openDatabaseSync(String name, String version, String displayName, int estimatedSize, [DatabaseCallback creationCallback]) native; 19837 DatabaseSync openDatabaseSync(String name, String version, String displayName, int estimatedSize, [DatabaseCallback creationCallback]) native;
19793 19838
19794 /** @domName WorkerContext.removeEventListener */ 19839 /** @domName WorkerContext.removeEventListener */
19795 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native "removeEventListener"; 19840 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native "removeEventListener";
19796 19841
19797 /** @domName WorkerContext.setInterval */ 19842 /** @domName WorkerContext.setInterval */
19798 int setInterval(TimeoutHandler handler, int timeout) native; 19843 int setInterval(TimeoutHandler handler, int timeout) native;
19799 19844
19800 /** @domName WorkerContext.setTimeout */ 19845 /** @domName WorkerContext.setTimeout */
19801 int setTimeout(TimeoutHandler handler, int timeout) native; 19846 int setTimeout(TimeoutHandler handler, int timeout) native;
(...skipping 4358 matching lines...) Expand 10 before | Expand all | Expand 10 after
24160 if (e is List) { 24205 if (e is List) {
24161 // Since a JavaScript Array is an instance of Dart List it is possible to 24206 // Since a JavaScript Array is an instance of Dart List it is possible to
24162 // avoid making a copy of the list if there is no need to copy anything 24207 // avoid making a copy of the list if there is no need to copy anything
24163 // reachable from the array. We defer creating a new array until a cycle 24208 // reachable from the array. We defer creating a new array until a cycle
24164 // is detected or a subgraph was copied. 24209 // is detected or a subgraph was copied.
24165 int length = e.length; 24210 int length = e.length;
24166 var slot = findSlot(e); 24211 var slot = findSlot(e);
24167 var copy = readSlot(slot); 24212 var copy = readSlot(slot);
24168 if (copy != null) { 24213 if (copy != null) {
24169 if (true == copy) { // Cycle, so commit to making a copy. 24214 if (true == copy) { // Cycle, so commit to making a copy.
24170 copy = JS('List', 'new Array(#)', length); 24215 copy = JS('=List', 'new Array(#)', length);
24171 writeSlot(slot, copy); 24216 writeSlot(slot, copy);
24172 } 24217 }
24173 return copy; 24218 return copy;
24174 } 24219 }
24175 24220
24176 int i = 0; 24221 int i = 0;
24177 24222
24178 if (_isJavaScriptArray(e) && 24223 if (_isJavaScriptArray(e) &&
24179 // We have to copy immutable lists, otherwise the structured clone 24224 // We have to copy immutable lists, otherwise the structured clone
24180 // algorithm will copy the .immutable$list marker property, making the 24225 // algorithm will copy the .immutable$list marker property, making the
24181 // list immutable when received! 24226 // list immutable when received!
24182 !_isImmutableJavaScriptArray(e)) { 24227 !_isImmutableJavaScriptArray(e)) {
24183 writeSlot(slot, true); // Deferred copy. 24228 writeSlot(slot, true); // Deferred copy.
24184 for ( ; i < length; i++) { 24229 for ( ; i < length; i++) {
24185 var element = e[i]; 24230 var element = e[i];
24186 var elementCopy = walk(element); 24231 var elementCopy = walk(element);
24187 if (!identical(elementCopy, element)) { 24232 if (!identical(elementCopy, element)) {
24188 copy = readSlot(slot); // Cyclic reference may have created it. 24233 copy = readSlot(slot); // Cyclic reference may have created it.
24189 if (true == copy) { 24234 if (true == copy) {
24190 copy = JS('List', 'new Array(#)', length); 24235 copy = JS('=List', 'new Array(#)', length);
24191 writeSlot(slot, copy); 24236 writeSlot(slot, copy);
24192 } 24237 }
24193 for (int j = 0; j < i; j++) { 24238 for (int j = 0; j < i; j++) {
24194 copy[j] = e[j]; 24239 copy[j] = e[j];
24195 } 24240 }
24196 copy[i] = elementCopy; 24241 copy[i] = elementCopy;
24197 i++; 24242 i++;
24198 break; 24243 break;
24199 } 24244 }
24200 } 24245 }
24201 if (copy == null) { 24246 if (copy == null) {
24202 copy = e; 24247 copy = e;
24203 writeSlot(slot, copy); 24248 writeSlot(slot, copy);
24204 } 24249 }
24205 } else { 24250 } else {
24206 // Not a JavaScript Array. We are forced to make a copy. 24251 // Not a JavaScript Array. We are forced to make a copy.
24207 copy = JS('List', 'new Array(#)', length); 24252 copy = JS('=List', 'new Array(#)', length);
24208 writeSlot(slot, copy); 24253 writeSlot(slot, copy);
24209 } 24254 }
24210 24255
24211 for ( ; i < length; i++) { 24256 for ( ; i < length; i++) {
24212 copy[i] = walk(e[i]); 24257 copy[i] = walk(e[i]);
24213 } 24258 }
24214 return copy; 24259 return copy;
24215 } 24260 }
24216 24261
24217 throw new UnimplementedError('structured clone of other type'); 24262 throw new UnimplementedError('structured clone of other type');
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
24291 } 24336 }
24292 24337
24293 if (_isJavaScriptArray(e)) { 24338 if (_isJavaScriptArray(e)) {
24294 var slot = findSlot(e); 24339 var slot = findSlot(e);
24295 var copy = readSlot(slot); 24340 var copy = readSlot(slot);
24296 if (copy != null) return copy; 24341 if (copy != null) return copy;
24297 24342
24298 int length = e.length; 24343 int length = e.length;
24299 // Since a JavaScript Array is an instance of Dart List, we can modify it 24344 // Since a JavaScript Array is an instance of Dart List, we can modify it
24300 // in-place unless we must copy. 24345 // in-place unless we must copy.
24301 copy = mustCopy ? JS('List', 'new Array(#)', length) : e; 24346 copy = mustCopy ? JS('=List', 'new Array(#)', length) : e;
24302 writeSlot(slot, copy); 24347 writeSlot(slot, copy);
24303 24348
24304 for (int i = 0; i < length; i++) { 24349 for (int i = 0; i < length; i++) {
24305 copy[i] = walk(e[i]); 24350 copy[i] = walk(e[i]);
24306 } 24351 }
24307 return copy; 24352 return copy;
24308 } 24353 }
24309 24354
24310 // Assume anything else is already a valid Dart object, either by having 24355 // Assume anything else is already a valid Dart object, either by having
24311 // already been processed, or e.g. a clonable native class. 24356 // already been processed, or e.g. a clonable native class.
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
24844 if (length < 0) throw new ArgumentError('length'); 24889 if (length < 0) throw new ArgumentError('length');
24845 if (start < 0) throw new RangeError.value(start); 24890 if (start < 0) throw new RangeError.value(start);
24846 int end = start + length; 24891 int end = start + length;
24847 if (end > a.length) throw new RangeError.value(end); 24892 if (end > a.length) throw new RangeError.value(end);
24848 for (int i = start; i < end; i++) { 24893 for (int i = start; i < end; i++) {
24849 accumulator.add(a[i]); 24894 accumulator.add(a[i]);
24850 } 24895 }
24851 return accumulator; 24896 return accumulator;
24852 } 24897 }
24853 } 24898 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698