pastojs: nicer -Jm error message, check for (a,b)[]

git-svn-id: trunk@41145 -
This commit is contained in:
Mattias Gaertner 2019-01-30 14:10:31 +00:00
parent 569bd80cec
commit dd2fc17d51
3 changed files with 13 additions and 6 deletions

View File

@ -7195,7 +7195,7 @@ begin
begin
// e.g. mod.ExtClass.new;
if El.Parent is TParamsExpr then
// Note: ExtClass.new() must be handled in ConvertFuncParams
// Note: ExtClass.new() is handled in ConvertFuncParams
RaiseNotSupported(El,AContext,20190116135818);
Result:=ConvertExternalConstructor(El.left,RightRef,nil,AContext);
exit;
@ -7273,8 +7273,15 @@ begin
DotContext.LeftResolved:=LeftResolved;
if Assigned(OnConvertRight) then
Right:=OnConvertRight(El.right,DotContext,Data)
else if El.right.ClassType=TPrimitiveExpr then
Right:=ConvertPrimitiveExpression(TPrimitiveExpr(El.right),DotContext)
else
Right:=ConvertExpression(El.right,DotContext);
begin
{$IFDEF VerbosePas2JS}
writeln('TPasToJSConverter.ConvertSubIdentExprCustom Bin=',El.OpCode,' El.Right=',GetObjName(El.right));
{$ENDIF}
RaiseNotSupported(El,AContext,20190130101045);
end;
if DotContext.JS<>nil then
begin
Left:=nil;
@ -7758,7 +7765,7 @@ begin
and (AContext is TDotContext)
and (AContext.JSElement<>nil) then
begin
// e.g. Obj.A and A is defined as: A: t external name '["name"]';
// e.g. Obj.A with A having an external name '["name"]';
// -> Obj["name"]
if IsImplicitCall then
RaiseNotSupported(El,AContext,20180509134951,Name);

View File

@ -3111,7 +3111,7 @@ begin
begin
i:=Pos('=',aValue);
if i<1 then
result:=false
ParamFatal('unknown -Jm parameter "'+aValue+'"')
else
begin
S:=LeftStr(aValue,i-1);
@ -3120,7 +3120,7 @@ begin
'sourceroot': SrcMapSourceRoot:=aValue;
'basedir': SrcMapBaseDir:=aValue;
else
Result:=False;
ParamFatal('unknown -Jm parameter "'+s+'"')
end;
end;
end;

View File

@ -626,7 +626,7 @@ type
Procedure TestClassInterface_GUIDProperty;
// helpers
Procedure TestClassHelper_ClassVar; // todo
Procedure TestClassHelper_ClassVar; // ToDo
// todo: TestClassHelper_Overload
// proc types