Commit 4a49493e authored by James Gilles's avatar James Gilles

js:add @namespace annotation to namespaces

parent 193a6317
......@@ -2,6 +2,10 @@
/// @addtogroup flatbuffers_javascript_api
/// @{
/// @cond FLATBUFFERS_INTERNAL
/**
* @const
* @namespace
*/
var flatbuffers = {};
/**
......
......@@ -110,7 +110,7 @@ class JsGenerator : public BaseGenerator {
std::string &exports = *exports_ptr;
for (auto it = sorted_namespaces.begin();
it != sorted_namespaces.end(); it++) {
code += "/**\n * @const\n*/\n";
code += "/**\n * @const\n * @namespace\n */\n";
if (it->find('.') == std::string::npos) {
code += "var ";
exports += "this." + *it + " = " + *it + ";\n";
......
No preview for this file type
......@@ -2,22 +2,26 @@
/**
* @const
*/
* @namespace
*/
var MyGame = MyGame || {};
/**
* @const
*/
* @namespace
*/
MyGame.Example = MyGame.Example || {};
/**
* @const
*/
* @namespace
*/
MyGame.Example2 = MyGame.Example2 || {};
/**
* @const
*/
* @namespace
*/
MyGame.OtherNameSpace = MyGame.OtherNameSpace || {};
/**
......
......@@ -2,12 +2,14 @@
/**
* @const
*/
* @namespace
*/
var NamespaceA = NamespaceA || {};
/**
* @const
*/
* @namespace
*/
NamespaceA.NamespaceB = NamespaceA.NamespaceB || {};
/**
......
......@@ -2,17 +2,20 @@
/**
* @const
*/
* @namespace
*/
var NamespaceA = NamespaceA || {};
/**
* @const
*/
* @namespace
*/
NamespaceA.NamespaceB = NamespaceA.NamespaceB || {};
/**
* @const
*/
* @namespace
*/
var NamespaceC = NamespaceC || {};
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment