Difference between revisions of "Pas2JS Version Changes"

From Lazarus wiki
Jump to navigationJump to search
Line 120: Line 120:
 
* new tool fpc/packages/fcl-js/examples/srcmapdump to dump the produced sourcemap.
 
* new tool fpc/packages/fcl-js/examples/srcmapdump to dump the produced sourcemap.
 
* unicodestring and widechar are now declared by the compiler instead of system.pas
 
* unicodestring and widechar are now declared by the compiler instead of system.pas
 +
 +
== Version 0.8.20 ==
 +
 +
* Static array const are now implemented. For example:
 +
* array['a'..'d'] of integer = (1,2,3,4);
 +
* array[1..3] of char = 'pas';
 +
 +
== Version 0.8.19 ==
 +
 +
* several bug fixes
 +
* started static arrays:
 +
**array[2..6] of char
 +
**array['a'..'z'] of char
 +
**array[boolean] of longint
 +
**array[byte] of string
 +
**array[enum] of longint
 +
**array[char] of boolean // Note that char is widechar!
 +
**low(), high()
 +
 +
== Version 0.8.18 ==
 +
 +
Anonymous arrays in record members are now supported:
 +
<pre>
 +
  TFloatRec = Record
 +
    ...
 +
    Digits: Array Of Char;
 +
  End;
 +
</pre>
 +
 +
== Version 0.8.17 ==
 +
 +
* checks for semicolons between statements
 +
* fixed proc type of procedure in Delphi mode
 +
* implemented @@ operator for proc types in Delphi mode.
 +
* compile time evaluation, range and overflow checking for boolean, base integer types, enums, sets, custom integer ranges, char, widechar, string, single and double.
 +
 +
== Version 0.8.16 ==
 +
 +
* bugfix release.
 +
 +
== Version 0.8.15 ==
 +
 +
* compiler can now generate source maps when passing option -Jm
 +
 +
== Version 0.8.14 ==
 +
 +
* now supports TObject.Free.
 +
 +
In Delphi/FPC obj.Free works even if obj is nil. In JavaScript this would crash. And to free memory JS requires to clear all references, which is not required in Delphi/FPC. Therefore the compiler adds code to check for null, call the destructor and sets the variable to null.
 +
 +
It does not support freeing properties and function results. For example: List[i].Free; will give a compiler error. The property setter might create side
 +
effects, which would be incompatible to Delphi/FPC.
  
 
== Navigation ==
 
== Navigation ==
 
* Back to [[pas2js]]
 
* Back to [[pas2js]]
 
* Back to [[lazarus pas2js integration]]
 
* Back to [[lazarus pas2js integration]]

Revision as of 14:22, 2 January 2018

Version 0.8.41

Version 0.8.41 supports enumerators:

  • ordinal types: char, boolean, byte, ..., longword, enums, sets, static array, custom range
  • const set
  • variables: set, string, array
  • class GetEnumerator

It does not support operator enumerator, IEnumerator, member modifier enumerator.

Version 0.8.40

  • File read callback for pas2jslib

Version 0.8.39

  • fixed circular unit dependencies

Version 0.8.38

  • support for * and ? in search paths
  • fixed converting a typecast to an alias proc type
  • fixed inherited-identifier-as-expr
  • emit warning method-hides-method-in-base-type only for virtual methods
  • reduced function hides identifier from level hint to info
  • fixed unit contnrs to always use mode objfpc.

Version 0.8.37

  • Bugfixed a combination of overload/override

Version 0.8.36

  • fixed missing brackets in binary expression and left side has a call (a-f(b)) / (c-d)

Version 0.8.35

  • fixed a bug in the overload code

Version 0.8.34

  • fixed skipping attributes behind procedure declarations.
  • Procedures/methods now properly hides procs with same name.
  • In mode delphi overloads now always require the 'overload' modifier.
  • In mode objfpc the modifier is required when using different scopes.
  • hints for hiding identifiers of other units.
  • implemented system.built-in-identifier.

Version 0.8.33

  • srcmaps with included sources now ignores untranslatable local paths and simply uses the full local path.
  • custom enum ranges, e.g. TBlobType = ftBlob..ftBla
  • custom integer ranges, e.g. TSome = 1..5
  • custom char ranges
  • set of custom enum/integer/char ranges
  • the conversion of the for-to-do loop has changed. If the loop is never executed, the loop variable is not touched. And the start expression is now executed before the end expression.

Version 0.8.32

  • some bug fixes for warnings

Version 0.8.31

  • bugfix for implicit function calls of parameters of some built in functions.

Version 0.8.30

  • nicer "can't find unit" position
  • fixed a crash parsing uses clause

Version 0.8.29

  • bugfixes
  • it now supports directive $M alias $TypeInfo

Version 0.8.28

  • fixed passing static array

Version 0.8.27

  • implemented resourcestrings
  • implemented logical xor
  • fixed class-of-typealias
  • fixed property index modifier expression

Version 0.8.26

  • fixed RTTI for static arrays
  • implemented property modifier index
  • implemented FuncName:=

Version 0.8.25

  • bugfixes
  • a new modeswitch ignoreattributes to ignore attributes.

Version 0.8.24

  • implemented multi dimensional SetLength
  • fixed keeping old values when using SetLength
  • fixed method override of override

Version 0.8.23

  • property default value for sets
  • custom integer ranges, like TValueRelationship
  • typecast enums to integer type (same as ord function)
  • new modeswitch ignoreinterfaces to parse class interfaces, but neither resolve nor convert them. Using them will cause an error.

Version 0.8.22

  • fixed loading dotted units
  • implemented property stored and default modifiers

Version 0.8.21

  • fixed aString[index]:=
  • fixed analyzer to mark default values of arguments
  • many improvements for sourcemaps making step-over/into nicer in Chrome.
  • new tool fpc/packages/fcl-js/examples/srcmapdump to dump the produced sourcemap.
  • unicodestring and widechar are now declared by the compiler instead of system.pas

Version 0.8.20

  • Static array const are now implemented. For example:
  • array['a'..'d'] of integer = (1,2,3,4);
  • array[1..3] of char = 'pas';

Version 0.8.19

  • several bug fixes
  • started static arrays:
    • array[2..6] of char
    • array['a'..'z'] of char
    • array[boolean] of longint
    • array[byte] of string
    • array[enum] of longint
    • array[char] of boolean // Note that char is widechar!
    • low(), high()

Version 0.8.18

Anonymous arrays in record members are now supported:

  TFloatRec = Record
     ...
     Digits: Array Of Char;
  End;

Version 0.8.17

  • checks for semicolons between statements
  • fixed proc type of procedure in Delphi mode
  • implemented @@ operator for proc types in Delphi mode.
  • compile time evaluation, range and overflow checking for boolean, base integer types, enums, sets, custom integer ranges, char, widechar, string, single and double.

Version 0.8.16

  • bugfix release.

Version 0.8.15

  • compiler can now generate source maps when passing option -Jm

Version 0.8.14

  • now supports TObject.Free.

In Delphi/FPC obj.Free works even if obj is nil. In JavaScript this would crash. And to free memory JS requires to clear all references, which is not required in Delphi/FPC. Therefore the compiler adds code to check for null, call the destructor and sets the variable to null.

It does not support freeing properties and function results. For example: List[i].Free; will give a compiler error. The property setter might create side effects, which would be incompatible to Delphi/FPC.

Navigation