Difference between revisions of "Pas2JS Version Changes"

From Lazarus wiki
(Version 0.8.41)
(Version 0.8.42)
Line 1: Line 1:
== Version 0.8.42 ==
== Version 0.8.42 ==
New features in 0.8.42:
New features in 0.8.42:
- var absolute modifier for local variables
- $scopedenums
- $hint, $note, $warn, $error, $fatal, $message text
- $message hint|note|warn|error|fatal text
- $hints, $notes, $warnings on|off
* var absolute modifier for local variables
* $scopedenums
* $hint, $note, $warn, $error, $fatal, $message text
* $message hint|note|warn|error|fatal text
* $hints, $notes, $warnings on|off
== Version 0.8.41 ==
== Version 0.8.41 ==

Revision as of 08:15, 5 January 2018

Version 0.8.42

New features in 0.8.42:

  • var absolute modifier for local variables
  • $scopedenums
  • $hint, $note, $warn, $error, $fatal, $message text
  • $message hint|note|warn|error|fatal text
  • $hints, $notes, $warnings on|off

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;

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.

Version 0.8.13

  • $IF
  • $IFOPT
  • $Error
  • $Warning,
  • $Note
  • $Hint
  • And in the config files it supports #IF, #IFDEF, #IFNDEF, #ELSEIF, #ELSE, #ENDIF.

Version 0.8.12

  • dotted unit names and namespaces.

Version 0.8.11

  • dynamic arrays can now be initialized with a constant. Same syntax as static arrays: const a: array of string = ('one', 'two');
  • Classes can now be declared in the unit implementation.
  • Unit nodejs now has a console class TNJSConsole.
  • I added the fpcunit package. Successful tests already work. A fail is not yet caught.

Version 0.8.10

  • you can now use "if aJSValue then", which works just like the JS "if(v)".
  • added ParamCount, ParamStr, GetEnvironment* functions. The default is not doing much.
  • new package fcl_base_pas2js, containing custapp and nodejsapp: - TCustomApplication is the known class from the FCL, but with abstract methods.
  • TNodeJSApplication is a TCustomApplication using nodejs to read command line params and environment variables.

Version 0.8.9

The compiler now has the types 53bit NativeInt and 52bit NativeUInt. Keep in mind that there is still no range checking.

Current aliases:

  JSInteger = NativeInt;

  Integer = LongInt;
  Cardinal = LongWord;
  SizeInt = NativeInt;
  SizeUInt = NativeUInt;
  PtrInt = NativeInt;
  PtrUInt = NativeUInt;
  ValSInt = NativeInt;
  ValUInt = NativeUInt;
  ValReal = Double;
  Real = Double;
  Extended = Double;

  Int64 = NativeInt unimplemented;
  QWord = NativeUInt unimplemented;
  Single = Double unimplemented;
  Comp = Int64 unimplemented;

  UnicodeString = String;
  WideString = String;
  WideChar = char;

Version 0.8.8

  • bugfix release.

Version 0.8.7

  • $mod: the current module
  • Self: in a method with nested functions this holds the class or class instance.
  • overloads are now chosen like FPC/Delphi not only by type, but also by precision. This means if there are several compatible overloads, and none fits exactly it will choose the next higher. Formerly it gave an error.
  • cardinal is no longer a base type, but longword is. Same as FPC.

Version 0.8.6

  • bugfix release.

Version 0.8.5

  • bugfix for the analyzer.
  • supports published indexed properties and published records.
  • indexed properties for external classes.

Version 0.8.4

  • bugfix release.