[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

@@ -104,6 +104,13 @@ NamespaceA.TableInFirstNS.prototype.fooStruct = function(obj) {
return offset ? (obj || new NamespaceA.NamespaceB.StructInNestedNS).__init(this.bb_pos + offset, this.bb) : null;
};
/**
* @returns {string}
*/
NamespaceA.TableInFirstNS.getFullyQualifiedName = function() {
return 'NamespaceA.TableInFirstNS';
}
/**
* @param {flatbuffers.Builder} builder
*/
@@ -207,6 +214,13 @@ NamespaceC.TableInC.prototype.referToA2 = function(obj) {
return offset ? (obj || new NamespaceA.SecondTableInA).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
};
/**
* @returns {string}
*/
NamespaceC.TableInC.getFullyQualifiedName = function() {
return 'NamespaceC.TableInC';
}
/**
* @param {flatbuffers.Builder} builder
*/
@@ -293,6 +307,13 @@ NamespaceA.SecondTableInA.prototype.referToC = function(obj) {
return offset ? (obj || new NamespaceC.TableInC).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
};
/**
* @returns {string}
*/
NamespaceA.SecondTableInA.getFullyQualifiedName = function() {
return 'NamespaceA.SecondTableInA';
}
/**
* @param {flatbuffers.Builder} builder
*/