diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart index fc0976c3007..0d5160ffb7e 100644 --- a/sdk/lib/html/dart2js/html_dart2js.dart +++ b/sdk/lib/html/dart2js/html_dart2js.dart @@ -665,7 +665,7 @@ class Animation extends EventTarget { set effect(AnimationEffectReadOnly? value) native; Future get finished => - promiseToFuture(JS("creates:Animation;", "#.finished", this)); + promiseToFuture(JS("", "#.finished", this)); String? get id native; @@ -678,7 +678,7 @@ class Animation extends EventTarget { set playbackRate(num? value) native; Future get ready => - promiseToFuture(JS("creates:Animation;", "#.ready", this)); + promiseToFuture(JS("", "#.ready", this)); num? get startTime native; @@ -1354,18 +1354,13 @@ class BackgroundFetchManager extends Interceptor { if (options != null) { options_dict = convertDartToNative_Dictionary(options); } - return promiseToFuture(JS( - "creates:BackgroundFetchRegistration;", - "#.fetch(#, #, #)", - this, - id, - requests, - options_dict)); + return promiseToFuture( + JS("", "#.fetch(#, #, #)", this, id, requests, options_dict)); } Future get(String id) => promiseToFuture( - JS("creates:BackgroundFetchRegistration;", "#.get(#)", this, id)); + JS("", "#.get(#)", this, id)); Future> getIds() => promiseToFuture>(JS("", "#.getIds()", this)); @@ -1681,11 +1676,10 @@ class Body extends Interceptor { Future arrayBuffer() => promiseToFuture(JS("", "#.arrayBuffer()", this)); - Future blob() => - promiseToFuture(JS("creates:Blob;", "#.blob()", this)); + Future blob() => promiseToFuture(JS("", "#.blob()", this)); Future formData() => - promiseToFuture(JS("creates:FormData;", "#.formData()", this)); + promiseToFuture(JS("", "#.formData()", this)); Future json() => promiseToFuture(JS("", "#.json()", this)); @@ -2020,17 +2014,17 @@ class CacheStorage extends Interceptor { Future keys() => promiseToFuture(JS("", "#.keys()", this)); - Future<_Response> match(/*RequestInfo*/ request, [Map? options]) { + Future match(/*RequestInfo*/ request, [Map? options]) { var options_dict = null; if (options != null) { options_dict = convertDartToNative_Dictionary(options); } - return promiseToFuture<_Response>( - JS("creates:_Response;", "#.match(#, #)", this, request, options_dict)); + return promiseToFuture( + JS("", "#.match(#, #)", this, request, options_dict)); } - Future<_Cache> open(String cacheName) => promiseToFuture<_Cache>( - JS("creates:_Cache;", "#.open(#)", this, cacheName)); + Future open(String cacheName) => + promiseToFuture(JS("", "#.open(#)", this, cacheName)); } // 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 @@ -3071,8 +3065,8 @@ class Clients extends Interceptor { JS("", "#.matchAll(#)", this, options_dict)); } - Future openWindow(String url) => promiseToFuture( - JS("creates:WindowClient;", "#.openWindow(#)", this, url)); + Future openWindow(String url) => + promiseToFuture(JS("", "#.openWindow(#)", this, url)); } // 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 @@ -3235,12 +3229,12 @@ class CookieStore extends Interceptor { throw new UnsupportedError("Not supported"); } - Future?> getAll([Map? options]) { + Future getAll([Map? options]) { var options_dict = null; if (options != null) { options_dict = convertDartToNative_Dictionary(options); } - return promiseToFutureAsMap(JS("", "#.getAll(#)", this, options_dict)); + return promiseToFuture(JS("", "#.getAll(#)", this, options_dict)); } Future set(String name, String value, [Map? options]) { @@ -3319,22 +3313,20 @@ class CredentialsContainer extends Interceptor { throw new UnsupportedError("Not supported"); } - Future create([Map? options]) { + Future create([Map? options]) { var options_dict = null; if (options != null) { options_dict = convertDartToNative_Dictionary(options); } - return promiseToFuture( - JS("creates:Credential;", "#.create(#)", this, options_dict)); + return promiseToFuture(JS("", "#.create(#)", this, options_dict)); } - Future get([Map? options]) { + Future get([Map? options]) { var options_dict = null; if (options != null) { options_dict = convertDartToNative_Dictionary(options); } - return promiseToFuture( - JS("creates:Credential;", "#.get(#)", this, options_dict)); + return promiseToFuture(JS("", "#.get(#)", this, options_dict)); } Future preventSilentAccess() => @@ -3343,9 +3335,8 @@ class CredentialsContainer extends Interceptor { Future requireUserMediation() => promiseToFuture(JS("", "#.requireUserMediation()", this)); - Future store(Credential credential) => - promiseToFuture( - JS("creates:Credential;", "#.store(#)", this, credential)); + Future store(Credential credential) => + promiseToFuture(JS("", "#.store(#)", this, credential)); } // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a @@ -16497,7 +16488,7 @@ class FontFace extends Interceptor { set featureSettings(String? value) native; Future get loaded => - promiseToFuture(JS("creates:FontFace;", "#.loaded", this)); + promiseToFuture(JS("", "#.loaded", this)); String? get status native; @@ -16522,7 +16513,7 @@ class FontFace extends Interceptor { set weight(String? value) native; Future load() => - promiseToFuture(JS("creates:FontFace;", "#.load()", this)); + promiseToFuture(JS("", "#.load()", this)); } // 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 @@ -18873,13 +18864,13 @@ class ImageCapture extends Interceptor { Future getPhotoCapabilities() => promiseToFuture( - JS("creates:PhotoCapabilities;", "#.getPhotoCapabilities()", this)); + JS("", "#.getPhotoCapabilities()", this)); Future?> getPhotoSettings() => promiseToFutureAsMap(JS("", "#.getPhotoSettings()", this)); - Future grabFrame() => promiseToFuture( - JS("creates:ImageBitmap;", "#.grabFrame()", this)); + Future grabFrame() => + promiseToFuture(JS("", "#.grabFrame()", this)); Future setOptions(Map photoSettings) { var photoSettings_dict = convertDartToNative_Dictionary(photoSettings); @@ -18892,7 +18883,7 @@ class ImageCapture extends Interceptor { photoSettings_dict = convertDartToNative_Dictionary(photoSettings); } return promiseToFuture( - JS("creates:Blob;", "#.takePhoto(#)", this, photoSettings_dict)); + JS("", "#.takePhoto(#)", this, photoSettings_dict)); } } // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file @@ -20477,20 +20468,14 @@ class MediaCapabilities extends Interceptor { Future decodingInfo(Map configuration) { var configuration_dict = convertDartToNative_Dictionary(configuration); - return promiseToFuture(JS( - "creates:MediaCapabilitiesInfo;", - "#.decodingInfo(#)", - this, - configuration_dict)); + return promiseToFuture( + JS("", "#.decodingInfo(#)", this, configuration_dict)); } Future encodingInfo(Map configuration) { var configuration_dict = convertDartToNative_Dictionary(configuration); - return promiseToFuture(JS( - "creates:MediaCapabilitiesInfo;", - "#.encodingInfo(#)", - this, - configuration_dict)); + return promiseToFuture( + JS("", "#.encodingInfo(#)", this, configuration_dict)); } } // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file @@ -20555,8 +20540,8 @@ class MediaDevices extends EventTarget { if (constraints != null) { constraints_dict = convertDartToNative_Dictionary(constraints); } - return promiseToFuture(JS( - "creates:MediaStream;", "#.getUserMedia(#)", this, constraints_dict)); + return promiseToFuture( + JS("", "#.getUserMedia(#)", this, constraints_dict)); } } // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file @@ -20863,8 +20848,8 @@ class MediaKeySystemAccess extends Interceptor { String? get keySystem native; - Future createMediaKeys() => promiseToFuture( - JS("creates:MediaKeys;", "#.createMediaKeys()", this)); + Future createMediaKeys() => + promiseToFuture(JS("", "#.createMediaKeys()", this)); Map getConfiguration() { return convertNativeToDart_Dictionary(_getConfiguration_1())!; @@ -20887,8 +20872,8 @@ class MediaKeys extends Interceptor { @JSName('createSession') MediaKeySession _createSession([String? sessionType]) native; - Future getStatusForPolicy(MediaKeysPolicy policy) => - promiseToFuture(JS("", "#.getStatusForPolicy(#)", this, policy)); + Future getStatusForPolicy(MediaKeysPolicy policy) => + promiseToFuture(JS("", "#.getStatusForPolicy(#)", this, policy)); Future setServerCertificate(/*BufferSource*/ serverCertificate) => promiseToFuture( @@ -21354,12 +21339,12 @@ class MediaStreamTrack extends EventTarget { String? get readyState native; - Future?> applyConstraints([Map? constraints]) { + Future applyConstraints([Map? constraints]) { var constraints_dict = null; if (constraints != null) { constraints_dict = convertDartToNative_Dictionary(constraints); } - return promiseToFutureAsMap( + return promiseToFuture( JS("", "#.applyConstraints(#)", this, constraints_dict)); } @@ -22756,11 +22741,10 @@ class Navigator extends NavigatorConcurrentHardware List _getGamepads() native; Future getInstalledRelatedApps() => - promiseToFuture(JS( - "creates:RelatedApplication;", "#.getInstalledRelatedApps()", this)); + promiseToFuture( + JS("", "#.getInstalledRelatedApps()", this)); - Future> getVRDisplays() => promiseToFuture>( - JS("creates:VRDisplay;", "#.getVRDisplays()", this)); + Future getVRDisplays() => promiseToFuture(JS("", "#.getVRDisplays()", this)); @Unstable() void registerProtocolHandler(String scheme, String url, String title) native; @@ -22790,14 +22774,10 @@ class Navigator extends NavigatorConcurrentHardware JS("", "#.requestMIDIAccess(#)", this, options_dict)); } - Future requestMediaKeySystemAccess( + Future requestMediaKeySystemAccess( String keySystem, List supportedConfigurations) => - promiseToFuture(JS( - "creates:MediaKeySystemAccess;", - "#.requestMediaKeySystemAccess(#, #)", - this, - keySystem, - supportedConfigurations)); + promiseToFuture(JS("", "#.requestMediaKeySystemAccess(#, #)", this, + keySystem, supportedConfigurations)); bool sendBeacon(String url, Object? data) native; @@ -24001,7 +23981,7 @@ class OffscreenCanvas extends EventTarget { options_dict = convertDartToNative_Dictionary(options); } return promiseToFuture( - JS("creates:Blob;", "#.convertToBlob(#)", this, options_dict)); + JS("", "#.convertToBlob(#)", this, options_dict)); } Object? getContext(String contextType, [Map? attributes]) { @@ -25010,8 +24990,8 @@ class PaymentRequest extends EventTarget { Future canMakePayment() => promiseToFuture(JS("", "#.canMakePayment()", this)); - Future show() => promiseToFuture( - JS("creates:PaymentResponse;", "#.show()", this)); + Future show() => + promiseToFuture(JS("", "#.show()", this)); } // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file @@ -25049,8 +25029,8 @@ class PaymentRequestEvent extends ExtendableEvent { Object? get total native; - Future openWindow(String url) => promiseToFuture( - JS("creates:WindowClient;", "#.openWindow(#)", this, url)); + Future openWindow(String url) => + promiseToFuture(JS("", "#.openWindow(#)", this, url)); void respondWith(Future response) native; } @@ -25483,23 +25463,23 @@ class Permissions extends Interceptor { Future query(Map permission) { var permission_dict = convertDartToNative_Dictionary(permission); return promiseToFuture( - JS("creates:PermissionStatus;", "#.query(#)", this, permission_dict)); + JS("", "#.query(#)", this, permission_dict)); } Future request(Map permissions) { var permissions_dict = convertDartToNative_Dictionary(permissions); - return promiseToFuture(JS( - "creates:PermissionStatus;", "#.request(#)", this, permissions_dict)); + return promiseToFuture( + JS("", "#.request(#)", this, permissions_dict)); } Future requestAll(List permissions) => - promiseToFuture(JS( - "creates:PermissionStatus;", "#.requestAll(#)", this, permissions)); + promiseToFuture( + JS("", "#.requestAll(#)", this, permissions)); Future revoke(Map permission) { var permission_dict = convertDartToNative_Dictionary(permission); return promiseToFuture( - JS("creates:PermissionStatus;", "#.revoke(#)", this, permission_dict)); + JS("", "#.revoke(#)", this, permission_dict)); } } // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file @@ -25918,7 +25898,7 @@ class PresentationReceiver extends Interceptor { Future get connectionList => promiseToFuture( - JS("creates:PresentationConnectionList;", "#.connectionList", this)); + JS("", "#.connectionList", this)); } // 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 @@ -25948,15 +25928,14 @@ class PresentationRequest extends EventTarget { Future getAvailability() => promiseToFuture( - JS("creates:PresentationAvailability;", "#.getAvailability()", this)); + JS("", "#.getAvailability()", this)); Future reconnect(String id) => promiseToFuture( - JS("creates:PresentationConnection;", "#.reconnect(#)", this, id)); + JS("", "#.reconnect(#)", this, id)); Future start() => - promiseToFuture( - JS("creates:PresentationConnection;", "#.start()", this)); + promiseToFuture(JS("", "#.start()", this)); } // 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 @@ -26123,8 +26102,7 @@ class PushManager extends Interceptor { static List? get supportedContentEncodings native; Future getSubscription() => - promiseToFuture( - JS("creates:PushSubscription;", "#.getSubscription()", this)); + promiseToFuture(JS("", "#.getSubscription()", this)); Future permissionState([Map? options]) { var options_dict = null; @@ -26140,7 +26118,7 @@ class PushManager extends Interceptor { options_dict = convertDartToNative_Dictionary(options); } return promiseToFuture( - JS("creates:PushSubscription;", "#.subscribe(#)", this, options_dict)); + JS("", "#.subscribe(#)", this, options_dict)); } } // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file @@ -26958,11 +26936,8 @@ class RtcPeerConnection extends EventTarget { if (options != null) { options_dict = convertDartToNative_Dictionary(options); } - return promiseToFuture(JS( - "creates:RtcSessionDescription;", - "#.createAnswer(#)", - this, - options_dict)); + return promiseToFuture( + JS("", "#.createAnswer(#)", this, options_dict)); } @JSName('createDTMFSender') @@ -26986,11 +26961,8 @@ class RtcPeerConnection extends EventTarget { if (options != null) { options_dict = convertDartToNative_Dictionary(options); } - return promiseToFuture(JS( - "creates:RtcSessionDescription;", - "#.createOffer(#)", - this, - options_dict)); + return promiseToFuture( + JS("", "#.createOffer(#)", this, options_dict)); } List getLocalStreams() native; @@ -27001,8 +26973,8 @@ class RtcPeerConnection extends EventTarget { List getSenders() native; - Future getStats() => promiseToFuture( - JS("creates:RtcStatsReport;", "#.getStats()", this)); + Future getStats() => + promiseToFuture(JS("", "#.getStats()", this)); void removeStream(MediaStream? stream) native; @@ -27790,15 +27762,11 @@ class ServiceWorkerContainer extends EventTarget { ServiceWorker? get controller native; Future get ready => - promiseToFuture( - JS("creates:ServiceWorkerRegistration;", "#.ready", this)); + promiseToFuture(JS("", "#.ready", this)); Future getRegistration([String? documentURL]) => - promiseToFuture(JS( - "creates:ServiceWorkerRegistration;", - "#.getRegistration(#)", - this, - documentURL)); + promiseToFuture( + JS("", "#.getRegistration(#)", this, documentURL)); Future> getRegistrations() => promiseToFuture>(JS("", "#.getRegistrations()", this)); @@ -27808,12 +27776,8 @@ class ServiceWorkerContainer extends EventTarget { if (options != null) { options_dict = convertDartToNative_Dictionary(options); } - return promiseToFuture(JS( - "creates:ServiceWorkerRegistration;", - "#.register(#, #)", - this, - url, - options_dict)); + return promiseToFuture( + JS("", "#.register(#, #)", this, url, options_dict)); } Stream get onMessage => messageEvent.forTarget(this); @@ -31238,14 +31202,13 @@ class VRSession extends EventTarget { Future end() => promiseToFuture(JS("", "#.end()", this)); - Future requestFrameOfReference(String type, - [Map? options]) { + Future requestFrameOfReference(String type, [Map? options]) { var options_dict = null; if (options != null) { options_dict = convertDartToNative_Dictionary(options); } - return promiseToFuture(JS("creates:VRFrameOfReference;", - "#.requestFrameOfReference(#, #)", this, type, options_dict)); + return promiseToFuture( + JS("", "#.requestFrameOfReference(#, #)", this, type, options_dict)); } Stream get onBlur => blurEvent.forTarget(this); @@ -32886,13 +32849,12 @@ class Window extends EventTarget */ bool confirm([String? message]) native; - Future<_Response> fetch(/*RequestInfo*/ input, [Map? init]) { + Future fetch(/*RequestInfo*/ input, [Map? init]) { var init_dict = null; if (init != null) { init_dict = convertDartToNative_Dictionary(init); } - return promiseToFuture<_Response>( - JS("creates:_Response;", "#.fetch(#, #)", this, input, init_dict)); + return promiseToFuture(JS("", "#.fetch(#, #)", this, input, init_dict)); } /** @@ -33797,11 +33759,11 @@ class WindowClient extends Client { String? get visibilityState native; - Future focus() => promiseToFuture( - JS("creates:WindowClient;", "#.focus()", this)); + Future focus() => + promiseToFuture(JS("", "#.focus()", this)); - Future navigate(String url) => promiseToFuture( - JS("creates:WindowClient;", "#.navigate(#)", this, url)); + Future navigate(String url) => + promiseToFuture(JS("", "#.navigate(#)", this, url)); } // 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 @@ -33956,13 +33918,12 @@ class WorkerGlobalScope extends EventTarget WorkerGlobalScope get self native; - Future<_Response> fetch(/*RequestInfo*/ input, [Map? init]) { + Future fetch(/*RequestInfo*/ input, [Map? init]) { var init_dict = null; if (init != null) { init_dict = convertDartToNative_Dictionary(init); } - return promiseToFuture<_Response>( - JS("creates:_Response;", "#.fetch(#, #)", this, input, init_dict)); + return promiseToFuture(JS("", "#.fetch(#, #)", this, input, init_dict)); } void importScripts(String urls) native; @@ -34373,8 +34334,8 @@ class _BudgetService extends Interceptor { throw new UnsupportedError("Not supported"); } - Future getBudget() => promiseToFuture( - JS("creates:BudgetState;", "#.getBudget()", this)); + Future getBudget() => + promiseToFuture(JS("", "#.getBudget()", this)); Future getCost(String operation) => promiseToFuture(JS("", "#.getCost(#)", this, operation)); @@ -34414,8 +34375,8 @@ class _Clipboard extends EventTarget { throw new UnsupportedError("Not supported"); } - Future read() => promiseToFuture( - JS("creates:DataTransfer;", "#.read()", this)); + Future read() => + promiseToFuture(JS("", "#.read()", this)); Future readText() => promiseToFuture(JS("", "#.readText()", this)); diff --git a/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart b/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart index a12d2fe6b2a..da12ab39429 100644 --- a/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart +++ b/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart @@ -682,13 +682,8 @@ class BaseAudioContext extends EventTarget { Future decodeAudioData(ByteBuffer audioData, [DecodeSuccessCallback? successCallback, DecodeErrorCallback? errorCallback]) => - promiseToFuture(JS( - "creates:AudioBuffer;", - "#.decodeAudioData(#, #, #)", - this, - audioData, - successCallback, - errorCallback)); + promiseToFuture(JS("", "#.decodeAudioData(#, #, #)", this, + audioData, successCallback, errorCallback)); Future resume() => promiseToFuture(JS("", "#.resume()", this)); } @@ -1080,8 +1075,8 @@ class OfflineAudioContext extends BaseAudioContext { int? get length native; - Future startRendering() => promiseToFuture( - JS("creates:AudioBuffer;", "#.startRendering()", this)); + Future startRendering() => + promiseToFuture(JS("", "#.startRendering()", this)); @JSName('suspend') Future suspendFor(num suspendTime) => diff --git a/tools/dom/scripts/systemhtml.py b/tools/dom/scripts/systemhtml.py index 0f7cbcb1f8c..0761fe6f32e 100644 --- a/tools/dom/scripts/systemhtml.py +++ b/tools/dom/scripts/systemhtml.py @@ -890,64 +890,53 @@ class HtmlDartInterfaceGenerator(object): promise_attributes = monitored.Dict( 'systemhtml.promise_attr_type', { "Animation.finished": { - "type": "Animation", - "creates": "Animation" + "type": "Animation" }, "Animation.ready": { - "type": "Animation", - "creates": "Animation" + "type": "Animation" }, "BeforeInstallPromptEvent.userChoice": { "type": "dictionary" }, "FontFace.loaded": { - "type": "FontFace", - "creates": "FontFace" + "type": "FontFace" }, "FontFaceSet.ready": { - "type": "FontFaceSet", - "creates": "FontFaceSet" + "type": "FontFaceSet" }, "MediaKeySession.closed": { "type": "void" }, "PresentationReceiver.connectionList": { - "type": "PresentationConnectionList", - "creates": "PresentationConnectionList" + "type": "PresentationConnectionList" }, "ServiceWorkerContainer.ready": { - "type": "ServiceWorkerRegistration", - "creates": "ServiceWorkerRegistration" + "type": "ServiceWorkerRegistration" }, }) promise_operations = monitored.Dict( 'systemhtml.promise_oper_type', { "Clipboard.read": { - "type": "DataTransfer", - "creates": "DataTransfer" + "type": "DataTransfer" }, "Clipboard.readText": { "type": "String" }, "FontFace.load": { - "type": "FontFace", - "creates": "FontFace" + "type": "FontFace" }, "FontFaceSet.load": { "type": "List" }, "OffscreenCanvas.load": { - "type": "Blob", - "creates": "Blob" + "type": "Blob" }, "BackgroundFetchManager.fetch": { - "type": "BackgroundFetchRegistration", - "creates": "BackgroundFetchRegistration" + "type": "BackgroundFetchRegistration" }, "BackgroundFetchManager.get": { - "type": "BackgroundFetchRegistration", - "creates": "BackgroundFetchRegistration" + "type": "BackgroundFetchRegistration" }, "BackgroundFetchManager.getIds": { "type": "List" @@ -962,60 +951,49 @@ promise_operations = monitored.Dict( "type": "double" }, "BudgetService.getBudget": { - "type": "BudgetState", - "creates": "BudgetState" + "type": "BudgetState" }, "BudgetService.reserve": { "type": "bool" }, "Body.blob": { - "type": "Blob", - "creates": "Blob" + "type": "Blob" }, "Body.formData": { - "type": "FormData", - "creates": "FormData" + "type": "FormData" }, "Body.text": { "type": "String" }, "ImageCapture.getPhotoCapabilities": { - "type": "PhotoCapabilities", - "creates": "PhotoCapabilities" + "type": "PhotoCapabilities" }, "ImageCapture.getPhotoSettings": { "type": "dictionary" }, "ImageCapture.takePhoto": { - "type": "Blob", - "creates": "Blob" + "type": "Blob" }, "ImageCapture.grabFrame": { - "type": "ImageBitmap", - "creates": "ImageBitmap" + "type": "ImageBitmap" }, "Navigator.getInstalledRelatedApps": { - "type": "RelatedApplication", - "creates": "RelatedApplication" + "type": "RelatedApplication" }, "OffscreenCanvas.convertToBlob": { - "type": "Blob", - "creates": "Blob" + "type": "Blob" }, "MediaCapabilities.decodingInfo": { - "type": "MediaCapabilitiesInfo", - "creates": "MediaCapabilitiesInfo" + "type": "MediaCapabilitiesInfo" }, "MediaCapabilities.encodingInfo": { - "type": "MediaCapabilitiesInfo", - "creates": "MediaCapabilitiesInfo" + "type": "MediaCapabilitiesInfo" }, "MediaDevices.enumerateDevices": { "type": "List" }, "MediaDevices.getUserMedia": { - "type": "MediaStream", - "creates": "MediaStream" + "type": "MediaStream" }, "ServiceWorkerRegistration.getNotifications": { "type": "List" @@ -1033,68 +1011,53 @@ promise_operations = monitored.Dict( "type": "bool" }, "PaymentRequest.show": { - "type": "PaymentResponse", - "creates": "PaymentResponse" + "type": "PaymentResponse" }, "PaymentRequest.canMakePayment": { "type": "bool" }, "PaymentRequestEvent.openWindow": { - "type": "WindowClient", - "creates": "WindowClient" + "type": "WindowClient" }, "RTCPeerConnection.createOffer": { - "type": "RtcSessionDescription", - "creates": "RtcSessionDescription" + "type": "RtcSessionDescription" }, "RTCPeerConnection.createAnswer": { - "type": "RtcSessionDescription", - "creates": "RtcSessionDescription" + "type": "RtcSessionDescription" }, "RTCPeerConnection.getStats": { "type": "RtcStatsReport", - "maplike": "RTCStatsReport", - "creates": "RtcStatsReport" + "maplike": "RTCStatsReport" }, "RTCPeerConnection.generateCertificate": { - "type": "RtcCertificate", - "creates": "RtcCertificate" + "type": "RtcCertificate" }, "Permissions.query": { - "type": "PermissionStatus", - "creates": "PermissionStatus" + "type": "PermissionStatus" }, "Permissions.request": { - "type": "PermissionStatus", - "creates": "PermissionStatus" + "type": "PermissionStatus" }, "Permissions.revoke": { - "type": "PermissionStatus", - "creates": "PermissionStatus" + "type": "PermissionStatus" }, "Permissions.requestAll": { - "type": "PermissionStatus", - "creates": "PermissionStatus" + "type": "PermissionStatus" }, "PresentationRequest.start": { - "type": "PresentationConnection", - "creates": "PresentationConnection" + "type": "PresentationConnection" }, "PresentationRequest.reconnect": { - "type": "PresentationConnection", - "creates": "PresentationConnection" + "type": "PresentationConnection" }, "PresentationRequest.getAvailability": { - "type": "PresentationAvailability", - "creates": "PresentationAvailability" + "type": "PresentationAvailability" }, "PushManager.subscribe": { - "type": "PushSubscription", - "creates": "PushSubscription" + "type": "PushSubscription" }, "PushManager.getSubscription": { - "type": "PushSubscription", - "creates": "PushSubscription" + "type": "PushSubscription" }, "PushSubscription.unsubscribe": { "type": "bool" @@ -1115,37 +1078,31 @@ promise_operations = monitored.Dict( "type": "List" }, "Clients.openWindow": { - "type": "WindowClient", - "creates": "WindowClient" + "type": "WindowClient" }, "NavigationPreloadManager.getState": { "type": "dictionary" }, "ServiceWorkerContainer.register": { - "type": "ServiceWorkerRegistration", - "creates": "ServiceWorkerRegistration" + "type": "ServiceWorkerRegistration" }, "ServiceWorkerContainer.getRegistration": { - "type": "ServiceWorkerRegistration", - "creates": "ServiceWorkerRegistration" + "type": "ServiceWorkerRegistration" }, "ServiceWorkerContainer.getRegistrations": { "type": "List" }, "ServiceWorkerGlobalScope.fetch": { - "type": "_Response", - "creates": "_Response" + "type": "Response" }, "ServiceWorkerRegistration.unregister": { "type": "bool" }, "WindowClient.focus": { - "type": "WindowClient", - "creates": "WindowClient" + "type": "WindowClient" }, "WindowClient.navigate": { - "type": "WindowClient", - "creates": "WindowClient" + "type": "WindowClient" }, "BarcodeDetector.detect": { "type": "List" @@ -1157,71 +1114,10 @@ promise_operations = monitored.Dict( "type": "List" }, "BaseAudioContext.decodeAudioData": { - "type": "AudioBuffer", - "creates": "AudioBuffer" + "type": "AudioBuffer" }, "OfflineAudioContext.startRendering": { - "type": "AudioBuffer", - "creates": "AudioBuffer" - }, - "CacheStorage.match": { - "type": "_Response", - "creates": "_Response" - }, - "CacheStorage.open": { - "type": "_Cache", - "creates": "_Cache" - }, - "CookieStore.getAll": { - "type": "dictionary" - }, - "CredentialsContainer.create": { - "type": "Credential", - "creates": "Credential" - }, - "CredentialsContainer.get": { - "type": "Credential", - "creates": "Credential" - }, - "CredentialsContainer.store": { - "type": "Credential", - "creates": "Credential" - }, - "FetchEvent.preloadResponse": { - "type": "_Response", - "creates": "_Response" - }, - "MediaKeys.getStatusForPolicy": { - # Actual return value is MediaKeyStatus, which is an IDL enum of - # strings. - "type": "String" - }, - "MediaKeySystemAccess.createMediaKeys": { - "type": "MediaKeys", - "creates": "MediaKeys" - }, - "MediaStreamTrack.applyConstraints": { - "type": "dictionary" - }, - "Navigator.getVRDisplays": { - "type": "List", - "creates": "VRDisplay" - }, - "Navigator.requestMediaKeySystemAccess": { - "type": "MediaKeySystemAccess", - "creates": "MediaKeySystemAccess" - }, - "VRSession.requestFrameOfReference": { - "type": "VRFrameOfReference", - "creates": "VRFrameOfReference" - }, - "Window.fetch": { - "type": "_Response", - "creates": "_Response" - }, - "WorkerGlobalScope.fetch": { - "type": "_Response", - "creates": "_Response" + "type": "AudioBuffer" }, }) @@ -1596,7 +1492,6 @@ class Dart2JSBackend(HtmlDartGenerator): promiseFound = _GetPromiseAttributeType(lookupOp) promiseType = 'Future' promiseCall = 'promiseToFuture' - type_description = '' if promiseFound is not (None): if 'maplike' in promiseFound: promiseCall = 'promiseToFuture' @@ -1615,14 +1510,10 @@ class Dart2JSBackend(HtmlDartGenerator): promiseCall = 'promiseToFuture<%s>' % paramType promiseType = 'Future<%s>' % paramType - if 'creates' in promiseFound: - createsType = promiseFound['creates'] - type_description = 'creates:%s;' % createsType - if attribute.type.nullable: promiseType += '?' - template = '\n $RENAME$(ANNOTATIONS)$TYPE get $NAME => $PROMISE_CALL(JS("$TYPE_DESC", "#.$NAME", this));\n' + template = '\n $RENAME$(ANNOTATIONS)$TYPE get $NAME => $PROMISE_CALL(JS("", "#.$NAME", this));\n' self._members_emitter.Emit( template, @@ -1630,8 +1521,7 @@ class Dart2JSBackend(HtmlDartGenerator): ANNOTATIONS=metadata, TYPE=promiseType, PROMISE_CALL=promiseCall, - TYPE_DESC=type_description, - NAME=html_name,) + NAME=html_name) else: # Need to use a getter for list.length properties so we can # add a setter which throws an exception, satisfying List @@ -1843,12 +1733,11 @@ class Dart2JSBackend(HtmlDartGenerator): return resultType def _zeroArgs(self, argsNames): - return 'JS("$TYPE_DESC", "#.$JSNAME()", this)' + return 'JS("", "#.$JSNAME()", this)' def _manyArgs(self, numberArgs, argsNames): argsPound = "#" if numberArgs == 1 else ("#, " * numberArgs)[:-2] - template = ' JS("$TYPE_DESC", "#.$JSNAME(%s)", this, %s)' - return template % (argsPound, argsNames) + return ' JS("", "#.$JSNAME(%s)", this, %s)' % (argsPound, argsNames) """ If argument conversionsMapToDictionary is a list first entry is argument name and second entry signals if argument is optional (True). """ @@ -1923,7 +1812,6 @@ class Dart2JSBackend(HtmlDartGenerator): promiseFound = _GetPromiseOperationType(lookupOp) promiseType = 'Future' promiseCall = 'promiseToFuture' - type_description = '' if promiseFound is not (None): paramType = promiseFound['type'] if 'maplike' in promiseFound: @@ -1946,10 +1834,6 @@ class Dart2JSBackend(HtmlDartGenerator): promiseCall = 'promiseToFuture<%s>' % paramType promiseType = 'Future<%s>' % paramType - if 'creates' in promiseFound: - createsType = promiseFound['creates'] - type_description = 'creates:%s;' % createsType - argsNames = info.ParametersAsArgumentList() dictionary_argument = info.dictionaryArgumentName() codeTemplate = self._promiseToFutureCode(argsNames, @@ -1967,7 +1851,6 @@ class Dart2JSBackend(HtmlDartGenerator): TYPE=promiseType, PROMISE_CALL=promiseCall, NAME=html_name, - TYPE_DESC=type_description, JSNAME=info.declared_name, PARAMS=info.ParametersAsDeclaration(self._NarrowInputType, force_optional))