Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lint errors. #28

Merged
merged 1 commit into from Jul 7, 2015
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Fix lint errors.

Lab enabled the [no-shadow rule](http://eslint.org/docs/rules/no-shadow.html)
in hapijs/lab#371 (with exceptions provided by hapijs/lab#379).
This change corrects lint errors created by variable shadowing.
  • Loading branch information
jagoda committed Jul 7, 2015
commit 6d529b008d3961c0efed039f9a7e11263adf50e5
@@ -25,7 +25,7 @@ internals.schema = Joi.alternatives([
]);


exports.register = function (server, options, next) {
exports.register = function (server, pluginOptions, next) {

server.decorate('server', 'views', function (options) {

@@ -344,22 +344,22 @@ internals.Manager.prototype.render = function (filename, context, options, callb
return callback(err);
}

compiled(context, settings.runtimeOptions, function (err, rendered) {
compiled(context, settings.runtimeOptions, function (err, renderedContent) {

if (err) {
return callback(Boom.badImplementation(err.message, err));
}

context[settings.layoutKeyword] = rendered;
layout(context, settings.runtimeOptions, function (err, rendered) {
context[settings.layoutKeyword] = renderedContent;
layout(context, settings.runtimeOptions, function (err, renderedWithLayout) {

delete context[settings.layoutKeyword];

if (err) {
return callback(Boom.badImplementation(err.message, err));
}

return callback(null, rendered, settings);
return callback(null, renderedWithLayout, settings);
});
});
});
@@ -482,13 +482,13 @@ describe('views()', function () {
server.register({ register: test, options: { message: 'viewing it' } }, function (err) {

expect(err).to.not.exist();
server.inject('/view', function (res) {
server.inject('/view', function (viewResponse) {

expect(res.result).to.equal('<h1>viewing it</h1>');
expect(viewResponse.result).to.equal('<h1>viewing it</h1>');

server.inject('/ext', function (res) {
server.inject('/ext', function (extResponse) {

expect(res.result).to.equal('<h1>grabbed</h1>');
expect(extResponse.result).to.equal('<h1>grabbed</h1>');
done();
});
});
@@ -245,9 +245,9 @@ describe('Manager', function () {
engines: {
html: {
module: {
compile: function (template, options) {
compile: function (template, compileOptions) {

return function (context, options) {
return function (context, renderOptions) {

return undefined;
};
@@ -1402,15 +1402,15 @@ describe('Manager', function () {
}
});

views.render('valid/test', { title: 'test', message: 'Hapi' }, null, function (err, rendered, config) {
views.render('valid/test', { title: 'test', message: 'Hapi' }, null, function (err, original, originalConfig) {

expect(rendered).to.exist();
expect(rendered).to.contain('Hapi');
expect(original).to.exist();
expect(original).to.contain('Hapi');

views.render('valid/test', { title: 'test', message: 'Hapi' }, null, function (err, rendered, config) {
views.render('valid/test', { title: 'test', message: 'Hapi' }, null, function (err, cached, cachedConfig) {

expect(rendered).to.exist();
expect(rendered).to.contain('Hapi');
expect(cached).to.exist();
expect(cached).to.contain('Hapi');

expect(gen).to.equal(1);
done();
@@ -1444,15 +1444,15 @@ describe('Manager', function () {
isCached: false
});

views.render('valid/test', { title: 'test', message: 'Hapi' }, null, function (err, rendered, config) {
views.render('valid/test', { title: 'test', message: 'Hapi' }, null, function (err, original, originalConfig) {

expect(rendered).to.exist();
expect(rendered).to.contain('Hapi');
expect(original).to.exist();
expect(original).to.contain('Hapi');

views.render('valid/test', { title: 'test', message: 'Hapi' }, null, function (err, rendered, config) {
views.render('valid/test', { title: 'test', message: 'Hapi' }, null, function (err, cached, cachedConfig) {

expect(rendered).to.exist();
expect(rendered).to.contain('Hapi');
expect(cached).to.exist();
expect(cached).to.contain('Hapi');

expect(gen).to.equal(2);
done();
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.