View Issue Details

IDProjectCategoryView StatusLast Update
0038721pas2jsrtlpublic2021-04-07 22:40
Reporterhenrique Assigned ToMichael Van Canneyt  
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionwon't fix 
PlatformPas2JsOSWindows 
Summary0038721: Adjusted fetch declarations
DescriptionAll Window.Fetch functions are asynchronous, but the declaration of the functions did not represent this.

I believe there should be some problem in the compiler, so this doesn't work as expected.

I removed some functions that didn't exist in the JS documents, to make everything equivalent.
TagsNo tags attached.
Fixed in Revision
Attached Files

Activities

henrique

2021-04-07 21:12

reporter   ~0130161

0001-Ajustado-a-declara-o-das-fun-es-fetch-por-que-s-o-to.patch (2,423 bytes)   
From 8b68db0d73570f00ff57a84e35d8828087fc603b Mon Sep 17 00:00:00 2001
From: Henrique Gottardi Werlang <henriquewerlang@hotmail.com>
Date: Wed, 7 Apr 2021 15:49:24 -0300
Subject: [PATCH] =?UTF-8?q?Ajustado=20a=20declara=C3=A7=C3=A3o=20das=20fun?=
 =?UTF-8?q?=C3=A7=C3=B5es=20fetch,=20por=20que=20s=C3=A3o=20todas=20assinc?=
 =?UTF-8?q?ronas...?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 packages/rtl/web.pas | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/packages/rtl/web.pas b/packages/rtl/web.pas
index f86945a3..17855d5a 100644
--- a/packages/rtl/web.pas
+++ b/packages/rtl/web.pas
@@ -2119,14 +2119,10 @@ TEventListenerEvent = class external name 'EventListener_Event' (TJSObject)
     procedure cancelAnimationFrame(aHandle: Integer);
     Procedure close;
     Function confirm(Const aMsg : String) :  boolean;
-    function fetch(resource: String; init: TJSObject): TJSPromise; overload; external name 'fetch';
-    //function fetch(resource: String): TJSPromise; overload; external name 'fetch';
     function fetch(resource: String): TJSResponse; {$IFNDEF SkipAsync}async;{$ENDIF} overload; external name 'fetch';
-    function fetch(resource: TJSObject; init: TJSObject): TJSPromise; overload; external name 'fetch';
-    function fetch(resource: TJSObject): TJSPromise; overload; external name 'fetch';
-    function asyncfetch(resource: String): TJSResponse; {$IFNDEF SkipAsync}async;{$ENDIF} overload; external name 'fetch';
-    function asyncfetch(resource: TJSObject; init: TJSObject): TJSResponse; {$IFNDEF SkipAsync} async;{$ENDIF} overload; external name 'fetch';
-    function asyncfetch(resource: TJSObject): TJSResponse;  {$IFNDEF SkipAsync}async;{$ENDIF}  overload;external name 'fetch';
+    function fetch(resource: String; init: TJSObject): TJSResponse; {$IFNDEF SkipAsync}async;{$ENDIF} overload; external name 'fetch';
+    function fetch(resource: TJSObject): TJSResponse; {$IFNDEF SkipAsync}async;{$ENDIF} overload; external name 'fetch';
+    function fetch(resource, init: TJSObject): TJSResponse; {$IFNDEF SkipAsync}async;{$ENDIF} overload; external name 'fetch';
     procedure focus;
     Function getComputedStyle(aElement : TJSElement) : TJSCSSStyleDeclaration; overload;
     Function getComputedStyle(aElement,aPseudoElement : TJSElement) : TJSCSSStyleDeclaration; overload;
-- 
2.31.1.windows.1

Michael Van Canneyt

2021-04-07 22:40

administrator   ~0130165

The current declarations are there for backwards compatibility,
your change breaks backwards compatibility, so it won't be applied.

Issue History

Date Modified Username Field Change
2021-04-07 21:12 henrique New Issue
2021-04-07 21:12 henrique Note Added: 0130161
2021-04-07 21:12 henrique File Added: 0001-Ajustado-a-declara-o-das-fun-es-fetch-por-que-s-o-to.patch
2021-04-07 22:40 Michael Van Canneyt Assigned To => Michael Van Canneyt
2021-04-07 22:40 Michael Van Canneyt Status new => resolved
2021-04-07 22:40 Michael Van Canneyt Resolution open => won't fix
2021-04-07 22:40 Michael Van Canneyt Note Added: 0130165