From db7d72e5343b2e03406e5dea9b2d5eb7d5b6385f Mon Sep 17 00:00:00 2001 From: Jose Date: Tue, 17 Jun 2014 19:09:31 +0200 Subject: JavaScript nested modules patch --- cpp/src/slice2js/Gen.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'cpp/src/slice2js/Gen.cpp') diff --git a/cpp/src/slice2js/Gen.cpp b/cpp/src/slice2js/Gen.cpp index a95735661f6..1542b04f8fd 100644 --- a/cpp/src/slice2js/Gen.cpp +++ b/cpp/src/slice2js/Gen.cpp @@ -835,7 +835,7 @@ Slice::Gen::TypesVisitor::visitModuleStart(const ModulePtr& p) // // For an inner module we write // - // Foo.Bar = global.Foo ? (global.Foo.Bar || {}) : {}; + // Foo.Bar = Foo.Bar || {}; // const string scoped = getLocalScope(p->scoped()); @@ -850,8 +850,7 @@ Slice::Gen::TypesVisitor::visitModuleStart(const ModulePtr& p) } else { - _out << nl << scoped << " = global." << getLocalScope(p->scope()) << " ? (global." << scoped - << " || {}) : {};"; + _out << nl << scoped << " = " << scoped << " || {};"; } } return true; -- cgit v1.2.3