Skip to content

Commit

Permalink
Update to 1.0.11
Browse files Browse the repository at this point in the history
commit 5f34991
Author: kpdecker <kpdecker@gmail.com>
Date:   Mon May 27 12:29:57 2013 -0500

    Update in the wild section

    Fixes handlebars-lang#246

commit c1020a0
Author: kpdecker <kpdecker@gmail.com>
Date:   Mon May 27 11:52:32 2013 -0500

    Add unicode support for ID tokens

    Fixes handlebars-lang#433
    Fixes handlebars-lang#469

commit bff71d7
Author: kpdecker <kpdecker@gmail.com>
Date:   Sat May 25 12:32:16 2013 -0500

    Update release notes

commit 4d95d58
Author: kpdecker <kpdecker@gmail.com>
Date:   Sat May 25 12:27:31 2013 -0500

    Rebuild

commit 47e0aa7
Merge: 6bf9c6f f5fe6d0
Author: Kevin Decker <kpdecker@gmail.com>
Date:   Sat May 25 10:07:46 2013 -0700

    Merge pull request handlebars-lang#526 from jamesgorrie/master

    Fixing regex on partial names

commit 6bf9c6f
Merge: 533be69 10669e0
Author: kpdecker <kpdecker@gmail.com>
Date:   Wed May 22 08:40:28 2013 -0400

    Merge branch 'master' of github.com:wycats/handlebars.js

commit 533be69
Author: kpdecker <kpdecker@gmail.com>
Date:   Tue May 21 13:12:11 2013 -0500

    Use better variable name

commit a97820f
Author: kpdecker <kpdecker@gmail.com>
Date:   Tue May 21 13:03:41 2013 -0500

    Update testing notes

    Fixes handlebars-lang#467

commit f6b6361
Author: kpdecker <kpdecker@gmail.com>
Date:   Tue May 21 13:03:01 2013 -0500

    Fix typo

commit 10669e0
Merge: 5ba17c9 69bcdf3
Author: Kevin Decker <kpdecker@gmail.com>
Date:   Tue May 21 08:46:27 2013 -0700

    Merge pull request handlebars-lang#533 from blessenm/amd-precompilation-fix

    Fix for the issue handlebars-lang#517

commit 69bcdf3
Author: Blessan Mathew <blessenm@gmail.com>
Date:   Tue May 21 20:50:46 2013 +0530

    Fix for issue handlebars-lang#517.

    Now when compiiled with amd option and a single input argument, we are
    checking to see whether the input is a file or folder.

commit 5ba17c9
Merge: 7fb9750 94cc419
Author: kpdecker <kpdecker@gmail.com>
Date:   Sun May 19 11:47:01 2013 -0500

    Merge branch 'master' of github.com:wycats/handlebars.js

commit 7fb9750
Author: kpdecker <kpdecker@gmail.com>
Date:   Sun May 19 11:45:20 2013 -0500

    Update block helper docs in README

    Fixes handlebars-lang#231, handlebars-lang#259

commit c95d9d6
Author: kpdecker <kpdecker@gmail.com>
Date:   Sun May 19 11:30:26 2013 -0500

    Use context rather than arg in README examples

commit 3aef7f6
Author: kpdecker <kpdecker@gmail.com>
Date:   Sun May 19 11:30:04 2013 -0500

    Misc readme updates

commit f5fe6d0
Author: James Gorrie <james@bravenewtalent.com>
Date:   Fri May 17 16:58:34 2013 +0100

    Allowed for points to be in partial path name

commit 94cc419
Merge: 4cf0410 d649b35
Author: Kevin Decker <kpdecker@gmail.com>
Date:   Tue May 14 21:10:14 2013 -0700

    Merge pull request handlebars-lang#515 from jjclark1982/master

    Allow requiring ".handlebars" files within Node.js scripts

commit d649b35
Author: Jesse Clark <jjclark1982@gmail.com>
Date:   Wed May 15 10:50:01 2013 +1000

    Only run "require" tests when require() is available

commit 229b82b
Author: Jesse Clark <jjclark1982@gmail.com>
Date:   Wed May 15 10:38:45 2013 +1000

    Add unit tests for require() handler

