Commit 35298f97 authored by Josh Haberman's avatar Josh Haberman

Fixed definition of extensions, and added CommonJS tests to Travis.

parent 77af5d04
......@@ -88,3 +88,7 @@ gulp.task('test_commonjs', ['make_commonjs_out'], function (cb) {
cb(err);
});
});
gulp.task('test', ['test_closure', 'test_commonjs'], function(cb) {
cb();
});
......@@ -13,7 +13,7 @@
"glob": "~6.0.4"
},
"scripts": {
"test": "./node_modules/gulp/bin/gulp.js test_closure"
"test": "./node_modules/gulp/bin/gulp.js test"
},
"repository": {
"type": "git",
......
......@@ -2530,8 +2530,15 @@ void Generator::GenerateFile(const GeneratorOptions& options,
// // Later generated code expects foo.bar = {} to exist:
// foo.bar.Baz = function() { /* ... */ }
std::set<std::string> provided;
// Cover the case where this file declares extensions but no messages.
// This will ensure that the file-level object will be declared to hold
// the extensions.
for (int i = 0; i < file->extension_count(); i++) {
provided.insert(file->extension(i)->full_name());
}
FindProvidesForFile(options, printer, file, &provided);
//FindProvidesForFields(options, printer, extensions, &provided);
for (std::set<string>::iterator it = provided.begin();
it != provided.end(); ++it) {
printer->Print("goog.exportSymbol('$name$', null, global);\n",
......
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