[JS] Add getFullyQualifiedName() (#6119)

This optionally generates a static `getFullyQualifiedName()` function to get
the fully-qualified name of a type in JavaScript and TypeScript in a similar
fashion to the C++ codegen.
This commit is contained in:
Anass Al
2020-09-17 12:19:07 -07:00
committed by GitHub
parent f96d1ef744
commit b8e87fafe4
16 changed files with 213 additions and 8 deletions

View File

@@ -80,6 +80,13 @@ fooStruct(obj?:NS8755221360535654258.NamespaceA.NamespaceB.StructInNestedNS):NS8
return offset ? (obj || new NS8755221360535654258.NamespaceA.NamespaceB.StructInNestedNS()).__init(this.bb_pos + offset, this.bb!) : null;
};
/**
* @returns string
*/
static getFullyQualifiedName():string {
return 'NamespaceA.TableInFirstNS';
}
/**
* @param flatbuffers.Builder builder
*/
@@ -225,6 +232,13 @@ referToA2(obj?:NamespaceA.SecondTableInA):NamespaceA.SecondTableInA|null {
return offset ? (obj || new NamespaceA.SecondTableInA()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
};
/**
* @returns string
*/
static getFullyQualifiedName():string {
return 'NamespaceC.TableInC';
}
/**
* @param flatbuffers.Builder builder
*/
@@ -348,6 +362,13 @@ referToC(obj?:NamespaceC.TableInC):NamespaceC.TableInC|null {
return offset ? (obj || new NamespaceC.TableInC()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
};
/**
* @returns string
*/
static getFullyQualifiedName():string {
return 'NamespaceA.SecondTableInA';
}
/**
* @param flatbuffers.Builder builder
*/