diff --git a/lib/dust-helpers.js b/lib/dust-helpers.js index 15cbc9c..d8b033a 100644 --- a/lib/dust-helpers.js +++ b/lib/dust-helpers.js @@ -202,18 +202,6 @@ var helpers = { return chunk; }, - "idx": function(chunk, context, bodies) { - var body = bodies.block; - // Will be removed in 1.6 - _deprecated("{@idx}"); - if(body) { - return body(chunk, context.push(context.stack.index)); - } - else { - return chunk; - } - }, - /** * contextDump helper * @param key specifies how much to dump. @@ -261,37 +249,6 @@ var helpers = { cond argument should evaluate to a valid javascript expression **/ - "if": function( chunk, context, bodies, params ) { - var body = bodies.block, - skip = bodies['else'], - cond; - - if(params && params.cond) { - // Will be removed in 1.6 - _deprecated("{@if}"); - - cond = dust.helpers.tap(params.cond, chunk, context); - // eval expressions with given dust references - if(eval(cond)){ - if(body) { - return chunk.render( bodies.block, context ); - } - else { - _log("Missing body block in the if helper!"); - return chunk; - } - } - if(skip){ - return chunk.render( bodies['else'], context ); - } - } - // no condition - else { - _log("No condition given in the if helper!"); - } - return chunk; - }, - /** * math helper * @param key is the value to perform math against diff --git a/test/jasmine-test/spec/helpersTests.js b/test/jasmine-test/spec/helpersTests.js index b45fa3a..a307cdc 100644 --- a/test/jasmine-test/spec/helpersTests.js +++ b/test/jasmine-test/spec/helpersTests.js @@ -13,60 +13,6 @@ } ] }, - { - name: "if", - tests: [ - { - name: "if helper with no body", - source: '{@if cond="{x}<{y}"/}', - context: { x: 2, y: 3 }, - expected: "", - message: "should test if helper with no body and fail gracefully" - }, - { - name: "if helper with no condition", - source: '{@if}Hello{/if}', - context: { x: 2, y: 3 }, - expected: "", - message: "should test if helper with no condition fails gracefully" - }, - { - name: "if helper without else", - source: '{@if cond="{x}<{y}"}