mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2026-02-25 04:38:14 +01:00
pastojs: fixed await on as operator
This commit is contained in:
parent
75d759c763
commit
c3bdbfcd6e
@ -207,6 +207,7 @@ const
|
||||
nParamOfThisTypeCannotHaveDefVal = 3141;
|
||||
nClassTypesAreNotRelatedXY = 3142;
|
||||
nDirectiveXNotAllowedHere = 3143;
|
||||
nAwaitWithoutPromise = 3144;
|
||||
|
||||
// using same IDs as FPC
|
||||
nVirtualMethodXHasLowerVisibility = 3250; // was 3050
|
||||
@ -361,6 +362,7 @@ resourcestring
|
||||
sParamOfThisTypeCannotHaveDefVal = 'Parameters of this type cannot have default values';
|
||||
sClassTypesAreNotRelatedXY = 'Class types "%s" and "%s" are not related';
|
||||
sDirectiveXNotAllowedHere = 'Directive "%s" not allowed here';
|
||||
sAwaitWithoutPromise = 'Await without promise';
|
||||
|
||||
type
|
||||
{ TResolveData - base class for data stored in TPasElement.CustomData }
|
||||
|
||||
@ -4849,7 +4849,9 @@ begin
|
||||
begin
|
||||
Bin:=TBinaryExpr(El);
|
||||
if Bin.OpCode=eopSubIdent then
|
||||
El:=Bin.right;
|
||||
El:=Bin.right
|
||||
else
|
||||
exit(nil);
|
||||
end;
|
||||
if (El is TPrimitiveExpr) and (TPrimitiveExpr(El).Kind=pekIdent) then
|
||||
Result:=El;
|
||||
|
||||
@ -5878,9 +5878,10 @@ end;
|
||||
|
||||
function TPas2JSResolver.BI_AWait_OnGetCallCompatibility(
|
||||
Proc: TResElDataBuiltInProc; Expr: TPasExpr; RaiseOnError: boolean): integer;
|
||||
// await(const Expr: T): T
|
||||
// await(T; p: TJSPromise): T;
|
||||
// await(AsyncProc);
|
||||
// await(Proc);
|
||||
// await(const Expr: T): T
|
||||
const
|
||||
Signature2 = 'function await(aType,TJSPromise):aType';
|
||||
var
|
||||
@ -6058,7 +6059,9 @@ begin
|
||||
Exclude(Ref.Flags,rrfNoImplicitCallWithoutParams);
|
||||
Include(Ref.Flags,rrfImplicitCallWithoutParams);
|
||||
end;
|
||||
end;
|
||||
end
|
||||
else
|
||||
LogMsg(20201116000324,mtHint,nAwaitWithoutPromise,sAwaitWithoutPromise,[],Param);
|
||||
end;
|
||||
|
||||
if length(P)>1 then
|
||||
|
||||
Loading…
Reference in New Issue
Block a user