diff options
author | Benoit Foucher <benoit@zeroc.com> | 2015-02-17 11:50:58 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2015-02-17 11:50:58 +0100 |
commit | 67e9afa30c73daa260343d4c3638610f4c70980a (patch) | |
tree | ca5ba63f90d97e18f51238f3818294e3a5e3d3a4 /cpp/src/slice2js | |
parent | IceLocatorDiscovery Makefile fix (diff) | |
download | ice-67e9afa30c73daa260343d4c3638610f4c70980a.tar.bz2 ice-67e9afa30c73daa260343d4c3638610f4c70980a.tar.xz ice-67e9afa30c73daa260343d4c3638610f4c70980a.zip |
Fixed ICE-6269: tolerate null values for structs and enums
Diffstat (limited to 'cpp/src/slice2js')
-rw-r--r-- | cpp/src/slice2js/Gen.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/cpp/src/slice2js/Gen.cpp b/cpp/src/slice2js/Gen.cpp index 610d671238a..1597220563e 100644 --- a/cpp/src/slice2js/Gen.cpp +++ b/cpp/src/slice2js/Gen.cpp @@ -582,14 +582,14 @@ Slice::Gen::Gen(const string& base, const vector<string>& includePaths, const st { _fileBase = base.substr(pos + 1); } - + string file = _fileBase + ".js"; if(!dir.empty()) { file = dir + '/' + file; } - + _out.open(file.c_str()); if(!_out) { @@ -599,7 +599,7 @@ Slice::Gen::Gen(const string& base, const vector<string>& includePaths, const st } FileTracker::instance()->addFile(file); - + printHeader(); printGeneratedHeader(_out, _fileBase + ".ice"); } @@ -616,7 +616,7 @@ Slice::Gen::Gen(const string& base, const vector<string>& includePaths, const st { _fileBase = base.substr(pos + 1); } - + printHeader(); printGeneratedHeader(_out, _fileBase + ".ice"); } @@ -1815,7 +1815,7 @@ Slice::Gen::TypesVisitor::visitEnum(const EnumPtr& p) _out << sp; writeDocComment(p, getDeprecateReason(p, 0, "type")); - _out << nl << localScope << '.' << name << " = Slice.defineEnum({"; + _out << nl << localScope << '.' << name << " = Slice.defineEnum(["; _out.inc(); _out << nl; @@ -1834,9 +1834,9 @@ Slice::Gen::TypesVisitor::visitEnum(const EnumPtr& p) _out << ", "; } } - _out << "'" << fixId((*en)->name()) << "':" << (*en)->value(); + _out << "['" << fixId((*en)->name()) << "', " << (*en)->value() << ']'; } - _out << "});"; + _out << "]);"; _out.dec(); // |