Skip to content

Commit

Permalink
Release v2.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Prayrit Jain committed Sep 9, 2014
1 parent f5b4bc9 commit 3c5f966
Show file tree
Hide file tree
Showing 8 changed files with 2,375 additions and 2,514 deletions.
Binary file added archive/dust-2.4.2.tar.gz
Binary file not shown.
Binary file added archive/dust-2.4.2.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dustjs-linkedin",
"version": "2.4.1",
"version": "2.4.2",
"main": "dist/dust-full.min.js",
"devDependencies": {
"pegjs": "0.8.0"
Expand Down
33 changes: 22 additions & 11 deletions dist/dust-core.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Dust - Asynchronous Templating - v2.4.1
/*! Dust - Asynchronous Templating - v2.4.2
* http://linkedin.github.io/dustjs/
* Copyright (c) 2014 Aleksander Williams; Released under the MIT License */
(function(root) {
Expand Down Expand Up @@ -346,7 +346,8 @@
try {
return ctx.apply(ctxThis, arguments);
} catch (err) {
return dust.log(err, ERROR);
dust.log(err, ERROR);
throw err;
}
};
} else {
Expand Down Expand Up @@ -564,7 +565,12 @@

this.next = branch;
this.flushable = true;
callback(branch);
try {
callback(branch);
} catch(e) {
dust.log(e, ERROR);
branch.setError(e);
}
return cursor;
};

Expand Down Expand Up @@ -607,7 +613,12 @@
Chunk.prototype.section = function(elem, context, bodies, params) {
// anonymous functions
if (typeof elem === 'function') {
elem = elem.apply(context.current(), [this, context, bodies, params]);
try {
elem = elem.apply(context.current(), [this, context, bodies, params]);
} catch(e) {
dust.log(e, ERROR);
return this.setError(e);
}
// functions that return chunks are assumed to have handled the body and/or have modified the chunk
// use that return value as the current chunk and go to the next method in the chain
if (elem instanceof Chunk) {
Expand Down Expand Up @@ -754,15 +765,15 @@
Chunk.prototype.helper = function(name, context, bodies, params) {
var chunk = this;
// handle invalid helpers, similar to invalid filters
try {
if(dust.helpers[name]) {
if(dust.helpers[name]) {
try {
return dust.helpers[name](chunk, context, bodies, params);
} else {
dust.log('Invalid helper [' + name + ']', WARN);
return chunk;
} catch(e) {
dust.log('Error in ' + name + ' helper: ' + e, ERROR);
return chunk.setError(e);
}
} catch (err) {
chunk.setError(err);
} else {
dust.log('Invalid helper [' + name + ']', WARN);
return chunk;
}
};
Expand Down
4 changes: 2 additions & 2 deletions dist/dust-core.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 3c5f966

Please sign in to comment.