Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/handlebars/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,19 @@ HandlebarsEnvironment.prototype = {
},

registerDecorator: function(name, fn) {
this.log('warn', 'Custom decorators are deprecated and will be removed in the future. Join the discussion at https://github.com/wycats/handlebars.js/issues/1574');
this.registerDecoratorWithoutDeprecationWarning(name, fn);
},

registerDecoratorWithoutDeprecationWarning: function(name, fn) {
if (toString.call(name) === objectType) {
if (fn) { throw new Exception('Arg not supported with multiple decorators'); }
extend(this.decorators, name);
} else {
this.decorators[name] = fn;
}
},

unregisterDecorator: function(name) {
delete this.decorators[name];
}
Expand Down
2 changes: 1 addition & 1 deletion lib/handlebars/decorators/inline.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {extend} from '../utils';

export default function(instance) {
instance.registerDecorator('inline', function(fn, props, container, options) {
instance.registerDecoratorWithoutDeprecationWarning('inline', function(fn, props, container, options) {
let ret = fn;
if (!props.partials) {
props.partials = {};
Expand Down
2 changes: 1 addition & 1 deletion spec/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ describe('blocks', function() {
equals(run, true);
});

describe('registration', function() {
describe.only('registration', function() {
it('unregisters', function() {
handlebarsEnv.decorators = {};

Expand Down