mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-20 21:57:32 +00:00
[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:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user