commit 531be77
Author: Jesse Clark <jjclark1982@gmail.com>
Date:   Tue May 14 22:26:20 2013 +1000

    Publish a Node.js require() handler for handlebars files

commit 4cf0410
Author: kpdecker <kpdecker@gmail.com>
Date:   Mon May 13 23:09:21 2013 -0500

    1.0.11

commit 2ec5a97
Author: kpdecker <kpdecker@gmail.com>
Date:   Mon May 13 23:08:43 2013 -0500

    Update release notes

commit ddc4d31
Author: kpdecker <kpdecker@gmail.com>
Date:   Mon May 13 23:07:29 2013 -0500

    Rev to rc4

commit 85dd394
Author: kpdecker <kpdecker@gmail.com>
Date:   Fri May 10 01:35:25 2013 -0500

    Add regex escapes

commit 8b65fa7
Author: kpdecker <kpdecker@gmail.com>
Date:   Fri May 10 01:24:11 2013 -0500

    Update release notes

commit fa6cec2
Author: kpdecker <kpdecker@gmail.com>
Date:   Fri May 10 01:02:13 2013 -0500

    Update client packager versions

commit 436973f
Author: kpdecker <kpdecker@gmail.com>
Date:   Fri May 10 01:00:39 2013 -0500

    Version update script

commit a279678
Merge: d355d1f 8a5705a
Author: Kevin Decker <kpdecker@gmail.com>
Date:   Thu May 9 22:37:23 2013 -0700

    Merge pull request handlebars-lang#505 from MikeMayer/master

    Include a .nuspec package file to include handlebars.js on NuGet

commit d355d1f
Author: Kevin Decker <kpdecker@gmail.com>
Date:   Fri May 10 00:35:05 2013 -0500

    Fix links in release notes

commit 71c5e36
Merge: 44ae572 fc52a65
Author: Kevin Decker <kpdecker@gmail.com>
Date:   Thu May 9 22:29:27 2013 -0700

    Merge pull request handlebars-lang#489 from DevinClark/bower-update

    Added a component.json file for Twitter's Bower package manager.

commit 44ae572
Author: kpdecker <kpdecker@gmail.com>
Date:   Fri May 10 00:14:55 2013 -0500

    Add release notes

    Fixes handlebars-lang#471

commit 7cd9cdb
Merge: ef32573 090ee7c
Author: Kevin Decker <kpdecker@gmail.com>
Date:   Thu May 9 21:03:03 2013 -0700

    Merge pull request handlebars-lang#513 from tommydudebreaux/master

    Using handlebars with browserify causes IE to throw - TypeError: Invalid calling object

commit 090ee7c
Author: Tommy Messbauer <tommy@vast.com>
Date:   Thu May 9 17:17:34 2013 -0500

    added local pointer to handlerbars.utils to allow this to browserify properly for IE

commit 8a5705a
Author: MikeMayer <mike@mikemayer.me>
Date:   Wed May 1 09:58:17 2013 -0700

    Explicitly only include the handlebars.js from the dist folder

commit 344bb90
Author: MikeMayer <mike@mikemayer.me>
Date:   Wed May 1 09:52:55 2013 -0700

    Create handlebars.js.nuspec for inclusion in NuGet

    Added a .nuspec file for those people who use Visual Studio and NuGet and might want to use handlebars.js deployed from NuGet in their application.

commit fc52a65
Author: DevinClark <dclarkdesign@gmail.com>
Date:   Thu Apr 25 21:05:21 2013 -0500

    Changed component.json to bower.json per Bower 0.9.0 update.

commit 5c9aa9e
Author: DevinClark <dclarkdesign@gmail.com>
Date:   Mon Apr 8 12:28:13 2013 -0500

    Added a component.json file for Twitter's Bower package manager.

    See [https://github.com/twitter/bower#defining-a-package](Defining a
    package) for more information about how the file was generated.
  • Loading branch information
