Index: sdk/lib/html/dart2js/html_dart2js.dart |
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart |
index 8f57237866b59614b7124ae17e72be5eccd71d55..36793c2c992712eb14761663629023d61c534618 100644 |
--- a/sdk/lib/html/dart2js/html_dart2js.dart |
+++ b/sdk/lib/html/dart2js/html_dart2js.dart |
@@ -4442,6 +4442,10 @@ class CanvasRenderingContext native "*CanvasRenderingContext" { |
// BSD-style license that can be found in the LICENSE file. |
+const _createsImageData = const Creates( |
+ 'ImageData' /* Chrome */ |
+ '|=Object' /* FireFox*/); |
+ |
class CanvasRenderingContext2D extends CanvasRenderingContext native "*CanvasRenderingContext2D" { |
/** @domName CanvasRenderingContext2D.fillStyle */ |
@@ -4540,7 +4544,11 @@ class CanvasRenderingContext2D extends CanvasRenderingContext native "*CanvasRen |
} |
throw const Exception("Incorrect number or type of arguments"); |
} |
+ |
+ @_createsImageData |
_createImageData_1(imagedata) native "createImageData"; |
+ |
+ @_createsImageData |
_createImageData_2(num sw, sh) native "createImageData"; |
/** @domName CanvasRenderingContext2D.createLinearGradient */ |
@@ -5809,6 +5817,9 @@ class Database native "*Database" { |
typedef void DatabaseCallback(database); |
+ |
+const _createsDatabase = const Creates('Database|DatabaseSync'); |
+ |
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
// for details. All rights reserved. Use of this source code is governed by a |
// BSD-style license that can be found in the LICENSE file. |
@@ -9549,6 +9560,7 @@ class IDBCursor native "*IDBCursor" { |
final String direction; |
/** @domName IDBCursor.key */ |
+ @_createsIDBKey |
final Object key; |
/** @domName IDBCursor.primaryKey */ |
@@ -9588,10 +9600,23 @@ class IDBCursor native "*IDBCursor" { |
// BSD-style license that can be found in the LICENSE file. |
+const _createsSSV = const Creates( |
+ '=Object|=List|num|String|bool' |
+ // Date, RegExp, |
+ '|File|Blob|_FileList|ImageData' |
+ '|ArrayBuffer|ArrayBufferView' ); |
+ |
+const _createsIDBValue = _createsSSV; |
+ |
+const _createsIDBKey = const Creates( |
+ // Date, |
+ 'num|String|bool|=List'); |
+ |
/// @domName IDBCursorWithValue |
class IDBCursorWithValue extends IDBCursor native "*IDBCursorWithValue" { |
/** @domName IDBCursorWithValue.value */ |
+ @_createsIDBValue |
final Object value; |
} |
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
@@ -9766,7 +9791,10 @@ class IDBFactory native "*IDBFactory" { |
/** @domName IDBFactory.deleteDatabase */ |
IDBVersionChangeRequest deleteDatabase(String name) native; |
+ static const _createsIDBDatabase = const Creates('IDBDatabase'); |
+ static const _createsIDBRequest = const Creates('IDBRequest'); |
/** @domName IDBFactory.open */ |
+ @_createsIDBDatabase @_createsIDBRequest |
IDBOpenDBRequest open(String name, [int version]) native; |
/** @domName IDBFactory.webkitGetDatabaseNames */ |
@@ -10150,10 +10178,21 @@ class IDBObjectStore native "*IDBObjectStore" { |
} |
throw const Exception("Incorrect number or type of arguments"); |
} |
+ |
+ static const _xx1 = const Creates('IDBCursorWithValue|IDBCursor'); |
+ @_xx1 |
IDBRequest _openCursor_1() native "openCursor"; |
+ |
+ @_xx1 |
IDBRequest _openCursor_2(IDBKeyRange range) native "openCursor"; |
+ |
+ @_xx1 |
IDBRequest _openCursor_3(IDBKeyRange range, direction) native "openCursor"; |
+ |
+ @_xx1 |
IDBRequest _openCursor_4(key) native "openCursor"; |
+ |
+ @_xx1 |
IDBRequest _openCursor_5(key, direction) native "openCursor"; |
/** @domName IDBObjectStore.put */ |
@@ -11711,6 +11750,7 @@ class LocalWindow extends EventTarget implements Window native "@*DOMWindow" { |
void moveTo(num x, num y) native; |
/** @domName DOMWindow.openDatabase */ |
+ @_createsDatabase |
Database openDatabase(String name, String version, String displayName, int estimatedSize, [DatabaseCallback creationCallback]) native; |
/** @domName Window.postMessage */ |
@@ -12674,7 +12714,7 @@ class MessageEvent extends Event native "*MessageEvent" { |
final String origin; |
/** @domName MessageEvent.ports */ |
- final List ports; |
+ final List<MessagePort> ports; |
/** @domName MessageEvent.source */ |
Window get source => _convertNativeToDart_Window(this._source); |
@@ -15501,7 +15541,10 @@ class SQLResultSetRowList implements JavaScriptIndexingBehavior, List<Map> nativ |
Map item(int index) { |
return _convertNativeToDart_Dictionary(_item_1(index)); |
} |
+ @_createsJsObject |
_item_1(index) native "item"; |
+ |
+ static const _createsJsObject = const Creates('=Object'); |
} |
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
// for details. All rights reserved. Use of this source code is governed by a |
@@ -19786,9 +19829,11 @@ class WorkerContext extends EventTarget native "*WorkerContext" { |
void importScripts() native; |
/** @domName WorkerContext.openDatabase */ |
+ @_createsDatabase |
Database openDatabase(String name, String version, String displayName, int estimatedSize, [DatabaseCallback creationCallback]) native; |
/** @domName WorkerContext.openDatabaseSync */ |
+ @_createsDatabase |
DatabaseSync openDatabaseSync(String name, String version, String displayName, int estimatedSize, [DatabaseCallback creationCallback]) native; |
/** @domName WorkerContext.removeEventListener */ |
@@ -24167,7 +24212,7 @@ _convertDartToNative_PrepareForStructuredClone(value) { |
var copy = readSlot(slot); |
if (copy != null) { |
if (true == copy) { // Cycle, so commit to making a copy. |
- copy = JS('List', 'new Array(#)', length); |
+ copy = JS('=List', 'new Array(#)', length); |
writeSlot(slot, copy); |
} |
return copy; |
@@ -24187,7 +24232,7 @@ _convertDartToNative_PrepareForStructuredClone(value) { |
if (!identical(elementCopy, element)) { |
copy = readSlot(slot); // Cyclic reference may have created it. |
if (true == copy) { |
- copy = JS('List', 'new Array(#)', length); |
+ copy = JS('=List', 'new Array(#)', length); |
writeSlot(slot, copy); |
} |
for (int j = 0; j < i; j++) { |
@@ -24204,7 +24249,7 @@ _convertDartToNative_PrepareForStructuredClone(value) { |
} |
} else { |
// Not a JavaScript Array. We are forced to make a copy. |
- copy = JS('List', 'new Array(#)', length); |
+ copy = JS('=List', 'new Array(#)', length); |
writeSlot(slot, copy); |
} |
@@ -24298,7 +24343,7 @@ _convertNativeToDart_AcceptStructuredClone(object, {mustCopy = false}) { |
int length = e.length; |
// Since a JavaScript Array is an instance of Dart List, we can modify it |
// in-place unless we must copy. |
- copy = mustCopy ? JS('List', 'new Array(#)', length) : e; |
+ copy = mustCopy ? JS('=List', 'new Array(#)', length) : e; |
writeSlot(slot, copy); |
for (int i = 0; i < length; i++) { |