Icon View Incident Report

Serious Serious
Reported By: Matthew Jones
Reported On: 5/12/2017
For: Version 2.06 Build 1
# 4522 Issues with Emitted JavaScript Code with Certain Complex Unit Dependencies

I have a class hierarchy that is a tad complex. At the root I have TEditableDataItem which has:

class function GetDataTypeString : String; virtual;

I then have a variety of classes that derive from it, including TLibraryCommon which has more descendants which redefine it. At the bottom if uLibraryCommon, which has some of the descendant definitions in, there is:

class function TLibraryCommon.GetDataTypeString : String; begin Result := 'LIBCOMMONERROR'; Assert(false, 'Lib common error'); end;

class function TLibraryLabour.GetDataTypeString : String; begin Result := 'lib.lLab'; end;

In uLibraryMaterial, which defines a derived TLibraryMaterial, I have:

class function TLibraryMaterial.GetDataTypeString : String; begin Result := 'lib.lMat'; end;

The JSON output though has:

ulibrarycommon_tlibrarylabour.$p.getdatatypestring = function()
var $t = this;
return "lib.lLab";

ulibrarymaterial_tlibrarymaterial.$p.getdatatypestring1 = function()
var $t = this;
return "lib.lMat";

The key being, the compiler seems to have been confused and thinks that the material has its own custom version of the function, so the TLibraryCommon version is used instead, which causes a failure in my code.

Comments Comments
The issue was due to the way that the EWB compiler was setting the emitter identifiers in the compiler. It was not setting them in the proper order according to the unit dependencies and the interface/implementation order, and this would trip up the emitting and cause the wrong method name to be emitted.

Resolution Resolution
Fixed Problem on 5/13/2017 in version 2.06 build 2

Products Affected Products Affected
Elevate Web Builder
Elevate Web Builder Trial