js:add @namespace annotation to namespaces

This commit is contained in:
James Gilles
2016-07-11 01:13:47 -04:00
parent 193a631708
commit 4a49493e27
6 changed files with 23 additions and 10 deletions

View File

@@ -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";