alejandroiglesias committed May 27, 2013
1 parent 764d127 commit c2c3808
Show file tree
Hide file tree
Showing 17 changed files with 242 additions and 52 deletions.
66 changes: 44 additions & 22 deletions README.markdown
Expand Up @@ -24,7 +24,7 @@ In general, the syntax of Handlebars.js templates is a superset
of Mustache templates. For basic syntax, check out the [Mustache
manpage](http://mustache.github.com/mustache.5.html).

Once you have a template, use the Handlebars.compile method to compile
Once you have a template, use the `Handlebars.compile` method to compile
the template into a function. The generated function takes a context
argument, which will be used to render the template.

Expand Down Expand Up @@ -55,12 +55,12 @@ template. Here's an example, which assumes that your objects have a URL
embedded in them, as well as the text for a link:

```js
Handlebars.registerHelper('link_to', function(context) {
return "<a href='" + context.url + "'>" + context.body + "</a>";
Handlebars.registerHelper('link_to', function() {
return "<a href='" + this.url + "'>" + this.body + "</a>";
});

var context = { posts: [{url: "/hello-world", body: "Hello World!"}] };
var source = "<ul>{{#posts}}<li>{{{link_to this}}}</li>{{/posts}}</ul>"
var source = "<ul>{{#posts}}<li>{{{link_to}}}</li>{{/posts}}</ul>"

var template = Handlebars.compile(source);
template(context);
Expand All @@ -72,6 +72,14 @@ template(context);
// </ul>
```

Helpers take precedence over fields defined on the context. To access a field
that is masked by a helper, a path reference may be used. In the example above
a field named `link_to` on the `context` object would be referenced using:

```
{{./link_to}}
```

Escaping
--------

Expand All @@ -93,17 +101,17 @@ templates easier and also changes a tiny detail of how partials work.
Handlebars.js supports an extended expression syntax that we call paths.
Paths are made up of typical expressions and . characters. Expressions
allow you to not only display data from the current context, but to
display data from contexts that are descendents and ancestors of the
display data from contexts that are descendants and ancestors of the
current context.

To display data from descendent contexts, use the `.` character. So, for
To display data from descendant contexts, use the `.` character. So, for
example, if your data were structured like:

```js
var data = {"person": { "name": "Alan" }, company: {"name": "Rad, Inc." } };
```

you could display the person's name from the top-level context with the
You could display the person's name from the top-level context with the
following expression:

```
Expand All @@ -130,12 +138,12 @@ When calling a helper, you can pass paths or Strings as parameters. For
instance:

```js
Handlebars.registerHelper('link_to', function(title, context) {
return "<a href='/posts" + context.url + "'>" + title + "!</a>"
Handlebars.registerHelper('link_to', function(title, options) {
return "<a href='/posts" + this.url + "'>" + title + "!</a>"
});

var context = { posts: [{url: "/hello-world", body: "Hello World!"}] };
var source = '<ul>{{#posts}}<li>{{{link_to "Post" this}}}</li>{{/posts}}</ul>'
var source = '<ul>{{#posts}}<li>{{{link_to "Post"}}}</li>{{/posts}}</ul>'

var template = Handlebars.compile(source);
template(context);
Expand Down Expand Up @@ -177,12 +185,18 @@ template(data);
// </ul>
```

Whenever the block helper is called it is given two parameters, the
argument that is passed to the helper, or the current context if no
argument is passed and the compiled contents of the block. Inside of
the block helper the value of `this` is the current context, wrapped to
include a method named `__get__` that helps translate paths into values
within the helpers.
Whenever the block helper is called it is given one or more parameters,
any arguments that are passed in the helper in the call and an `options`
object containing the `fn` function which executes the block's child.
The block's current context may be accessed through `this`.

Block helpers have the same syntax as mustache sections but should not be
confused with one another. Sections are akin to an implicit `each` or
`with` statement depending on the input data and helpers are explicit
pieces of code that are free to implement whatever behavior they like.
The [mustache spec](http://mustache.github.io/mustache.5.html)
defines the exact behavior of sections. In the case of name conflicts,
helpers are given priority.

### Partials

Expand Down Expand Up @@ -335,15 +349,18 @@ Handlebars in the Wild
* [Ember.js](http://www.emberjs.com) makes Handlebars.js the primary way to
structure your views, also with automatic data binding support.
* Les Hill (@leshill) wrote a Rails Asset Pipeline gem named
handlebars_assets](http://github.com/leshill/handlebars_assets).
[handlebars_assets](http://github.com/leshill/handlebars_assets).
* [Gist about Synchronous and asynchronous loading of external handlebars templates](https://gist.github.com/2287070)
* [Lumbar](walmartlabs.github.io/lumbar) provides easy module-based template management for handlebars projects.
* [YUI](http://yuilibrary.com/yui/docs/handlebars/) implements a port of handlebars

Have a project using Handlebars? Send us a [pull request](https://github.com/wycats/handlebars.js/pull/new/master)!

Helping Out
-----------
To build Handlebars.js you'll need a few things installed.

* Node.js
* Jison, for building the compiler - `npm install jison`
* Ruby
* therubyracer, for running tests - `gem install therubyracer`
* rspec, for running tests - `gem install rspec`
Expand All @@ -353,11 +370,16 @@ and therubyracer if you've got bundler installed.

To build Handlebars.js from scratch, you'll want to run `rake compile`
in the root of the project. That will build Handlebars and output the
results to the dist/ folder. To run tests, run `rake spec`. You can also
run our set of benchmarks with `rake bench`.
results to the dist/ folder. To run tests, run `rake test`. You can also
run our set of benchmarks with `rake bench`. Node tests can be run with
`npm test` or `rake npm_test`. The default rake target will compile and
run both test suites.

Some environments, notably Windows, have issues running therubyracer. Under these
envrionments the `rake compile` and `npm test` should be sufficient to test
most handlebars functionality.

If you notice any problems, please report
them to the GitHub issue tracker at
If you notice any problems, please report them to the GitHub issue tracker at
[http://github.com/wycats/handlebars.js/issues](http://github.com/wycats/handlebars.js/issues).
Feel free to contact commondream or wycats through GitHub with any other
questions or feature requests. To submit changes fork the project and
Expand Down
18 changes: 17 additions & 1 deletion Rakefile
Expand Up @@ -90,8 +90,24 @@ task :runtime => [:compile] do |task|
Rake::Task["dist/handlebars.runtime.js"].execute
end

# Updates the various version numbers.
task :version => [] do |task|
# TODO : Pull from package.json when the version numbers are synced
version = File.read("lib/handlebars/base.js").match(/Handlebars.VERSION = "(.*)";/)[1]

content = File.read("bower.json")
File.open("bower.json", "w") do |file|
file.puts content.gsub(/"version":.*/, "\"version\": \"#{version}\",")
end

content = File.read("handlebars.js.nuspec")
File.open("handlebars.js.nuspec", "w") do |file|
file.puts content.gsub(/<version>.*<\/version>/, "<version>#{version}</version>")
end
end

desc "build the build and runtime version of handlebars"
task :release => [:build, :runtime]
task :release => [:version, :build, :runtime]

directory "vendor"

Expand Down
10 changes: 7 additions & 3 deletions bin/handlebars
Expand Up @@ -168,10 +168,14 @@ function processTemplate(template, root) {
if (argv.simple) {
output.push(handlebars.precompile(data, options) + '\n');
} else if (argv.partial) {
if(argv.amd && argv._.length == 1){ output.push('return '); }
if(argv.amd && (argv._.length == 1 && !fs.statSync(argv._[0]).isDirectory())) {
output.push('return ');
}
output.push('Handlebars.partials[\'' + template + '\'] = template(' + handlebars.precompile(data, options) + ');\n');
} else {
if(argv.amd && argv._.length == 1){ output.push('return '); }
if(argv.amd && (argv._.length == 1 && !fs.statSync(argv._[0]).isDirectory())) {
output.push('return ');
}
output.push('templates[\'' + template + '\'] = template(' + handlebars.precompile(data, options) + ');\n');
}
}
Expand All @@ -184,7 +188,7 @@ argv._.forEach(function(template) {
// Output the content
if (!argv.simple) {
if (argv.amd) {
if(argv._.length > 1){
if(argv._.length > 1 || (argv._.length == 1 && fs.statSync(argv._[0]).isDirectory())) {
if(argv.partial){
output.push('return Handlebars.partials;\n');
} else {
Expand Down
9 changes: 9 additions & 0 deletions bower.json
@@ -0,0 +1,9 @@
{
"name": "handlebars.js",
"version": "1.0.0-rc.4",
"main": "dist/handlebars.js",
"ignore": [
"node_modules",
"components"
]
}
16 changes: 8 additions & 8 deletions dist/handlebars.js
Expand Up @@ -36,7 +36,7 @@ THE SOFTWARE.
;
// lib/handlebars/base.js

Handlebars.VERSION = "1.0.0-rc.3";
Handlebars.VERSION = "1.0.0-rc.4";
Handlebars.COMPILER_REVISION = 3;

Handlebars.REVISION_CHANGES = {
Expand Down Expand Up @@ -159,19 +159,19 @@ Handlebars.registerHelper('each', function(context, options) {
return ret;
});

Handlebars.registerHelper('if', function(context, options) {
var type = toString.call(context);
if(type === functionType) { context = context.call(this); }
Handlebars.registerHelper('if', function(conditional, options) {
var type = toString.call(conditional);
if(type === functionType) { conditional = conditional.call(this); }

if(!context || Handlebars.Utils.isEmpty(context)) {
if(!conditional || Handlebars.Utils.isEmpty(conditional)) {
return options.inverse(this);
} else {
return options.fn(this);
}
});

Handlebars.registerHelper('unless', function(context, options) {
return Handlebars.helpers['if'].call(this, context, {fn: options.inverse, inverse: options.fn});
Handlebars.registerHelper('unless', function(conditional, options) {
return Handlebars.helpers['if'].call(this, conditional, {fn: options.inverse, inverse: options.fn});
});

Handlebars.registerHelper('with', function(context, options) {
Expand Down Expand Up @@ -651,7 +651,7 @@ case 33: return 5;
break;
}
};
lexer.rules = [/^(?:\\\\(?=(\{\{)))/,/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|$)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\{\{>)/,/^(?:\{\{#)/,/^(?:\{\{\/)/,/^(?:\{\{\^)/,/^(?:\{\{\s*else\b)/,/^(?:\{\{\{)/,/^(?:\{\{&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{)/,/^(?:=)/,/^(?:\.(?=[}/ ]))/,/^(?:\.\.)/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}\}\})/,/^(?:\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@[a-zA-Z]+)/,/^(?:true(?=[}\s]))/,/^(?:false(?=[}\s]))/,/^(?:-?[0-9]+(?=[}\s]))/,/^(?:[a-zA-Z0-9_$:-]+(?=[=}\s\/.]))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:\s+)/,/^(?:[a-zA-Z0-9_$-\/]+)/,/^(?:$)/];
lexer.rules = [/^(?:\\\\(?=(\{\{)))/,/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|$)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\{\{>)/,/^(?:\{\{#)/,/^(?:\{\{\/)/,/^(?:\{\{\^)/,/^(?:\{\{\s*else\b)/,/^(?:\{\{\{)/,/^(?:\{\{&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{)/,/^(?:=)/,/^(?:\.(?=[}\/ ]))/,/^(?:\.\.)/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}\}\})/,/^(?:\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@[a-zA-Z]+)/,/^(?:true(?=[}\s]))/,/^(?:false(?=[}\s]))/,/^(?:-?[0-9]+(?=[}\s]))/,/^(?:[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.]))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:\s+)/,/^(?:[a-zA-Z0-9_$\-\/\.]+)/,/^(?:$)/];
lexer.conditions = {"mu":{"rules":[5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,33],"inclusive":false},"emu":{"rules":[3],"inclusive":false},"com":{"rules":[4],"inclusive":false},"par":{"rules":[31,32],"inclusive":false},"INITIAL":{"rules":[0,1,2,33],"inclusive":true}};
return lexer;})()
parser.lexer = lexer;
Expand Down
14 changes: 7 additions & 7 deletions dist/handlebars.runtime.js
Expand Up @@ -36,7 +36,7 @@ THE SOFTWARE.
;
// lib/handlebars/base.js

Handlebars.VERSION = "1.0.0-rc.3";
Handlebars.VERSION = "1.0.0-rc.4";
Handlebars.COMPILER_REVISION = 3;

Handlebars.REVISION_CHANGES = {
Expand Down Expand Up @@ -159,19 +159,19 @@ Handlebars.registerHelper('each', function(context, options) {
return ret;
});

Handlebars.registerHelper('if', function(context, options) {
var type = toString.call(context);
if(type === functionType) { context = context.call(this); }
Handlebars.registerHelper('if', function(conditional, options) {
var type = toString.call(conditional);
if(type === functionType) { conditional = conditional.call(this); }

if(!context || Handlebars.Utils.isEmpty(context)) {
if(!conditional || Handlebars.Utils.isEmpty(conditional)) {
return options.inverse(this);
} else {
return options.fn(this);
}
});

Handlebars.registerHelper('unless', function(context, options) {
return Handlebars.helpers['if'].call(this, context, {fn: options.inverse, inverse: options.fn});
Handlebars.registerHelper('unless', function(conditional, options) {
return Handlebars.helpers['if'].call(this, conditional, {fn: options.inverse, inverse: options.fn});
});

Handlebars.registerHelper('with', function(context, options) {
Expand Down
17 changes: 17 additions & 0 deletions handlebars.js.nuspec
@@ -0,0 +1,17 @@
<?xml version="1.0"?>
<package>
<metadata>
<id>handlebars.js</id>
<version>1.0.0-rc.4</version>
<authors>handlebars.js Authors</authors>
<licenseUrl>https://github.com/wycats/handlebars.js/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/wycats/handlebars.js/</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Extension of the Mustache logicless template language</description>
<releaseNotes></releaseNotes>
<tags>handlebars mustache template html</tags>
</metadata>
<files>
<file src="dist\handlebars.js" target="Content\Scripts" />
</files>
</package>
11 changes: 11 additions & 0 deletions lib/handlebars.js
Expand Up @@ -21,6 +21,17 @@ Handlebars.create = create;

module.exports = Handlebars; // instantiate an instance

// Publish a Node.js require() handler for .handlebars and .hbs files
if (require.extensions) {
var extension = function(module, filename) {
var fs = require("fs");
var templateString = fs.readFileSync(filename, "utf8");
module.exports = Handlebars.compile(templateString);
};
require.extensions[".handlebars"] = extension;
require.extensions[".hbs"] = extension;
}

// BEGIN(BROWSER)

// END(BROWSER)
Expand Down
14 changes: 7 additions & 7 deletions lib/handlebars/base.js
Expand Up @@ -6,7 +6,7 @@ var Handlebars = {};

// BEGIN(BROWSER)

Handlebars.VERSION = "1.0.0-rc.3";
Handlebars.VERSION = "1.0.0-rc.4";
Handlebars.COMPILER_REVISION = 3;

Handlebars.REVISION_CHANGES = {
Expand Down Expand Up @@ -129,19 +129,19 @@ Handlebars.registerHelper('each', function(context, options) {
return ret;
});

Handlebars.registerHelper('if', function(context, options) {
var type = toString.call(context);
if(type === functionType) { context = context.call(this); }
Handlebars.registerHelper('if', function(conditional, options) {
var type = toString.call(conditional);
if(type === functionType) { conditional = conditional.call(this); }

if(!context || Handlebars.Utils.isEmpty(context)) {
if(!conditional || Handlebars.Utils.isEmpty(conditional)) {
return options.inverse(this);
} else {
return options.fn(this);
}
});

Handlebars.registerHelper('unless', function(context, options) {
return Handlebars.helpers['if'].call(this, context, {fn: options.inverse, inverse: options.fn});
Handlebars.registerHelper('unless', function(conditional, options) {
return Handlebars.helpers['if'].call(this, conditional, {fn: options.inverse, inverse: options.fn});
});

Handlebars.registerHelper('with', function(context, options) {
Expand Down
2 changes: 2 additions & 0 deletions lib/handlebars/utils.js
@@ -1,5 +1,7 @@
exports.attach = function(Handlebars) {

var toString = Object.prototype.toString;

// BEGIN(BROWSER)

var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,7 +1,7 @@
{
"name": "handlebars",
"description": "Extension of the Mustache logicless template language",
"version": "1.0.10",
"version": "1.0.11",
"homepage": "http://www.handlebarsjs.com/",
"keywords": [
"handlebars mustache template html"
Expand Down

0 comments on commit c2c3808

Please sign in to comment.