[Pas2js] Directive {$I %LINE%} - Feature request
warleyalex
warleyalex at yahoo.com.br
Thu Jan 25 21:32:43 CET 2018
> Function GetCurrentLineNumber: String;
> begin
> Result := {$I %LINE%};
> end;
It doesn't make sense to me either.
---------
In Smart Pascal compiler, If we check this Compiler options "[ x ] Emit
source locations"
the compiler will emit a verbose JS with source locations.
procedure TTest001.CheckRomanNumber;
begin
Equal('DCLXVI', FField, 'an error has occurred at '+{$I %FUNCTION%} + '
line: '+{$I %LINE%});
end;
will emit this verbose JS:
-------------------------------------------------------------------------------------
/// procedure TTest001.CheckRomanNumber()
/// [line: 87, column: 4, file: TestFramework]
CheckRomanNumber:function(Self) {
TAbstractTestCase.Equal$2(Self,"DCLXVI",Self.FField,"an error has
occurred at
"+"TTest001.CheckRomanNumber"+"
line: "+"89");
}
-------------------------------------------------------------------------------------
Pas2JS could have this feature.
--
Sent from: http://pas2js.38893.n8.nabble.com/
More information about the Pas2js
mailing list