Community
Participate
Working Groups
JavaScript requires "this." to qualify access to fields and functions within the same object in which they are defined. (In EGL, this can be implicit or explicit.) The JavaScript generator has very primitive logic for adding "this." but there are problems: * ...results in duplicate "this." when the EGL source has an explicit "this." * ...fails to determine whether the field or function is in fact local to the part from which they are being accessed.
Reworked JS gen as follows * For fields, MemberNameTemplate looks to see if the field access was unqualified and if so, invokes genQualifier on that field. (That logic is left as it was -- it simply looks to see if the container is a type and if so it forwards the genQualifier on to the container.) * genQualifier was removed from the existing container classes and a new implementation was created on EGLClassTemplate. This has simple logic that takes a field or function and looks to see if its associated with this particular part; if so, then it emits "this.". Verified the changes by generating and executing the existing FVT testcases.
Verified fix.