[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

@@ -35,6 +35,10 @@ impl<'a> flatbuffers::Follow<'a> for TableInFirstNS<'a> {
}
impl<'a> TableInFirstNS<'a> {
pub const fn get_fully_qualified_name() -> &'static str {
"NamespaceA.TableInFirstNS"
}
#[inline]
pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
TableInFirstNS {
@@ -133,6 +137,10 @@ impl<'a> flatbuffers::Follow<'a> for SecondTableInA<'a> {
}
impl<'a> SecondTableInA<'a> {
pub const fn get_fully_qualified_name() -> &'static str {
"NamespaceA.SecondTableInA"
}
#[inline]
pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
SecondTableInA {
@@ -219,6 +227,10 @@ impl<'a> flatbuffers::Follow<'a> for TableInC<'a> {
}
impl<'a> TableInC<'a> {
pub const fn get_fully_qualified_name() -> &'static str {
"NamespaceC.TableInC"
}
#[inline]
pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
TableInC {