Skip to content

Commit

Permalink
Turn on ijdata by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Santos committed Mar 3, 2015
1 parent ec363d9 commit 1beb406
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
6 changes: 3 additions & 3 deletions lib/SoyCompiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,9 @@ SoyCompiler.prototype._compileTemplateFilesAndEmit = function (inputDir, files,
args.push('--shouldDeclareTopLevelNamespaces', 'false');
}

if(options.isUsingIjData) {
args.push('--isUsingIjData');
}
// Always turn on isUsingIjData.
// https://groups.google.com/forum/#!topic/closure-templates-discuss/8rxD9I0QrtI
args.push('--isUsingIjData')

args.push('--outputPathFormat', outputPathFormat)

Expand Down
16 changes: 0 additions & 16 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,24 +137,8 @@ module.exports = {
});
},

testWithoutIjData: function(test) {
soynode.setOptions({
uniqueDir: false
});
soynode.compileTemplateFiles([__dirname + '/assets/template1.soy', __dirname + '/assets/template2.soy'], function(err) {
test.ifError(err);

var soyJsFilePath = path.join('/tmp/soynode', __dirname, 'assets/template2.soy.js');
var contents = fs.readFileSync(soyJsFilePath, 'utf8');
test.equal(-1, contents.indexOf('template1.formletter(opt_data, null, opt_ijData)'));

test.done();
});
},

testWithIjData: function(test) {
soynode.setOptions({
isUsingIjData: true,
uniqueDir: false
});
soynode.compileTemplateFiles([__dirname + '/assets/template1.soy', __dirname + '/assets/template2.soy'], function(err) {
Expand Down

0 comments on commit 1beb406

Please sign in to comment.