[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

@@ -94,6 +94,13 @@ Attacker.prototype.mutate_sword_attack_damage = function(value) {
return true;
};
/**
* @returns {string}
*/
Attacker.getFullyQualifiedName = function() {
return 'Attacker';
}
/**
* @param {flatbuffers.Builder} builder
*/
@@ -171,6 +178,13 @@ Rapunzel.prototype.mutate_hair_length = function(value) {
return true;
};
/**
* @returns {string}
*/
Rapunzel.getFullyQualifiedName = function() {
return 'Rapunzel';
}
/**
* @param {flatbuffers.Builder} builder
* @param {number} hair_length
@@ -224,6 +238,13 @@ BookReader.prototype.mutate_books_read = function(value) {
return true;
};
/**
* @returns {string}
*/
BookReader.getFullyQualifiedName = function() {
return 'BookReader';
}
/**
* @param {flatbuffers.Builder} builder
* @param {number} books_read
@@ -348,6 +369,13 @@ Movie.prototype.charactersLength = function() {
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
};
/**
* @returns {string}
*/
Movie.getFullyQualifiedName = function() {
return 'Movie';
}
/**
* @param {flatbuffers.Builder} builder
*/