handlebars
Advanced tools
Comparing version 3.0.3 to 3.0.4
@@ -9,6 +9,14 @@ # How to Contribute | ||
Pull requests containing only failing thats demonstrating the issue are welcomed and this also helps ensure that your issue won't regress in the future once it's fixed. | ||
Pull requests containing only failing tests demonstrating the issue are welcomed and this also helps ensure that your issue won't regress in the future once it's fixed. | ||
Documentation issues on the handlebarsjs.com site should be reported on [handlebars-site](https://github.com/wycats/handlebars-site). | ||
## Branches | ||
* The branch `4.x` contains the currently released version. Bugfixes should be made in this branch. | ||
* The branch `master` contains the next version. A release date is not yet specified. Maintainers | ||
should merge the branch `4.x` into the master branch regularly. | ||
* The branch `3.x` contains the previous release. Relevant bugfixes may be cherry-picked into this | ||
branch from the `4.x` branch. There should be no merges anymore between this branch and `4.x` or `master`. | ||
## Pull Requests | ||
@@ -46,2 +54,21 @@ | ||
## Running Tests | ||
To run tests locally, first install all dependencies. | ||
```sh | ||
npm install | ||
``` | ||
Clone the mustache specs into the spec/mustache folder. | ||
```sh | ||
cd spec | ||
rm -r mustache | ||
git clone https://github.com/mustache/spec.git mustache | ||
``` | ||
From the root directory, run the tests. | ||
```sh | ||
npm test | ||
``` | ||
## Ember testing | ||
@@ -48,0 +75,0 @@ |
define(['exports', 'module', './handlebars.runtime', './handlebars/compiler/ast', './handlebars/compiler/base', './handlebars/compiler/compiler', './handlebars/compiler/javascript-compiler', './handlebars/compiler/visitor', './handlebars/no-conflict'], function (exports, module, _handlebarsRuntime, _handlebarsCompilerAst, _handlebarsCompilerBase, _handlebarsCompilerCompiler, _handlebarsCompilerJavascriptCompiler, _handlebarsCompilerVisitor, _handlebarsNoConflict) { | ||
'use strict'; | ||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var _runtime = _interopRequire(_handlebarsRuntime); | ||
var _runtime = _interopRequireDefault(_handlebarsRuntime); | ||
// Compiler imports | ||
var _AST = _interopRequire(_handlebarsCompilerAst); | ||
var _AST = _interopRequireDefault(_handlebarsCompilerAst); | ||
var _JavaScriptCompiler = _interopRequire(_handlebarsCompilerJavascriptCompiler); | ||
var _JavaScriptCompiler = _interopRequireDefault(_handlebarsCompilerJavascriptCompiler); | ||
var _Visitor = _interopRequire(_handlebarsCompilerVisitor); | ||
var _Visitor = _interopRequireDefault(_handlebarsCompilerVisitor); | ||
var _noConflict = _interopRequire(_handlebarsNoConflict); | ||
var _noConflict = _interopRequireDefault(_handlebarsNoConflict); | ||
var _create = _runtime.create; | ||
var _create = _runtime['default'].create; | ||
function create() { | ||
@@ -29,5 +29,5 @@ var hb = _create(); | ||
hb.AST = _AST; | ||
hb.AST = _AST['default']; | ||
hb.Compiler = _handlebarsCompilerCompiler.Compiler; | ||
hb.JavaScriptCompiler = _JavaScriptCompiler; | ||
hb.JavaScriptCompiler = _JavaScriptCompiler['default']; | ||
hb.Parser = _handlebarsCompilerBase.parser; | ||
@@ -42,5 +42,5 @@ hb.parse = _handlebarsCompilerBase.parse; | ||
_noConflict(inst); | ||
_noConflict['default'](inst); | ||
inst.Visitor = _Visitor; | ||
inst.Visitor = _Visitor['default']; | ||
@@ -50,2 +50,2 @@ inst['default'] = inst; | ||
module.exports = inst; | ||
}); | ||
}); |
define(['exports', 'module', './handlebars/base', './handlebars/safe-string', './handlebars/exception', './handlebars/utils', './handlebars/runtime', './handlebars/no-conflict'], function (exports, module, _handlebarsBase, _handlebarsSafeString, _handlebarsException, _handlebarsUtils, _handlebarsRuntime, _handlebarsNoConflict) { | ||
'use strict'; | ||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
@@ -9,7 +9,7 @@ // Each of these augment the Handlebars object. No need to setup here. | ||
var _SafeString = _interopRequire(_handlebarsSafeString); | ||
var _SafeString = _interopRequireDefault(_handlebarsSafeString); | ||
var _Exception = _interopRequire(_handlebarsException); | ||
var _Exception = _interopRequireDefault(_handlebarsException); | ||
var _noConflict = _interopRequire(_handlebarsNoConflict); | ||
var _noConflict = _interopRequireDefault(_handlebarsNoConflict); | ||
@@ -21,4 +21,4 @@ // For compatibility and usage outside of module systems, make the Handlebars object a namespace | ||
_handlebarsUtils.extend(hb, _handlebarsBase); | ||
hb.SafeString = _SafeString; | ||
hb.Exception = _Exception; | ||
hb.SafeString = _SafeString['default']; | ||
hb.Exception = _Exception['default']; | ||
hb.Utils = _handlebarsUtils; | ||
@@ -38,3 +38,3 @@ hb.escapeExpression = _handlebarsUtils.escapeExpression; | ||
_noConflict(inst); | ||
_noConflict['default'](inst); | ||
@@ -44,2 +44,2 @@ inst['default'] = inst; | ||
module.exports = inst; | ||
}); | ||
}); |
define(['exports', './utils', './exception'], function (exports, _utils, _exception) { | ||
'use strict'; | ||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; | ||
exports.__esModule = true; | ||
@@ -10,4 +8,6 @@ exports.HandlebarsEnvironment = HandlebarsEnvironment; | ||
var _Exception = _interopRequire(_exception); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var _Exception = _interopRequireDefault(_exception); | ||
var VERSION = '3.0.1'; | ||
@@ -49,3 +49,3 @@ exports.VERSION = VERSION; | ||
if (fn) { | ||
throw new _Exception('Arg not supported with multiple helpers'); | ||
throw new _Exception['default']('Arg not supported with multiple helpers'); | ||
} | ||
@@ -66,3 +66,3 @@ _utils.extend(this.helpers, name); | ||
if (typeof partial === 'undefined') { | ||
throw new _Exception('Attempting to register a partial as undefined'); | ||
throw new _Exception['default']('Attempting to register a partial as undefined'); | ||
} | ||
@@ -78,3 +78,3 @@ this.partials[name] = partial; | ||
function registerDefaultHelpers(instance) { | ||
instance.registerHelper('helperMissing', function () { | ||
instance.registerHelper('helperMissing', function () /* [args, ]options */{ | ||
if (arguments.length === 1) { | ||
@@ -85,3 +85,3 @@ // A missing field in a {{foo}} constuct. | ||
// Someone is actually trying to call something, blow up. | ||
throw new _Exception('Missing helper: "' + arguments[arguments.length - 1].name + '"'); | ||
throw new _Exception['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"'); | ||
} | ||
@@ -121,3 +121,3 @@ }); | ||
if (!options) { | ||
throw new _Exception('Must pass iterator to #each'); | ||
throw new _Exception['default']('Must pass iterator to #each'); | ||
} | ||
@@ -274,2 +274,1 @@ | ||
}); | ||
/* [args, ]options */ |
@@ -138,3 +138,4 @@ define(['exports', 'module'], function (exports, module) { | ||
scopedId: function scopedId(path) { | ||
return /^\.|this\b/.test(path.original); | ||
return (/^\.|this\b/.test(path.original) | ||
); | ||
}, | ||
@@ -153,2 +154,2 @@ | ||
module.exports = AST; | ||
}); | ||
}); |
define(['exports', './parser', './ast', './whitespace-control', './helpers', '../utils'], function (exports, _parser, _ast, _whitespaceControl, _helpers, _utils) { | ||
'use strict'; | ||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; | ||
exports.__esModule = true; | ||
exports.parse = parse; | ||
var _parser2 = _interopRequire(_parser); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var _AST = _interopRequire(_ast); | ||
var _parser2 = _interopRequireDefault(_parser); | ||
var _WhitespaceControl = _interopRequire(_whitespaceControl); | ||
var _AST = _interopRequireDefault(_ast); | ||
exports.parser = _parser2; | ||
var _WhitespaceControl = _interopRequireDefault(_whitespaceControl); | ||
exports.parser = _parser2['default']; | ||
var yy = {}; | ||
_utils.extend(yy, _helpers, _AST); | ||
_utils.extend(yy, _helpers, _AST['default']); | ||
@@ -26,3 +26,3 @@ function parse(input, options) { | ||
_parser2.yy = yy; | ||
_parser2['default'].yy = yy; | ||
@@ -34,5 +34,5 @@ // Altering the shared object here, but this is ok as parser is a sync operation | ||
var strip = new _WhitespaceControl(); | ||
return strip.accept(_parser2.parse(input)); | ||
var strip = new _WhitespaceControl['default'](); | ||
return strip.accept(_parser2['default'].parse(input)); | ||
} | ||
}); | ||
}); |
define(['exports', 'module', '../utils'], function (exports, module, _utils) { | ||
/*global define */ | ||
'use strict'; | ||
@@ -15,2 +16,3 @@ | ||
} catch (err) {} | ||
/* NOP */ | ||
@@ -91,3 +93,3 @@ /* istanbul ignore if: tested but not covered in istanbul due to dist build */ | ||
empty: function empty() { | ||
var loc = arguments[0] === undefined ? this.currentLocation || { start: {} } : arguments[0]; | ||
var loc = arguments.length <= 0 || arguments[0] === undefined ? this.currentLocation || { start: {} } : arguments[0]; | ||
@@ -97,3 +99,3 @@ return new SourceNode(loc.start.line, loc.start.column, this.srcFile); | ||
wrap: function wrap(chunk) { | ||
var loc = arguments[1] === undefined ? this.currentLocation || { start: {} } : arguments[1]; | ||
var loc = arguments.length <= 1 || arguments[1] === undefined ? this.currentLocation || { start: {} } : arguments[1]; | ||
@@ -162,4 +164,1 @@ if (chunk instanceof SourceNode) { | ||
}); | ||
/*global define */ | ||
/* NOP */ |
define(['exports', '../exception', '../utils', './ast'], function (exports, _exception, _utils, _ast) { | ||
'use strict'; | ||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; | ||
exports.__esModule = true; | ||
@@ -11,6 +9,8 @@ exports.Compiler = Compiler; | ||
var _Exception = _interopRequire(_exception); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var _AST = _interopRequire(_ast); | ||
var _Exception = _interopRequireDefault(_exception); | ||
var _AST = _interopRequireDefault(_ast); | ||
var slice = [].slice; | ||
@@ -69,10 +69,10 @@ | ||
options.knownHelpers = { | ||
helperMissing: true, | ||
blockHelperMissing: true, | ||
each: true, | ||
'helperMissing': true, | ||
'blockHelperMissing': true, | ||
'each': true, | ||
'if': true, | ||
unless: true, | ||
'unless': true, | ||
'with': true, | ||
log: true, | ||
lookup: true | ||
'log': true, | ||
'lookup': true | ||
}; | ||
@@ -169,3 +169,3 @@ if (knownHelpers) { | ||
if (params.length > 1) { | ||
throw new _Exception('Unsupported number of partial arguments: ' + params.length, partial); | ||
throw new _Exception['default']('Unsupported number of partial arguments: ' + params.length, partial); | ||
} else if (!params.length) { | ||
@@ -251,3 +251,3 @@ params.push({ type: 'PathExpression', parts: [], depth: 0 }); | ||
} else if (this.options.knownHelpersOnly) { | ||
throw new _Exception('You specified knownHelpersOnly, but used the unknown helper ' + name, sexpr); | ||
throw new _Exception['default']('You specified knownHelpersOnly, but used the unknown helper ' + name, sexpr); | ||
} else { | ||
@@ -257,3 +257,3 @@ path.falsy = true; | ||
this.accept(path); | ||
this.opcode('invokeHelper', params.length, path.original, _AST.helpers.simpleId(path)); | ||
this.opcode('invokeHelper', params.length, path.original, _AST['default'].helpers.simpleId(path)); | ||
} | ||
@@ -267,3 +267,3 @@ }, | ||
var name = path.parts[0], | ||
scoped = _AST.helpers.scopedId(path), | ||
scoped = _AST['default'].helpers.scopedId(path), | ||
blockParamId = !path.depth && !scoped && this.blockParamIndex(name); | ||
@@ -334,3 +334,3 @@ | ||
classifySexpr: function classifySexpr(sexpr) { | ||
var isSimple = _AST.helpers.simpleId(sexpr.path); | ||
var isSimple = _AST['default'].helpers.simpleId(sexpr.path); | ||
@@ -341,3 +341,3 @@ var isBlockParam = isSimple && !!this.blockParamIndex(sexpr.path.parts[0]); | ||
// * its id is simple (a single part, not `this` or `..`) | ||
var isHelper = !isBlockParam && _AST.helpers.helperExpression(sexpr); | ||
var isHelper = !isBlockParam && _AST['default'].helpers.helperExpression(sexpr); | ||
@@ -399,3 +399,3 @@ // if a mustache is an eligible helper but not a definite | ||
var blockParamIndex = undefined; | ||
if (val.parts && !_AST.helpers.scopedId(val) && !val.depth) { | ||
if (val.parts && !_AST['default'].helpers.scopedId(val) && !val.depth) { | ||
blockParamIndex = this.blockParamIndex(val.parts[0]); | ||
@@ -448,3 +448,3 @@ } | ||
if (input == null || typeof input !== 'string' && input.type !== 'Program') { | ||
throw new _Exception('You must pass a string or Handlebars AST to Handlebars.precompile. You passed ' + input); | ||
throw new _Exception['default']('You must pass a string or Handlebars AST to Handlebars.precompile. You passed ' + input); | ||
} | ||
@@ -465,7 +465,7 @@ | ||
function compile(input, _x, env) { | ||
var options = arguments[1] === undefined ? {} : arguments[1]; | ||
function compile(input, options, env) { | ||
if (options === undefined) options = {}; | ||
if (input == null || typeof input !== 'string' && input.type !== 'Program') { | ||
throw new _Exception('You must pass a string or Handlebars AST to Handlebars.compile. You passed ' + input); | ||
throw new _Exception['default']('You must pass a string or Handlebars AST to Handlebars.compile. You passed ' + input); | ||
} | ||
@@ -531,5 +531,5 @@ | ||
// of the system. | ||
sexpr.path = new _AST.PathExpression(false, 0, [literal.original + ''], literal.original + '', literal.loc); | ||
sexpr.path = new _AST['default'].PathExpression(false, 0, [literal.original + ''], literal.original + '', literal.loc); | ||
} | ||
} | ||
}); | ||
}); |
define(['exports', '../exception'], function (exports, _exception) { | ||
'use strict'; | ||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; | ||
exports.__esModule = true; | ||
@@ -16,4 +14,6 @@ exports.SourceLocation = SourceLocation; | ||
var _Exception = _interopRequire(_exception); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var _Exception = _interopRequireDefault(_exception); | ||
function SourceLocation(source, locInfo) { | ||
@@ -68,3 +68,3 @@ this.source = source; | ||
if (dig.length > 0) { | ||
throw new _Exception('Invalid path: ' + original, { loc: locInfo }); | ||
throw new _Exception['default']('Invalid path: ' + original, { loc: locInfo }); | ||
} else if (part === '..') { | ||
@@ -94,3 +94,3 @@ depth++; | ||
throw new _Exception(openRawBlock.path.original + ' doesn\'t match ' + close, errorNode); | ||
throw new _Exception['default'](openRawBlock.path.original + " doesn't match " + close, errorNode); | ||
} | ||
@@ -109,3 +109,3 @@ | ||
throw new _Exception(openBlock.path.original + ' doesn\'t match ' + close.path.original, errorNode); | ||
throw new _Exception['default'](openBlock.path.original + ' doesn\'t match ' + close.path.original, errorNode); | ||
} | ||
@@ -135,2 +135,2 @@ | ||
} | ||
}); | ||
}); |
define(['exports', 'module', '../base', '../exception', '../utils', './code-gen'], function (exports, module, _base, _exception, _utils, _codeGen) { | ||
'use strict'; | ||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var _Exception = _interopRequire(_exception); | ||
var _Exception = _interopRequireDefault(_exception); | ||
var _CodeGen = _interopRequire(_codeGen); | ||
var _CodeGen = _interopRequireDefault(_codeGen); | ||
@@ -23,3 +23,3 @@ function Literal(value) { | ||
} else { | ||
return [parent, '[\'', name, '\']']; | ||
return [parent, "['", name, "']"]; | ||
} | ||
@@ -112,3 +112,3 @@ }, | ||
if (this.stackSlot || this.inlineStack.length || this.compileStack.length) { | ||
throw new _Exception('Compile completed with content left on stack'); | ||
throw new _Exception['default']('Compile completed with content left on stack'); | ||
} | ||
@@ -171,3 +171,3 @@ | ||
this.lastContext = 0; | ||
this.source = new _CodeGen(this.options.srcName); | ||
this.source = new _CodeGen['default'](this.options.srcName); | ||
}, | ||
@@ -354,3 +354,3 @@ | ||
if (this.environment.isSimple) { | ||
this.pushSource(['else { ', this.appendToBuffer('\'\'', undefined, true), ' }']); | ||
this.pushSource(['else { ', this.appendToBuffer("''", undefined, true), ' }']); | ||
} | ||
@@ -815,3 +815,3 @@ } | ||
if (!this.isInline()) { | ||
throw new _Exception('replaceStack on non-inline'); | ||
throw new _Exception['default']('replaceStack on non-inline'); | ||
} | ||
@@ -886,3 +886,3 @@ | ||
if (!this.stackSlot) { | ||
throw new _Exception('Invalid stack pop'); | ||
throw new _Exception['default']('Invalid stack pop'); | ||
} | ||
@@ -1059,2 +1059,2 @@ this.stackSlot--; | ||
module.exports = JavaScriptCompiler; | ||
}); | ||
}); |
@@ -9,6 +9,7 @@ define(["exports", "module"], function (exports, module) { | ||
yy: {}, | ||
symbols_: { error: 2, root: 3, program: 4, EOF: 5, program_repetition0: 6, statement: 7, mustache: 8, block: 9, rawBlock: 10, partial: 11, content: 12, COMMENT: 13, CONTENT: 14, openRawBlock: 15, END_RAW_BLOCK: 16, OPEN_RAW_BLOCK: 17, helperName: 18, openRawBlock_repetition0: 19, openRawBlock_option0: 20, CLOSE_RAW_BLOCK: 21, openBlock: 22, block_option0: 23, closeBlock: 24, openInverse: 25, block_option1: 26, OPEN_BLOCK: 27, openBlock_repetition0: 28, openBlock_option0: 29, openBlock_option1: 30, CLOSE: 31, OPEN_INVERSE: 32, openInverse_repetition0: 33, openInverse_option0: 34, openInverse_option1: 35, openInverseChain: 36, OPEN_INVERSE_CHAIN: 37, openInverseChain_repetition0: 38, openInverseChain_option0: 39, openInverseChain_option1: 40, inverseAndProgram: 41, INVERSE: 42, inverseChain: 43, inverseChain_option0: 44, OPEN_ENDBLOCK: 45, OPEN: 46, mustache_repetition0: 47, mustache_option0: 48, OPEN_UNESCAPED: 49, mustache_repetition1: 50, mustache_option1: 51, CLOSE_UNESCAPED: 52, OPEN_PARTIAL: 53, partialName: 54, partial_repetition0: 55, partial_option0: 56, param: 57, sexpr: 58, OPEN_SEXPR: 59, sexpr_repetition0: 60, sexpr_option0: 61, CLOSE_SEXPR: 62, hash: 63, hash_repetition_plus0: 64, hashSegment: 65, ID: 66, EQUALS: 67, blockParams: 68, OPEN_BLOCK_PARAMS: 69, blockParams_repetition_plus0: 70, CLOSE_BLOCK_PARAMS: 71, path: 72, dataName: 73, STRING: 74, NUMBER: 75, BOOLEAN: 76, UNDEFINED: 77, NULL: 78, DATA: 79, pathSegments: 80, SEP: 81, $accept: 0, $end: 1 }, | ||
symbols_: { "error": 2, "root": 3, "program": 4, "EOF": 5, "program_repetition0": 6, "statement": 7, "mustache": 8, "block": 9, "rawBlock": 10, "partial": 11, "content": 12, "COMMENT": 13, "CONTENT": 14, "openRawBlock": 15, "END_RAW_BLOCK": 16, "OPEN_RAW_BLOCK": 17, "helperName": 18, "openRawBlock_repetition0": 19, "openRawBlock_option0": 20, "CLOSE_RAW_BLOCK": 21, "openBlock": 22, "block_option0": 23, "closeBlock": 24, "openInverse": 25, "block_option1": 26, "OPEN_BLOCK": 27, "openBlock_repetition0": 28, "openBlock_option0": 29, "openBlock_option1": 30, "CLOSE": 31, "OPEN_INVERSE": 32, "openInverse_repetition0": 33, "openInverse_option0": 34, "openInverse_option1": 35, "openInverseChain": 36, "OPEN_INVERSE_CHAIN": 37, "openInverseChain_repetition0": 38, "openInverseChain_option0": 39, "openInverseChain_option1": 40, "inverseAndProgram": 41, "INVERSE": 42, "inverseChain": 43, "inverseChain_option0": 44, "OPEN_ENDBLOCK": 45, "OPEN": 46, "mustache_repetition0": 47, "mustache_option0": 48, "OPEN_UNESCAPED": 49, "mustache_repetition1": 50, "mustache_option1": 51, "CLOSE_UNESCAPED": 52, "OPEN_PARTIAL": 53, "partialName": 54, "partial_repetition0": 55, "partial_option0": 56, "param": 57, "sexpr": 58, "OPEN_SEXPR": 59, "sexpr_repetition0": 60, "sexpr_option0": 61, "CLOSE_SEXPR": 62, "hash": 63, "hash_repetition_plus0": 64, "hashSegment": 65, "ID": 66, "EQUALS": 67, "blockParams": 68, "OPEN_BLOCK_PARAMS": 69, "blockParams_repetition_plus0": 70, "CLOSE_BLOCK_PARAMS": 71, "path": 72, "dataName": 73, "STRING": 74, "NUMBER": 75, "BOOLEAN": 76, "UNDEFINED": 77, "NULL": 78, "DATA": 79, "pathSegments": 80, "SEP": 81, "$accept": 0, "$end": 1 }, | ||
terminals_: { 2: "error", 5: "EOF", 13: "COMMENT", 14: "CONTENT", 16: "END_RAW_BLOCK", 17: "OPEN_RAW_BLOCK", 21: "CLOSE_RAW_BLOCK", 27: "OPEN_BLOCK", 31: "CLOSE", 32: "OPEN_INVERSE", 37: "OPEN_INVERSE_CHAIN", 42: "INVERSE", 45: "OPEN_ENDBLOCK", 46: "OPEN", 49: "OPEN_UNESCAPED", 52: "CLOSE_UNESCAPED", 53: "OPEN_PARTIAL", 59: "OPEN_SEXPR", 62: "CLOSE_SEXPR", 66: "ID", 67: "EQUALS", 69: "OPEN_BLOCK_PARAMS", 71: "CLOSE_BLOCK_PARAMS", 74: "STRING", 75: "NUMBER", 76: "BOOLEAN", 77: "UNDEFINED", 78: "NULL", 79: "DATA", 81: "SEP" }, | ||
productions_: [0, [3, 2], [4, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [12, 1], [10, 3], [15, 5], [9, 4], [9, 4], [22, 6], [25, 6], [36, 6], [41, 2], [43, 3], [43, 1], [24, 3], [8, 5], [8, 5], [11, 5], [57, 1], [57, 1], [58, 5], [63, 1], [65, 3], [68, 3], [18, 1], [18, 1], [18, 1], [18, 1], [18, 1], [18, 1], [18, 1], [54, 1], [54, 1], [73, 2], [72, 1], [80, 3], [80, 1], [6, 0], [6, 2], [19, 0], [19, 2], [20, 0], [20, 1], [23, 0], [23, 1], [26, 0], [26, 1], [28, 0], [28, 2], [29, 0], [29, 1], [30, 0], [30, 1], [33, 0], [33, 2], [34, 0], [34, 1], [35, 0], [35, 1], [38, 0], [38, 2], [39, 0], [39, 1], [40, 0], [40, 1], [44, 0], [44, 1], [47, 0], [47, 2], [48, 0], [48, 1], [50, 0], [50, 2], [51, 0], [51, 1], [55, 0], [55, 2], [56, 0], [56, 1], [60, 0], [60, 2], [61, 0], [61, 1], [64, 1], [64, 2], [70, 1], [70, 2]], | ||
performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { | ||
performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$ | ||
/*``*/) { | ||
@@ -355,4 +356,4 @@ var $0 = $$.length - 1; | ||
this.yylineno = this.yyleng = 0; | ||
this.yytext = this.matched = this.match = ""; | ||
this.conditionStack = ["INITIAL"]; | ||
this.yytext = this.matched = this.match = ''; | ||
this.conditionStack = ['INITIAL']; | ||
this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }; | ||
@@ -417,3 +418,3 @@ if (this.options.ranges) this.yylloc.range = [0, 0]; | ||
var past = this.matched.substr(0, this.matched.length - this.match.length); | ||
return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); | ||
return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, ""); | ||
}, | ||
@@ -425,3 +426,3 @@ upcomingInput: function upcomingInput() { | ||
} | ||
return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, ""); | ||
return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); | ||
}, | ||
@@ -441,4 +442,4 @@ showPosition: function showPosition() { | ||
if (!this._more) { | ||
this.yytext = ""; | ||
this.match = ""; | ||
this.yytext = ''; | ||
this.match = ''; | ||
} | ||
@@ -473,7 +474,3 @@ var rules = this._currentRules(); | ||
if (this.done && this._input) this.done = false; | ||
if (token) { | ||
return token; | ||
} else { | ||
return; | ||
} | ||
if (token) return token;else return; | ||
} | ||
@@ -483,3 +480,3 @@ if (this._input === "") { | ||
} else { | ||
return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { text: "", token: null, line: this.yylineno }); | ||
return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { text: "", token: null, line: this.yylineno }); | ||
} | ||
@@ -489,3 +486,3 @@ }, | ||
var r = this.next(); | ||
if (typeof r !== "undefined") { | ||
if (typeof r !== 'undefined') { | ||
return r; | ||
@@ -512,3 +509,4 @@ } else { | ||
lexer.options = {}; | ||
lexer.performAction = function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { | ||
lexer.performAction = function anonymous(yy, yy_, $avoiding_name_collisions, YY_START | ||
/*``*/) { | ||
@@ -531,5 +529,5 @@ function strip(start, end) { | ||
} | ||
if (yy_.yytext) { | ||
return 14; | ||
}break; | ||
if (yy_.yytext) return 14; | ||
break; | ||
case 1: | ||
@@ -568,3 +566,3 @@ return 14; | ||
this.popState(); | ||
this.begin("raw"); | ||
this.begin('raw'); | ||
return 21; | ||
@@ -603,3 +601,3 @@ | ||
this.popState(); | ||
this.begin("com"); | ||
this.begin('com'); | ||
@@ -637,3 +635,3 @@ break; | ||
case 29: | ||
yy_.yytext = strip(1, 2).replace(/\\"/g, "\"");return 74; | ||
yy_.yytext = strip(1, 2).replace(/\\"/g, '"');return 74; | ||
break; | ||
@@ -674,3 +672,3 @@ case 30: | ||
case 41: | ||
return "INVALID"; | ||
return 'INVALID'; | ||
break; | ||
@@ -683,3 +681,3 @@ case 42: | ||
lexer.rules = [/^(?:[^\x00]*?(?=(\{\{)))/, /^(?:[^\x00]+)/, /^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/, /^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/, /^(?:[^\x00]*?(?=(\{\{\{\{\/)))/, /^(?:[\s\S]*?--(~)?\}\})/, /^(?:\()/, /^(?:\))/, /^(?:\{\{\{\{)/, /^(?:\}\}\}\})/, /^(?:\{\{(~)?>)/, /^(?:\{\{(~)?#)/, /^(?:\{\{(~)?\/)/, /^(?:\{\{(~)?\^\s*(~)?\}\})/, /^(?:\{\{(~)?\s*else\s*(~)?\}\})/, /^(?:\{\{(~)?\^)/, /^(?:\{\{(~)?\s*else\b)/, /^(?:\{\{(~)?\{)/, /^(?:\{\{(~)?&)/, /^(?:\{\{(~)?!--)/, /^(?:\{\{(~)?![\s\S]*?\}\})/, /^(?:\{\{(~)?)/, /^(?:=)/, /^(?:\.\.)/, /^(?:\.(?=([=~}\s\/.)|])))/, /^(?:[\/.])/, /^(?:\s+)/, /^(?:\}(~)?\}\})/, /^(?:(~)?\}\})/, /^(?:"(\\["]|[^"])*")/, /^(?:'(\\[']|[^'])*')/, /^(?:@)/, /^(?:true(?=([~}\s)])))/, /^(?:false(?=([~}\s)])))/, /^(?:undefined(?=([~}\s)])))/, /^(?:null(?=([~}\s)])))/, /^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/, /^(?:as\s+\|)/, /^(?:\|)/, /^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/, /^(?:\[[^\]]*\])/, /^(?:.)/, /^(?:$)/]; | ||
lexer.conditions = { mu: { rules: [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, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42], inclusive: false }, emu: { rules: [2], inclusive: false }, com: { rules: [5], inclusive: false }, raw: { rules: [3, 4], inclusive: false }, INITIAL: { rules: [0, 1, 42], inclusive: true } }; | ||
lexer.conditions = { "mu": { "rules": [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, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42], "inclusive": false }, "emu": { "rules": [2], "inclusive": false }, "com": { "rules": [5], "inclusive": false }, "raw": { "rules": [3, 4], "inclusive": false }, "INITIAL": { "rules": [0, 1, 42], "inclusive": true } }; | ||
return lexer; | ||
@@ -693,2 +691,2 @@ })(); | ||
})();module.exports = handlebars; | ||
}); | ||
}); |
define(['exports', './visitor'], function (exports, _visitor) { | ||
/*eslint-disable new-cap */ | ||
'use strict'; | ||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; | ||
exports.__esModule = true; | ||
exports.print = print; | ||
exports.PrintVisitor = PrintVisitor; | ||
/*eslint-disable new-cap */ | ||
var _Visitor = _interopRequire(_visitor); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var _Visitor = _interopRequireDefault(_visitor); | ||
function print(ast) { | ||
@@ -21,3 +21,3 @@ return new PrintVisitor().accept(ast); | ||
PrintVisitor.prototype = new _Visitor(); | ||
PrintVisitor.prototype = new _Visitor['default'](); | ||
@@ -104,7 +104,7 @@ PrintVisitor.prototype.pad = function (string) { | ||
PrintVisitor.prototype.ContentStatement = function (content) { | ||
return this.pad('CONTENT[ \'' + content.value + '\' ]'); | ||
return this.pad("CONTENT[ '" + content.value + "' ]"); | ||
}; | ||
PrintVisitor.prototype.CommentStatement = function (comment) { | ||
return this.pad('{{! \'' + comment.value + '\' }}'); | ||
return this.pad("{{! '" + comment.value + "' }}"); | ||
}; | ||
@@ -167,2 +167,2 @@ | ||
/*eslint-enable new-cap */ | ||
}); | ||
}); |
define(['exports', 'module', '../exception', './ast'], function (exports, module, _exception, _ast) { | ||
'use strict'; | ||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var _Exception = _interopRequire(_exception); | ||
var _Exception = _interopRequireDefault(_exception); | ||
var _AST = _interopRequire(_ast); | ||
var _AST = _interopRequireDefault(_ast); | ||
@@ -23,4 +23,4 @@ function Visitor() { | ||
// Hacky sanity check: | ||
if (value && (!value.type || !_AST[value.type])) { | ||
throw new _Exception('Unexpected node type "' + value.type + '" found when accepting ' + name + ' on ' + node.type); | ||
if (value && (!value.type || !_AST['default'][value.type])) { | ||
throw new _Exception['default']('Unexpected node type "' + value.type + '" found when accepting ' + name + ' on ' + node.type); | ||
} | ||
@@ -37,3 +37,3 @@ node[name] = value; | ||
if (!node[name]) { | ||
throw new _Exception(node.type + ' requires ' + name); | ||
throw new _Exception['default'](node.type + ' requires ' + name); | ||
} | ||
@@ -102,4 +102,4 @@ }, | ||
ContentStatement: function ContentStatement() {}, | ||
CommentStatement: function CommentStatement() {}, | ||
ContentStatement: function ContentStatement() /* content */{}, | ||
CommentStatement: function CommentStatement() /* comment */{}, | ||
@@ -112,9 +112,9 @@ SubExpression: function SubExpression(sexpr) { | ||
PathExpression: function PathExpression() {}, | ||
PathExpression: function PathExpression() /* path */{}, | ||
StringLiteral: function StringLiteral() {}, | ||
NumberLiteral: function NumberLiteral() {}, | ||
BooleanLiteral: function BooleanLiteral() {}, | ||
UndefinedLiteral: function UndefinedLiteral() {}, | ||
NullLiteral: function NullLiteral() {}, | ||
StringLiteral: function StringLiteral() /* string */{}, | ||
NumberLiteral: function NumberLiteral() /* number */{}, | ||
BooleanLiteral: function BooleanLiteral() /* bool */{}, | ||
UndefinedLiteral: function UndefinedLiteral() /* literal */{}, | ||
NullLiteral: function NullLiteral() /* literal */{}, | ||
@@ -131,2 +131,1 @@ Hash: function Hash(hash) { | ||
}); | ||
/* content */ /* comment */ /* path */ /* string */ /* number */ /* bool */ /* literal */ /* literal */ |
define(['exports', 'module', './visitor'], function (exports, module, _visitor) { | ||
'use strict'; | ||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var _Visitor = _interopRequire(_visitor); | ||
var _Visitor = _interopRequireDefault(_visitor); | ||
function WhitespaceControl() {} | ||
WhitespaceControl.prototype = new _Visitor(); | ||
WhitespaceControl.prototype = new _Visitor['default'](); | ||
@@ -209,2 +209,2 @@ WhitespaceControl.prototype.Program = function (program) { | ||
module.exports = WhitespaceControl; | ||
}); | ||
}); |
@@ -37,2 +37,2 @@ define(['exports', 'module'], function (exports, module) { | ||
module.exports = Exception; | ||
}); | ||
}); |
@@ -16,2 +16,2 @@ define(['exports', 'module'], function (exports, module) { | ||
}; | ||
}); | ||
}); |
define(['exports', './utils', './exception', './base'], function (exports, _utils, _exception, _base) { | ||
'use strict'; | ||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; | ||
exports.__esModule = true; | ||
exports.checkRevision = checkRevision; | ||
// TODO: Remove this line and break up compilePartial | ||
exports.template = template; | ||
@@ -17,4 +12,6 @@ exports.wrapProgram = wrapProgram; | ||
var _Exception = _interopRequire(_exception); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var _Exception = _interopRequireDefault(_exception); | ||
function checkRevision(compilerInfo) { | ||
@@ -28,6 +25,6 @@ var compilerRevision = compilerInfo && compilerInfo[0] || 1, | ||
compilerVersions = _base.REVISION_CHANGES[compilerRevision]; | ||
throw new _Exception('Template was precompiled with an older version of Handlebars than the current runtime. ' + 'Please update your precompiler to a newer version (' + runtimeVersions + ') or downgrade your runtime to an older version (' + compilerVersions + ').'); | ||
throw new _Exception['default']('Template was precompiled with an older version of Handlebars than the current runtime. ' + 'Please update your precompiler to a newer version (' + runtimeVersions + ') or downgrade your runtime to an older version (' + compilerVersions + ').'); | ||
} else { | ||
// Use the embedded version info since the runtime doesn't know about this revision yet | ||
throw new _Exception('Template was precompiled with a newer version of Handlebars than the current runtime. ' + 'Please update your runtime to a newer version (' + compilerInfo[1] + ').'); | ||
throw new _Exception['default']('Template was precompiled with a newer version of Handlebars than the current runtime. ' + 'Please update your runtime to a newer version (' + compilerInfo[1] + ').'); | ||
} | ||
@@ -40,6 +37,6 @@ } | ||
if (!env) { | ||
throw new _Exception('No environment passed to template'); | ||
throw new _Exception['default']('No environment passed to template'); | ||
} | ||
if (!templateSpec || !templateSpec.main) { | ||
throw new _Exception('Unknown template object: ' + typeof templateSpec); | ||
throw new _Exception['default']('Unknown template object: ' + typeof templateSpec); | ||
} | ||
@@ -77,3 +74,3 @@ | ||
} else { | ||
throw new _Exception('The partial ' + options.name + ' could not be compiled when running in runtime-only mode'); | ||
throw new _Exception['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode'); | ||
} | ||
@@ -86,3 +83,3 @@ } | ||
if (!(name in obj)) { | ||
throw new _Exception('"' + name + '" not defined in ' + obj); | ||
throw new _Exception['default']('"' + name + '" not defined in ' + obj); | ||
} | ||
@@ -143,3 +140,3 @@ return obj[name]; | ||
function ret(context) { | ||
var options = arguments[1] === undefined ? {} : arguments[1]; | ||
var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; | ||
@@ -177,6 +174,6 @@ var data = options.data; | ||
if (templateSpec.useBlockParams && !blockParams) { | ||
throw new _Exception('must pass block params'); | ||
throw new _Exception['default']('must pass block params'); | ||
} | ||
if (templateSpec.useDepths && !depths) { | ||
throw new _Exception('must pass parent depths'); | ||
throw new _Exception['default']('must pass parent depths'); | ||
} | ||
@@ -191,3 +188,3 @@ | ||
function prog(context) { | ||
var options = arguments[1] === undefined ? {} : arguments[1]; | ||
var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; | ||
@@ -217,3 +214,3 @@ return fn.call(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), depths && [context].concat(depths)); | ||
if (partial === undefined) { | ||
throw new _Exception('The partial ' + options.name + ' could not be found'); | ||
throw new _Exception['default']('The partial ' + options.name + ' could not be found'); | ||
} else if (partial instanceof Function) { | ||
@@ -235,2 +232,2 @@ return partial(context, options); | ||
} | ||
}); | ||
}); |
@@ -14,2 +14,2 @@ define(['exports', 'module'], function (exports, module) { | ||
module.exports = SafeString; | ||
}); | ||
}); |
@@ -6,4 +6,2 @@ define(['exports'], function (exports) { | ||
exports.extend = extend; | ||
// Older IE versions do not directly support indexOf so we must implement our own, sadly. | ||
exports.indexOf = indexOf; | ||
@@ -19,8 +17,9 @@ exports.escapeExpression = escapeExpression; | ||
'"': '"', | ||
'\'': ''', | ||
'`': '`' | ||
"'": ''', | ||
'`': '`', | ||
'=': '=' | ||
}; | ||
var badChars = /[&<>"'`]/g, | ||
possible = /[&<>"'`]/; | ||
var badChars = /[&<>"'`=]/g, | ||
possible = /[&<>"'`=]/; | ||
@@ -66,4 +65,7 @@ function escapeChar(chr) { | ||
return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false; | ||
};exports.isArray = isArray; | ||
}; | ||
exports.isArray = isArray; | ||
// Older IE versions do not directly support indexOf so we must implement our own, sadly. | ||
function indexOf(array, value) { | ||
@@ -119,2 +121,2 @@ for (var i = 0, len = array.length; i < len; i++) { | ||
} | ||
}); | ||
}); |
define(['exports', 'fs', './handlebars', 'path', 'source-map', 'uglify-js'], function (exports, _fs, _handlebars, _path, _sourceMap, _uglifyJs) { | ||
/*eslint-disable no-console */ | ||
'use strict'; | ||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
/*eslint-disable no-console */ | ||
var _fs2 = _interopRequireDefault(_fs); | ||
var _fs2 = _interopRequire(_fs); | ||
var _uglify = _interopRequireDefault(_uglifyJs); | ||
var _uglify = _interopRequire(_uglifyJs); | ||
module.exports.cli = function (opts) { | ||
@@ -24,3 +23,3 @@ if (opts.version) { | ||
try { | ||
_fs2.statSync(template); | ||
_fs2['default'].statSync(template); | ||
} catch (err) { | ||
@@ -34,3 +33,3 @@ throw new _handlebars.Exception('Unable to open template file "' + template + '"'); | ||
} | ||
if (opts.simple && (opts.templates.length !== 1 || _fs2.statSync(opts.templates[0]).isDirectory())) { | ||
if (opts.simple && (opts.templates.length !== 1 || _fs2['default'].statSync(opts.templates[0]).isDirectory())) { | ||
throw new _handlebars.Exception('Unable to output multiple templates in simple mode'); | ||
@@ -76,8 +75,8 @@ } | ||
var path = template, | ||
stat = _fs2.statSync(path); | ||
stat = _fs2['default'].statSync(path); | ||
if (stat.isDirectory()) { | ||
_fs2.readdirSync(template).map(function (file) { | ||
_fs2['default'].readdirSync(template).map(function (file) { | ||
var childPath = template + '/' + file; | ||
if (extension.test(childPath) || _fs2.statSync(childPath).isDirectory()) { | ||
if (extension.test(childPath) || _fs2['default'].statSync(childPath).isDirectory()) { | ||
processTemplate(childPath, root || template); | ||
@@ -87,3 +86,3 @@ } | ||
} else { | ||
var data = _fs2.readFileSync(path, 'utf8'); | ||
var data = _fs2['default'].readFileSync(path, 'utf8'); | ||
@@ -125,3 +124,3 @@ if (opts.bom && data.indexOf('') === 0) { | ||
} else if (opts.partial) { | ||
if (opts.amd && (opts.templates.length == 1 && !_fs2.statSync(opts.templates[0]).isDirectory())) { | ||
if (opts.amd && opts.templates.length == 1 && !_fs2['default'].statSync(opts.templates[0]).isDirectory()) { | ||
output.add('return '); | ||
@@ -131,3 +130,3 @@ } | ||
} else { | ||
if (opts.amd && (opts.templates.length == 1 && !_fs2.statSync(opts.templates[0]).isDirectory())) { | ||
if (opts.amd && opts.templates.length == 1 && !_fs2['default'].statSync(opts.templates[0]).isDirectory()) { | ||
output.add('return '); | ||
@@ -147,3 +146,3 @@ } | ||
if (opts.amd) { | ||
if (opts.templates.length > 1 || opts.templates.length == 1 && _fs2.statSync(opts.templates[0]).isDirectory()) { | ||
if (opts.templates.length > 1 || opts.templates.length == 1 && _fs2['default'].statSync(opts.templates[0]).isDirectory()) { | ||
if (opts.partial) { | ||
@@ -169,3 +168,3 @@ output.add('return Handlebars.partials;\n'); | ||
if (opts.min) { | ||
output = _uglify.minify(output.code, { | ||
output = _uglify['default'].minify(output.code, { | ||
fromString: true, | ||
@@ -182,3 +181,3 @@ | ||
if (opts.map) { | ||
_fs2.writeFileSync(opts.map, output.map, 'utf8'); | ||
_fs2['default'].writeFileSync(opts.map, output.map, 'utf8'); | ||
} | ||
@@ -188,3 +187,3 @@ output = output.code; | ||
if (opts.output) { | ||
_fs2.writeFileSync(opts.output, output, 'utf8'); | ||
_fs2['default'].writeFileSync(opts.output, output, 'utf8'); | ||
} else { | ||
@@ -194,2 +193,2 @@ console.log(output); | ||
}; | ||
}); | ||
}); |
'use strict'; | ||
var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; | ||
exports.__esModule = true; | ||
var _runtime = require('./handlebars.runtime'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var _runtime2 = _interopRequireWildcard(_runtime); | ||
var _handlebarsRuntime = require('./handlebars.runtime'); | ||
var _handlebarsRuntime2 = _interopRequireDefault(_handlebarsRuntime); | ||
// Compiler imports | ||
var _AST = require('./handlebars/compiler/ast'); | ||
var _handlebarsCompilerAst = require('./handlebars/compiler/ast'); | ||
var _AST2 = _interopRequireWildcard(_AST); | ||
var _handlebarsCompilerAst2 = _interopRequireDefault(_handlebarsCompilerAst); | ||
var _Parser$parse = require('./handlebars/compiler/base'); | ||
var _handlebarsCompilerBase = require('./handlebars/compiler/base'); | ||
var _Compiler$compile$precompile = require('./handlebars/compiler/compiler'); | ||
var _handlebarsCompilerCompiler = require('./handlebars/compiler/compiler'); | ||
var _JavaScriptCompiler = require('./handlebars/compiler/javascript-compiler'); | ||
var _handlebarsCompilerJavascriptCompiler = require('./handlebars/compiler/javascript-compiler'); | ||
var _JavaScriptCompiler2 = _interopRequireWildcard(_JavaScriptCompiler); | ||
var _handlebarsCompilerJavascriptCompiler2 = _interopRequireDefault(_handlebarsCompilerJavascriptCompiler); | ||
var _Visitor = require('./handlebars/compiler/visitor'); | ||
var _handlebarsCompilerVisitor = require('./handlebars/compiler/visitor'); | ||
var _Visitor2 = _interopRequireWildcard(_Visitor); | ||
var _handlebarsCompilerVisitor2 = _interopRequireDefault(_handlebarsCompilerVisitor); | ||
var _noConflict = require('./handlebars/no-conflict'); | ||
var _handlebarsNoConflict = require('./handlebars/no-conflict'); | ||
var _noConflict2 = _interopRequireWildcard(_noConflict); | ||
var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict); | ||
var _create = _runtime2['default'].create; | ||
var _create = _handlebarsRuntime2['default'].create; | ||
function create() { | ||
@@ -38,13 +38,13 @@ var hb = _create(); | ||
hb.compile = function (input, options) { | ||
return _Compiler$compile$precompile.compile(input, options, hb); | ||
return _handlebarsCompilerCompiler.compile(input, options, hb); | ||
}; | ||
hb.precompile = function (input, options) { | ||
return _Compiler$compile$precompile.precompile(input, options, hb); | ||
return _handlebarsCompilerCompiler.precompile(input, options, hb); | ||
}; | ||
hb.AST = _AST2['default']; | ||
hb.Compiler = _Compiler$compile$precompile.Compiler; | ||
hb.JavaScriptCompiler = _JavaScriptCompiler2['default']; | ||
hb.Parser = _Parser$parse.parser; | ||
hb.parse = _Parser$parse.parse; | ||
hb.AST = _handlebarsCompilerAst2['default']; | ||
hb.Compiler = _handlebarsCompilerCompiler.Compiler; | ||
hb.JavaScriptCompiler = _handlebarsCompilerJavascriptCompiler2['default']; | ||
hb.Parser = _handlebarsCompilerBase.parser; | ||
hb.parse = _handlebarsCompilerBase.parse; | ||
@@ -57,5 +57,5 @@ return hb; | ||
_noConflict2['default'](inst); | ||
_handlebarsNoConflict2['default'](inst); | ||
inst.Visitor = _Visitor2['default']; | ||
inst.Visitor = _handlebarsCompilerVisitor2['default']; | ||
@@ -65,2 +65,2 @@ inst['default'] = inst; | ||
exports['default'] = inst; | ||
module.exports = exports['default']; | ||
module.exports = exports['default']; |
'use strict'; | ||
var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; | ||
exports.__esModule = true; | ||
var _import = require('./handlebars/base'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var base = _interopRequireWildcard(_import); | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } | ||
var _handlebarsBase = require('./handlebars/base'); | ||
var base = _interopRequireWildcard(_handlebarsBase); | ||
// Each of these augment the Handlebars object. No need to setup here. | ||
// (This is done to easily share code between commonjs and browse envs) | ||
var _SafeString = require('./handlebars/safe-string'); | ||
var _handlebarsSafeString = require('./handlebars/safe-string'); | ||
var _SafeString2 = _interopRequireWildcard(_SafeString); | ||
var _handlebarsSafeString2 = _interopRequireDefault(_handlebarsSafeString); | ||
var _Exception = require('./handlebars/exception'); | ||
var _handlebarsException = require('./handlebars/exception'); | ||
var _Exception2 = _interopRequireWildcard(_Exception); | ||
var _handlebarsException2 = _interopRequireDefault(_handlebarsException); | ||
var _import2 = require('./handlebars/utils'); | ||
var _handlebarsUtils = require('./handlebars/utils'); | ||
var Utils = _interopRequireWildcard(_import2); | ||
var Utils = _interopRequireWildcard(_handlebarsUtils); | ||
var _import3 = require('./handlebars/runtime'); | ||
var _handlebarsRuntime = require('./handlebars/runtime'); | ||
var runtime = _interopRequireWildcard(_import3); | ||
var runtime = _interopRequireWildcard(_handlebarsRuntime); | ||
var _noConflict = require('./handlebars/no-conflict'); | ||
var _handlebarsNoConflict = require('./handlebars/no-conflict'); | ||
var _noConflict2 = _interopRequireWildcard(_noConflict); | ||
var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict); | ||
@@ -39,4 +41,4 @@ // For compatibility and usage outside of module systems, make the Handlebars object a namespace | ||
Utils.extend(hb, base); | ||
hb.SafeString = _SafeString2['default']; | ||
hb.Exception = _Exception2['default']; | ||
hb.SafeString = _handlebarsSafeString2['default']; | ||
hb.Exception = _handlebarsException2['default']; | ||
hb.Utils = Utils; | ||
@@ -56,3 +58,3 @@ hb.escapeExpression = Utils.escapeExpression; | ||
_noConflict2['default'](inst); | ||
_handlebarsNoConflict2['default'](inst); | ||
@@ -62,2 +64,2 @@ inst['default'] = inst; | ||
exports['default'] = inst; | ||
module.exports = exports['default']; | ||
module.exports = exports['default']; |
'use strict'; | ||
var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; | ||
exports.__esModule = true; | ||
@@ -9,10 +7,14 @@ exports.HandlebarsEnvironment = HandlebarsEnvironment; | ||
var _import = require('./utils'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var Utils = _interopRequireWildcard(_import); | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } | ||
var _Exception = require('./exception'); | ||
var _utils = require('./utils'); | ||
var _Exception2 = _interopRequireWildcard(_Exception); | ||
var Utils = _interopRequireWildcard(_utils); | ||
var _exception = require('./exception'); | ||
var _exception2 = _interopRequireDefault(_exception); | ||
var VERSION = '3.0.1'; | ||
@@ -54,3 +56,3 @@ exports.VERSION = VERSION; | ||
if (fn) { | ||
throw new _Exception2['default']('Arg not supported with multiple helpers'); | ||
throw new _exception2['default']('Arg not supported with multiple helpers'); | ||
} | ||
@@ -71,3 +73,3 @@ Utils.extend(this.helpers, name); | ||
if (typeof partial === 'undefined') { | ||
throw new _Exception2['default']('Attempting to register a partial as undefined'); | ||
throw new _exception2['default']('Attempting to register a partial as undefined'); | ||
} | ||
@@ -83,3 +85,3 @@ this.partials[name] = partial; | ||
function registerDefaultHelpers(instance) { | ||
instance.registerHelper('helperMissing', function () { | ||
instance.registerHelper('helperMissing', function () /* [args, ]options */{ | ||
if (arguments.length === 1) { | ||
@@ -90,3 +92,3 @@ // A missing field in a {{foo}} constuct. | ||
// Someone is actually trying to call something, blow up. | ||
throw new _Exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"'); | ||
throw new _exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"'); | ||
} | ||
@@ -126,3 +128,3 @@ }); | ||
if (!options) { | ||
throw new _Exception2['default']('Must pass iterator to #each'); | ||
throw new _exception2['default']('Must pass iterator to #each'); | ||
} | ||
@@ -278,3 +280,1 @@ | ||
} | ||
/* [args, ]options */ |
@@ -138,3 +138,4 @@ 'use strict'; | ||
scopedId: function scopedId(path) { | ||
return /^\.|this\b/.test(path.original); | ||
return (/^\.|this\b/.test(path.original) | ||
); | ||
}, | ||
@@ -153,2 +154,2 @@ | ||
exports['default'] = AST; | ||
module.exports = exports['default']; | ||
module.exports = exports['default']; |
'use strict'; | ||
var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; | ||
exports.__esModule = true; | ||
exports.parse = parse; | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var _parser = require('./parser'); | ||
var _parser2 = _interopRequireWildcard(_parser); | ||
var _parser2 = _interopRequireDefault(_parser); | ||
var _AST = require('./ast'); | ||
var _ast = require('./ast'); | ||
var _AST2 = _interopRequireWildcard(_AST); | ||
var _ast2 = _interopRequireDefault(_ast); | ||
var _WhitespaceControl = require('./whitespace-control'); | ||
var _whitespaceControl = require('./whitespace-control'); | ||
var _WhitespaceControl2 = _interopRequireWildcard(_WhitespaceControl); | ||
var _whitespaceControl2 = _interopRequireDefault(_whitespaceControl); | ||
var _import = require('./helpers'); | ||
var _helpers = require('./helpers'); | ||
var Helpers = _interopRequireWildcard(_import); | ||
var Helpers = _interopRequireWildcard(_helpers); | ||
var _extend = require('../utils'); | ||
var _utils = require('../utils'); | ||
@@ -29,3 +31,3 @@ exports.parser = _parser2['default']; | ||
var yy = {}; | ||
_extend.extend(yy, Helpers, _AST2['default']); | ||
_utils.extend(yy, Helpers, _ast2['default']); | ||
@@ -45,4 +47,4 @@ function parse(input, options) { | ||
var strip = new _WhitespaceControl2['default'](); | ||
var strip = new _whitespaceControl2['default'](); | ||
return strip.accept(_parser2['default'].parse(input)); | ||
} | ||
} |
@@ -0,7 +1,7 @@ | ||
/*global define */ | ||
'use strict'; | ||
exports.__esModule = true; | ||
/*global define */ | ||
var _isArray = require('../utils'); | ||
var _utils = require('../utils'); | ||
@@ -19,2 +19,3 @@ var SourceNode = undefined; | ||
} catch (err) {} | ||
/* NOP */ | ||
@@ -32,3 +33,3 @@ /* istanbul ignore if: tested but not covered in istanbul due to dist build */ | ||
add: function add(chunks) { | ||
if (_isArray.isArray(chunks)) { | ||
if (_utils.isArray(chunks)) { | ||
chunks = chunks.join(''); | ||
@@ -39,3 +40,3 @@ } | ||
prepend: function prepend(chunks) { | ||
if (_isArray.isArray(chunks)) { | ||
if (_utils.isArray(chunks)) { | ||
chunks = chunks.join(''); | ||
@@ -55,3 +56,3 @@ } | ||
function castChunk(chunk, codeGen, loc) { | ||
if (_isArray.isArray(chunk)) { | ||
if (_utils.isArray(chunk)) { | ||
var ret = []; | ||
@@ -98,3 +99,3 @@ | ||
empty: function empty() { | ||
var loc = arguments[0] === undefined ? this.currentLocation || { start: {} } : arguments[0]; | ||
var loc = arguments.length <= 0 || arguments[0] === undefined ? this.currentLocation || { start: {} } : arguments[0]; | ||
@@ -104,3 +105,3 @@ return new SourceNode(loc.start.line, loc.start.column, this.srcFile); | ||
wrap: function wrap(chunk) { | ||
var loc = arguments[1] === undefined ? this.currentLocation || { start: {} } : arguments[1]; | ||
var loc = arguments.length <= 1 || arguments[1] === undefined ? this.currentLocation || { start: {} } : arguments[1]; | ||
@@ -169,3 +170,1 @@ if (chunk instanceof SourceNode) { | ||
module.exports = exports['default']; | ||
/* NOP */ |
'use strict'; | ||
var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; | ||
exports.__esModule = true; | ||
@@ -10,12 +8,14 @@ exports.Compiler = Compiler; | ||
var _Exception = require('../exception'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var _Exception2 = _interopRequireWildcard(_Exception); | ||
var _exception = require('../exception'); | ||
var _isArray$indexOf = require('../utils'); | ||
var _exception2 = _interopRequireDefault(_exception); | ||
var _AST = require('./ast'); | ||
var _utils = require('../utils'); | ||
var _AST2 = _interopRequireWildcard(_AST); | ||
var _ast = require('./ast'); | ||
var _ast2 = _interopRequireDefault(_ast); | ||
var slice = [].slice; | ||
@@ -74,10 +74,10 @@ | ||
options.knownHelpers = { | ||
helperMissing: true, | ||
blockHelperMissing: true, | ||
each: true, | ||
'helperMissing': true, | ||
'blockHelperMissing': true, | ||
'each': true, | ||
'if': true, | ||
unless: true, | ||
'unless': true, | ||
'with': true, | ||
log: true, | ||
lookup: true | ||
'log': true, | ||
'lookup': true | ||
}; | ||
@@ -174,3 +174,3 @@ if (knownHelpers) { | ||
if (params.length > 1) { | ||
throw new _Exception2['default']('Unsupported number of partial arguments: ' + params.length, partial); | ||
throw new _exception2['default']('Unsupported number of partial arguments: ' + params.length, partial); | ||
} else if (!params.length) { | ||
@@ -256,3 +256,3 @@ params.push({ type: 'PathExpression', parts: [], depth: 0 }); | ||
} else if (this.options.knownHelpersOnly) { | ||
throw new _Exception2['default']('You specified knownHelpersOnly, but used the unknown helper ' + name, sexpr); | ||
throw new _exception2['default']('You specified knownHelpersOnly, but used the unknown helper ' + name, sexpr); | ||
} else { | ||
@@ -262,3 +262,3 @@ path.falsy = true; | ||
this.accept(path); | ||
this.opcode('invokeHelper', params.length, path.original, _AST2['default'].helpers.simpleId(path)); | ||
this.opcode('invokeHelper', params.length, path.original, _ast2['default'].helpers.simpleId(path)); | ||
} | ||
@@ -272,3 +272,3 @@ }, | ||
var name = path.parts[0], | ||
scoped = _AST2['default'].helpers.scopedId(path), | ||
scoped = _ast2['default'].helpers.scopedId(path), | ||
blockParamId = !path.depth && !scoped && this.blockParamIndex(name); | ||
@@ -339,3 +339,3 @@ | ||
classifySexpr: function classifySexpr(sexpr) { | ||
var isSimple = _AST2['default'].helpers.simpleId(sexpr.path); | ||
var isSimple = _ast2['default'].helpers.simpleId(sexpr.path); | ||
@@ -346,3 +346,3 @@ var isBlockParam = isSimple && !!this.blockParamIndex(sexpr.path.parts[0]); | ||
// * its id is simple (a single part, not `this` or `..`) | ||
var isHelper = !isBlockParam && _AST2['default'].helpers.helperExpression(sexpr); | ||
var isHelper = !isBlockParam && _ast2['default'].helpers.helperExpression(sexpr); | ||
@@ -404,3 +404,3 @@ // if a mustache is an eligible helper but not a definite | ||
var blockParamIndex = undefined; | ||
if (val.parts && !_AST2['default'].helpers.scopedId(val) && !val.depth) { | ||
if (val.parts && !_ast2['default'].helpers.scopedId(val) && !val.depth) { | ||
blockParamIndex = this.blockParamIndex(val.parts[0]); | ||
@@ -443,3 +443,3 @@ } | ||
var blockParams = this.options.blockParams[depth], | ||
param = blockParams && _isArray$indexOf.indexOf(blockParams, name); | ||
param = blockParams && _utils.indexOf(blockParams, name); | ||
if (blockParams && param >= 0) { | ||
@@ -454,3 +454,3 @@ return [depth, param]; | ||
if (input == null || typeof input !== 'string' && input.type !== 'Program') { | ||
throw new _Exception2['default']('You must pass a string or Handlebars AST to Handlebars.precompile. You passed ' + input); | ||
throw new _exception2['default']('You must pass a string or Handlebars AST to Handlebars.precompile. You passed ' + input); | ||
} | ||
@@ -471,7 +471,7 @@ | ||
function compile(input, _x, env) { | ||
var options = arguments[1] === undefined ? {} : arguments[1]; | ||
function compile(input, options, env) { | ||
if (options === undefined) options = {}; | ||
if (input == null || typeof input !== 'string' && input.type !== 'Program') { | ||
throw new _Exception2['default']('You must pass a string or Handlebars AST to Handlebars.compile. You passed ' + input); | ||
throw new _exception2['default']('You must pass a string or Handlebars AST to Handlebars.compile. You passed ' + input); | ||
} | ||
@@ -522,3 +522,3 @@ | ||
if (_isArray$indexOf.isArray(a) && _isArray$indexOf.isArray(b) && a.length === b.length) { | ||
if (_utils.isArray(a) && _utils.isArray(b) && a.length === b.length) { | ||
for (var i = 0; i < a.length; i++) { | ||
@@ -538,4 +538,4 @@ if (!argEquals(a[i], b[i])) { | ||
// of the system. | ||
sexpr.path = new _AST2['default'].PathExpression(false, 0, [literal.original + ''], literal.original + '', literal.loc); | ||
sexpr.path = new _ast2['default'].PathExpression(false, 0, [literal.original + ''], literal.original + '', literal.loc); | ||
} | ||
} | ||
} |
'use strict'; | ||
var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; | ||
exports.__esModule = true; | ||
@@ -15,6 +13,8 @@ exports.SourceLocation = SourceLocation; | ||
var _Exception = require('../exception'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var _Exception2 = _interopRequireWildcard(_Exception); | ||
var _exception = require('../exception'); | ||
var _exception2 = _interopRequireDefault(_exception); | ||
function SourceLocation(source, locInfo) { | ||
@@ -69,3 +69,3 @@ this.source = source; | ||
if (dig.length > 0) { | ||
throw new _Exception2['default']('Invalid path: ' + original, { loc: locInfo }); | ||
throw new _exception2['default']('Invalid path: ' + original, { loc: locInfo }); | ||
} else if (part === '..') { | ||
@@ -95,3 +95,3 @@ depth++; | ||
throw new _Exception2['default'](openRawBlock.path.original + ' doesn\'t match ' + close, errorNode); | ||
throw new _exception2['default'](openRawBlock.path.original + " doesn't match " + close, errorNode); | ||
} | ||
@@ -110,3 +110,3 @@ | ||
throw new _Exception2['default'](openBlock.path.original + ' doesn\'t match ' + close.path.original, errorNode); | ||
throw new _exception2['default'](openBlock.path.original + ' doesn\'t match ' + close.path.original, errorNode); | ||
} | ||
@@ -135,2 +135,2 @@ | ||
return new this.BlockStatement(openBlock.path, openBlock.params, openBlock.hash, program, inverse, openBlock.strip, inverseStrip, close && close.strip, this.locInfo(locInfo)); | ||
} | ||
} |
'use strict'; | ||
var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; | ||
exports.__esModule = true; | ||
var _COMPILER_REVISION$REVISION_CHANGES = require('../base'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var _Exception = require('../exception'); | ||
var _base = require('../base'); | ||
var _Exception2 = _interopRequireWildcard(_Exception); | ||
var _exception = require('../exception'); | ||
var _isArray = require('../utils'); | ||
var _exception2 = _interopRequireDefault(_exception); | ||
var _CodeGen = require('./code-gen'); | ||
var _utils = require('../utils'); | ||
var _CodeGen2 = _interopRequireWildcard(_CodeGen); | ||
var _codeGen = require('./code-gen'); | ||
var _codeGen2 = _interopRequireDefault(_codeGen); | ||
function Literal(value) { | ||
@@ -32,3 +32,3 @@ this.value = value; | ||
} else { | ||
return [parent, '[\'', name, '\']']; | ||
return [parent, "['", name, "']"]; | ||
} | ||
@@ -41,4 +41,4 @@ }, | ||
compilerInfo: function compilerInfo() { | ||
var revision = _COMPILER_REVISION$REVISION_CHANGES.COMPILER_REVISION, | ||
versions = _COMPILER_REVISION$REVISION_CHANGES.REVISION_CHANGES[revision]; | ||
var revision = _base.COMPILER_REVISION, | ||
versions = _base.REVISION_CHANGES[revision]; | ||
return [revision, versions]; | ||
@@ -49,3 +49,3 @@ }, | ||
// Force a source as this simplifies the merge logic. | ||
if (!_isArray.isArray(source)) { | ||
if (!_utils.isArray(source)) { | ||
source = [source]; | ||
@@ -123,3 +123,3 @@ } | ||
if (this.stackSlot || this.inlineStack.length || this.compileStack.length) { | ||
throw new _Exception2['default']('Compile completed with content left on stack'); | ||
throw new _exception2['default']('Compile completed with content left on stack'); | ||
} | ||
@@ -182,3 +182,3 @@ | ||
this.lastContext = 0; | ||
this.source = new _CodeGen2['default'](this.options.srcName); | ||
this.source = new _codeGen2['default'](this.options.srcName); | ||
}, | ||
@@ -365,3 +365,3 @@ | ||
if (this.environment.isSimple) { | ||
this.pushSource(['else { ', this.appendToBuffer('\'\'', undefined, true), ' }']); | ||
this.pushSource(['else { ', this.appendToBuffer("''", undefined, true), ' }']); | ||
} | ||
@@ -826,3 +826,3 @@ } | ||
if (!this.isInline()) { | ||
throw new _Exception2['default']('replaceStack on non-inline'); | ||
throw new _exception2['default']('replaceStack on non-inline'); | ||
} | ||
@@ -897,3 +897,3 @@ | ||
if (!this.stackSlot) { | ||
throw new _Exception2['default']('Invalid stack pop'); | ||
throw new _exception2['default']('Invalid stack pop'); | ||
} | ||
@@ -1070,2 +1070,2 @@ this.stackSlot--; | ||
exports['default'] = JavaScriptCompiler; | ||
module.exports = exports['default']; | ||
module.exports = exports['default']; |
@@ -0,13 +1,14 @@ | ||
/* istanbul ignore next */ | ||
/* Jison generated parser */ | ||
"use strict"; | ||
exports.__esModule = true; | ||
/* istanbul ignore next */ | ||
/* Jison generated parser */ | ||
var handlebars = (function () { | ||
var parser = { trace: function trace() {}, | ||
yy: {}, | ||
symbols_: { error: 2, root: 3, program: 4, EOF: 5, program_repetition0: 6, statement: 7, mustache: 8, block: 9, rawBlock: 10, partial: 11, content: 12, COMMENT: 13, CONTENT: 14, openRawBlock: 15, END_RAW_BLOCK: 16, OPEN_RAW_BLOCK: 17, helperName: 18, openRawBlock_repetition0: 19, openRawBlock_option0: 20, CLOSE_RAW_BLOCK: 21, openBlock: 22, block_option0: 23, closeBlock: 24, openInverse: 25, block_option1: 26, OPEN_BLOCK: 27, openBlock_repetition0: 28, openBlock_option0: 29, openBlock_option1: 30, CLOSE: 31, OPEN_INVERSE: 32, openInverse_repetition0: 33, openInverse_option0: 34, openInverse_option1: 35, openInverseChain: 36, OPEN_INVERSE_CHAIN: 37, openInverseChain_repetition0: 38, openInverseChain_option0: 39, openInverseChain_option1: 40, inverseAndProgram: 41, INVERSE: 42, inverseChain: 43, inverseChain_option0: 44, OPEN_ENDBLOCK: 45, OPEN: 46, mustache_repetition0: 47, mustache_option0: 48, OPEN_UNESCAPED: 49, mustache_repetition1: 50, mustache_option1: 51, CLOSE_UNESCAPED: 52, OPEN_PARTIAL: 53, partialName: 54, partial_repetition0: 55, partial_option0: 56, param: 57, sexpr: 58, OPEN_SEXPR: 59, sexpr_repetition0: 60, sexpr_option0: 61, CLOSE_SEXPR: 62, hash: 63, hash_repetition_plus0: 64, hashSegment: 65, ID: 66, EQUALS: 67, blockParams: 68, OPEN_BLOCK_PARAMS: 69, blockParams_repetition_plus0: 70, CLOSE_BLOCK_PARAMS: 71, path: 72, dataName: 73, STRING: 74, NUMBER: 75, BOOLEAN: 76, UNDEFINED: 77, NULL: 78, DATA: 79, pathSegments: 80, SEP: 81, $accept: 0, $end: 1 }, | ||
symbols_: { "error": 2, "root": 3, "program": 4, "EOF": 5, "program_repetition0": 6, "statement": 7, "mustache": 8, "block": 9, "rawBlock": 10, "partial": 11, "content": 12, "COMMENT": 13, "CONTENT": 14, "openRawBlock": 15, "END_RAW_BLOCK": 16, "OPEN_RAW_BLOCK": 17, "helperName": 18, "openRawBlock_repetition0": 19, "openRawBlock_option0": 20, "CLOSE_RAW_BLOCK": 21, "openBlock": 22, "block_option0": 23, "closeBlock": 24, "openInverse": 25, "block_option1": 26, "OPEN_BLOCK": 27, "openBlock_repetition0": 28, "openBlock_option0": 29, "openBlock_option1": 30, "CLOSE": 31, "OPEN_INVERSE": 32, "openInverse_repetition0": 33, "openInverse_option0": 34, "openInverse_option1": 35, "openInverseChain": 36, "OPEN_INVERSE_CHAIN": 37, "openInverseChain_repetition0": 38, "openInverseChain_option0": 39, "openInverseChain_option1": 40, "inverseAndProgram": 41, "INVERSE": 42, "inverseChain": 43, "inverseChain_option0": 44, "OPEN_ENDBLOCK": 45, "OPEN": 46, "mustache_repetition0": 47, "mustache_option0": 48, "OPEN_UNESCAPED": 49, "mustache_repetition1": 50, "mustache_option1": 51, "CLOSE_UNESCAPED": 52, "OPEN_PARTIAL": 53, "partialName": 54, "partial_repetition0": 55, "partial_option0": 56, "param": 57, "sexpr": 58, "OPEN_SEXPR": 59, "sexpr_repetition0": 60, "sexpr_option0": 61, "CLOSE_SEXPR": 62, "hash": 63, "hash_repetition_plus0": 64, "hashSegment": 65, "ID": 66, "EQUALS": 67, "blockParams": 68, "OPEN_BLOCK_PARAMS": 69, "blockParams_repetition_plus0": 70, "CLOSE_BLOCK_PARAMS": 71, "path": 72, "dataName": 73, "STRING": 74, "NUMBER": 75, "BOOLEAN": 76, "UNDEFINED": 77, "NULL": 78, "DATA": 79, "pathSegments": 80, "SEP": 81, "$accept": 0, "$end": 1 }, | ||
terminals_: { 2: "error", 5: "EOF", 13: "COMMENT", 14: "CONTENT", 16: "END_RAW_BLOCK", 17: "OPEN_RAW_BLOCK", 21: "CLOSE_RAW_BLOCK", 27: "OPEN_BLOCK", 31: "CLOSE", 32: "OPEN_INVERSE", 37: "OPEN_INVERSE_CHAIN", 42: "INVERSE", 45: "OPEN_ENDBLOCK", 46: "OPEN", 49: "OPEN_UNESCAPED", 52: "CLOSE_UNESCAPED", 53: "OPEN_PARTIAL", 59: "OPEN_SEXPR", 62: "CLOSE_SEXPR", 66: "ID", 67: "EQUALS", 69: "OPEN_BLOCK_PARAMS", 71: "CLOSE_BLOCK_PARAMS", 74: "STRING", 75: "NUMBER", 76: "BOOLEAN", 77: "UNDEFINED", 78: "NULL", 79: "DATA", 81: "SEP" }, | ||
productions_: [0, [3, 2], [4, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [12, 1], [10, 3], [15, 5], [9, 4], [9, 4], [22, 6], [25, 6], [36, 6], [41, 2], [43, 3], [43, 1], [24, 3], [8, 5], [8, 5], [11, 5], [57, 1], [57, 1], [58, 5], [63, 1], [65, 3], [68, 3], [18, 1], [18, 1], [18, 1], [18, 1], [18, 1], [18, 1], [18, 1], [54, 1], [54, 1], [73, 2], [72, 1], [80, 3], [80, 1], [6, 0], [6, 2], [19, 0], [19, 2], [20, 0], [20, 1], [23, 0], [23, 1], [26, 0], [26, 1], [28, 0], [28, 2], [29, 0], [29, 1], [30, 0], [30, 1], [33, 0], [33, 2], [34, 0], [34, 1], [35, 0], [35, 1], [38, 0], [38, 2], [39, 0], [39, 1], [40, 0], [40, 1], [44, 0], [44, 1], [47, 0], [47, 2], [48, 0], [48, 1], [50, 0], [50, 2], [51, 0], [51, 1], [55, 0], [55, 2], [56, 0], [56, 1], [60, 0], [60, 2], [61, 0], [61, 1], [64, 1], [64, 2], [70, 1], [70, 2]], | ||
performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { | ||
performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$ | ||
/*``*/) { | ||
@@ -354,4 +355,4 @@ var $0 = $$.length - 1; | ||
this.yylineno = this.yyleng = 0; | ||
this.yytext = this.matched = this.match = ""; | ||
this.conditionStack = ["INITIAL"]; | ||
this.yytext = this.matched = this.match = ''; | ||
this.conditionStack = ['INITIAL']; | ||
this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }; | ||
@@ -416,3 +417,3 @@ if (this.options.ranges) this.yylloc.range = [0, 0]; | ||
var past = this.matched.substr(0, this.matched.length - this.match.length); | ||
return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); | ||
return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, ""); | ||
}, | ||
@@ -424,3 +425,3 @@ upcomingInput: function upcomingInput() { | ||
} | ||
return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, ""); | ||
return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); | ||
}, | ||
@@ -440,4 +441,4 @@ showPosition: function showPosition() { | ||
if (!this._more) { | ||
this.yytext = ""; | ||
this.match = ""; | ||
this.yytext = ''; | ||
this.match = ''; | ||
} | ||
@@ -472,7 +473,3 @@ var rules = this._currentRules(); | ||
if (this.done && this._input) this.done = false; | ||
if (token) { | ||
return token; | ||
} else { | ||
return; | ||
} | ||
if (token) return token;else return; | ||
} | ||
@@ -482,3 +479,3 @@ if (this._input === "") { | ||
} else { | ||
return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { text: "", token: null, line: this.yylineno }); | ||
return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { text: "", token: null, line: this.yylineno }); | ||
} | ||
@@ -488,3 +485,3 @@ }, | ||
var r = this.next(); | ||
if (typeof r !== "undefined") { | ||
if (typeof r !== 'undefined') { | ||
return r; | ||
@@ -511,3 +508,4 @@ } else { | ||
lexer.options = {}; | ||
lexer.performAction = function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { | ||
lexer.performAction = function anonymous(yy, yy_, $avoiding_name_collisions, YY_START | ||
/*``*/) { | ||
@@ -530,5 +528,5 @@ function strip(start, end) { | ||
} | ||
if (yy_.yytext) { | ||
return 14; | ||
}break; | ||
if (yy_.yytext) return 14; | ||
break; | ||
case 1: | ||
@@ -567,3 +565,3 @@ return 14; | ||
this.popState(); | ||
this.begin("raw"); | ||
this.begin('raw'); | ||
return 21; | ||
@@ -602,3 +600,3 @@ | ||
this.popState(); | ||
this.begin("com"); | ||
this.begin('com'); | ||
@@ -636,3 +634,3 @@ break; | ||
case 29: | ||
yy_.yytext = strip(1, 2).replace(/\\"/g, "\"");return 74; | ||
yy_.yytext = strip(1, 2).replace(/\\"/g, '"');return 74; | ||
break; | ||
@@ -673,3 +671,3 @@ case 30: | ||
case 41: | ||
return "INVALID"; | ||
return 'INVALID'; | ||
break; | ||
@@ -682,3 +680,3 @@ case 42: | ||
lexer.rules = [/^(?:[^\x00]*?(?=(\{\{)))/, /^(?:[^\x00]+)/, /^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/, /^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/, /^(?:[^\x00]*?(?=(\{\{\{\{\/)))/, /^(?:[\s\S]*?--(~)?\}\})/, /^(?:\()/, /^(?:\))/, /^(?:\{\{\{\{)/, /^(?:\}\}\}\})/, /^(?:\{\{(~)?>)/, /^(?:\{\{(~)?#)/, /^(?:\{\{(~)?\/)/, /^(?:\{\{(~)?\^\s*(~)?\}\})/, /^(?:\{\{(~)?\s*else\s*(~)?\}\})/, /^(?:\{\{(~)?\^)/, /^(?:\{\{(~)?\s*else\b)/, /^(?:\{\{(~)?\{)/, /^(?:\{\{(~)?&)/, /^(?:\{\{(~)?!--)/, /^(?:\{\{(~)?![\s\S]*?\}\})/, /^(?:\{\{(~)?)/, /^(?:=)/, /^(?:\.\.)/, /^(?:\.(?=([=~}\s\/.)|])))/, /^(?:[\/.])/, /^(?:\s+)/, /^(?:\}(~)?\}\})/, /^(?:(~)?\}\})/, /^(?:"(\\["]|[^"])*")/, /^(?:'(\\[']|[^'])*')/, /^(?:@)/, /^(?:true(?=([~}\s)])))/, /^(?:false(?=([~}\s)])))/, /^(?:undefined(?=([~}\s)])))/, /^(?:null(?=([~}\s)])))/, /^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/, /^(?:as\s+\|)/, /^(?:\|)/, /^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/, /^(?:\[[^\]]*\])/, /^(?:.)/, /^(?:$)/]; | ||
lexer.conditions = { mu: { rules: [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, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42], inclusive: false }, emu: { rules: [2], inclusive: false }, com: { rules: [5], inclusive: false }, raw: { rules: [3, 4], inclusive: false }, INITIAL: { rules: [0, 1, 42], inclusive: true } }; | ||
lexer.conditions = { "mu": { "rules": [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, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42], "inclusive": false }, "emu": { "rules": [2], "inclusive": false }, "com": { "rules": [5], "inclusive": false }, "raw": { "rules": [3, 4], "inclusive": false }, "INITIAL": { "rules": [0, 1, 42], "inclusive": true } }; | ||
return lexer; | ||
@@ -692,2 +690,2 @@ })(); | ||
})();exports["default"] = handlebars; | ||
module.exports = exports["default"]; | ||
module.exports = exports["default"]; |
@@ -0,14 +1,14 @@ | ||
/*eslint-disable new-cap */ | ||
'use strict'; | ||
var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; | ||
exports.__esModule = true; | ||
exports.print = print; | ||
exports.PrintVisitor = PrintVisitor; | ||
/*eslint-disable new-cap */ | ||
var _Visitor = require('./visitor'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var _Visitor2 = _interopRequireWildcard(_Visitor); | ||
var _visitor = require('./visitor'); | ||
var _visitor2 = _interopRequireDefault(_visitor); | ||
function print(ast) { | ||
@@ -22,3 +22,3 @@ return new PrintVisitor().accept(ast); | ||
PrintVisitor.prototype = new _Visitor2['default'](); | ||
PrintVisitor.prototype = new _visitor2['default'](); | ||
@@ -105,7 +105,7 @@ PrintVisitor.prototype.pad = function (string) { | ||
PrintVisitor.prototype.ContentStatement = function (content) { | ||
return this.pad('CONTENT[ \'' + content.value + '\' ]'); | ||
return this.pad("CONTENT[ '" + content.value + "' ]"); | ||
}; | ||
PrintVisitor.prototype.CommentStatement = function (comment) { | ||
return this.pad('{{! \'' + comment.value + '\' }}'); | ||
return this.pad("{{! '" + comment.value + "' }}"); | ||
}; | ||
@@ -167,2 +167,2 @@ | ||
}; | ||
/*eslint-enable new-cap */ | ||
/*eslint-enable new-cap */ |
'use strict'; | ||
var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; | ||
exports.__esModule = true; | ||
var _Exception = require('../exception'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var _Exception2 = _interopRequireWildcard(_Exception); | ||
var _exception = require('../exception'); | ||
var _AST = require('./ast'); | ||
var _exception2 = _interopRequireDefault(_exception); | ||
var _AST2 = _interopRequireWildcard(_AST); | ||
var _ast = require('./ast'); | ||
var _ast2 = _interopRequireDefault(_ast); | ||
function Visitor() { | ||
@@ -28,4 +28,4 @@ this.parents = []; | ||
// Hacky sanity check: | ||
if (value && (!value.type || !_AST2['default'][value.type])) { | ||
throw new _Exception2['default']('Unexpected node type "' + value.type + '" found when accepting ' + name + ' on ' + node.type); | ||
if (value && (!value.type || !_ast2['default'][value.type])) { | ||
throw new _exception2['default']('Unexpected node type "' + value.type + '" found when accepting ' + name + ' on ' + node.type); | ||
} | ||
@@ -42,3 +42,3 @@ node[name] = value; | ||
if (!node[name]) { | ||
throw new _Exception2['default'](node.type + ' requires ' + name); | ||
throw new _exception2['default'](node.type + ' requires ' + name); | ||
} | ||
@@ -107,4 +107,4 @@ }, | ||
ContentStatement: function ContentStatement() {}, | ||
CommentStatement: function CommentStatement() {}, | ||
ContentStatement: function ContentStatement() /* content */{}, | ||
CommentStatement: function CommentStatement() /* comment */{}, | ||
@@ -117,9 +117,9 @@ SubExpression: function SubExpression(sexpr) { | ||
PathExpression: function PathExpression() {}, | ||
PathExpression: function PathExpression() /* path */{}, | ||
StringLiteral: function StringLiteral() {}, | ||
NumberLiteral: function NumberLiteral() {}, | ||
BooleanLiteral: function BooleanLiteral() {}, | ||
UndefinedLiteral: function UndefinedLiteral() {}, | ||
NullLiteral: function NullLiteral() {}, | ||
StringLiteral: function StringLiteral() /* string */{}, | ||
NumberLiteral: function NumberLiteral() /* number */{}, | ||
BooleanLiteral: function BooleanLiteral() /* bool */{}, | ||
UndefinedLiteral: function UndefinedLiteral() /* literal */{}, | ||
NullLiteral: function NullLiteral() /* literal */{}, | ||
@@ -136,2 +136,1 @@ Hash: function Hash(hash) { | ||
module.exports = exports['default']; | ||
/* content */ /* comment */ /* path */ /* string */ /* number */ /* bool */ /* literal */ /* literal */ |
'use strict'; | ||
var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; | ||
exports.__esModule = true; | ||
var _Visitor = require('./visitor'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var _Visitor2 = _interopRequireWildcard(_Visitor); | ||
var _visitor = require('./visitor'); | ||
var _visitor2 = _interopRequireDefault(_visitor); | ||
function WhitespaceControl() {} | ||
WhitespaceControl.prototype = new _Visitor2['default'](); | ||
WhitespaceControl.prototype = new _visitor2['default'](); | ||
@@ -212,2 +212,2 @@ WhitespaceControl.prototype.Program = function (program) { | ||
exports['default'] = WhitespaceControl; | ||
module.exports = exports['default']; | ||
module.exports = exports['default']; |
@@ -38,2 +38,2 @@ 'use strict'; | ||
exports['default'] = Exception; | ||
module.exports = exports['default']; | ||
module.exports = exports['default']; |
@@ -0,5 +1,5 @@ | ||
/*global window */ | ||
'use strict'; | ||
exports.__esModule = true; | ||
/*global window */ | ||
@@ -18,2 +18,2 @@ exports['default'] = function (Handlebars) { | ||
module.exports = exports['default']; | ||
module.exports = exports['default']; |
'use strict'; | ||
var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; | ||
exports.__esModule = true; | ||
exports.checkRevision = checkRevision; | ||
// TODO: Remove this line and break up compilePartial | ||
exports.template = template; | ||
@@ -16,24 +11,28 @@ exports.wrapProgram = wrapProgram; | ||
var _import = require('./utils'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var Utils = _interopRequireWildcard(_import); | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } | ||
var _Exception = require('./exception'); | ||
var _utils = require('./utils'); | ||
var _Exception2 = _interopRequireWildcard(_Exception); | ||
var Utils = _interopRequireWildcard(_utils); | ||
var _COMPILER_REVISION$REVISION_CHANGES$createFrame = require('./base'); | ||
var _exception = require('./exception'); | ||
var _exception2 = _interopRequireDefault(_exception); | ||
var _base = require('./base'); | ||
function checkRevision(compilerInfo) { | ||
var compilerRevision = compilerInfo && compilerInfo[0] || 1, | ||
currentRevision = _COMPILER_REVISION$REVISION_CHANGES$createFrame.COMPILER_REVISION; | ||
currentRevision = _base.COMPILER_REVISION; | ||
if (compilerRevision !== currentRevision) { | ||
if (compilerRevision < currentRevision) { | ||
var runtimeVersions = _COMPILER_REVISION$REVISION_CHANGES$createFrame.REVISION_CHANGES[currentRevision], | ||
compilerVersions = _COMPILER_REVISION$REVISION_CHANGES$createFrame.REVISION_CHANGES[compilerRevision]; | ||
throw new _Exception2['default']('Template was precompiled with an older version of Handlebars than the current runtime. ' + 'Please update your precompiler to a newer version (' + runtimeVersions + ') or downgrade your runtime to an older version (' + compilerVersions + ').'); | ||
var runtimeVersions = _base.REVISION_CHANGES[currentRevision], | ||
compilerVersions = _base.REVISION_CHANGES[compilerRevision]; | ||
throw new _exception2['default']('Template was precompiled with an older version of Handlebars than the current runtime. ' + 'Please update your precompiler to a newer version (' + runtimeVersions + ') or downgrade your runtime to an older version (' + compilerVersions + ').'); | ||
} else { | ||
// Use the embedded version info since the runtime doesn't know about this revision yet | ||
throw new _Exception2['default']('Template was precompiled with a newer version of Handlebars than the current runtime. ' + 'Please update your runtime to a newer version (' + compilerInfo[1] + ').'); | ||
throw new _exception2['default']('Template was precompiled with a newer version of Handlebars than the current runtime. ' + 'Please update your runtime to a newer version (' + compilerInfo[1] + ').'); | ||
} | ||
@@ -46,6 +45,6 @@ } | ||
if (!env) { | ||
throw new _Exception2['default']('No environment passed to template'); | ||
throw new _exception2['default']('No environment passed to template'); | ||
} | ||
if (!templateSpec || !templateSpec.main) { | ||
throw new _Exception2['default']('Unknown template object: ' + typeof templateSpec); | ||
throw new _exception2['default']('Unknown template object: ' + typeof templateSpec); | ||
} | ||
@@ -83,3 +82,3 @@ | ||
} else { | ||
throw new _Exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode'); | ||
throw new _exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode'); | ||
} | ||
@@ -92,3 +91,3 @@ } | ||
if (!(name in obj)) { | ||
throw new _Exception2['default']('"' + name + '" not defined in ' + obj); | ||
throw new _exception2['default']('"' + name + '" not defined in ' + obj); | ||
} | ||
@@ -149,3 +148,3 @@ return obj[name]; | ||
function ret(context) { | ||
var options = arguments[1] === undefined ? {} : arguments[1]; | ||
var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; | ||
@@ -183,6 +182,6 @@ var data = options.data; | ||
if (templateSpec.useBlockParams && !blockParams) { | ||
throw new _Exception2['default']('must pass block params'); | ||
throw new _exception2['default']('must pass block params'); | ||
} | ||
if (templateSpec.useDepths && !depths) { | ||
throw new _Exception2['default']('must pass parent depths'); | ||
throw new _exception2['default']('must pass parent depths'); | ||
} | ||
@@ -197,3 +196,3 @@ | ||
function prog(context) { | ||
var options = arguments[1] === undefined ? {} : arguments[1]; | ||
var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; | ||
@@ -223,3 +222,3 @@ return fn.call(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), depths && [context].concat(depths)); | ||
if (partial === undefined) { | ||
throw new _Exception2['default']('The partial ' + options.name + ' could not be found'); | ||
throw new _exception2['default']('The partial ' + options.name + ' could not be found'); | ||
} else if (partial instanceof Function) { | ||
@@ -236,6 +235,6 @@ return partial(context, options); | ||
if (!data || !('root' in data)) { | ||
data = data ? _COMPILER_REVISION$REVISION_CHANGES$createFrame.createFrame(data) : {}; | ||
data = data ? _base.createFrame(data) : {}; | ||
data.root = context; | ||
} | ||
return data; | ||
} | ||
} |
@@ -0,5 +1,5 @@ | ||
// Build out our basic SafeString type | ||
'use strict'; | ||
exports.__esModule = true; | ||
// Build out our basic SafeString type | ||
function SafeString(string) { | ||
@@ -14,2 +14,2 @@ this.string = string; | ||
exports['default'] = SafeString; | ||
module.exports = exports['default']; | ||
module.exports = exports['default']; |
@@ -5,4 +5,2 @@ 'use strict'; | ||
exports.extend = extend; | ||
// Older IE versions do not directly support indexOf so we must implement our own, sadly. | ||
exports.indexOf = indexOf; | ||
@@ -18,8 +16,9 @@ exports.escapeExpression = escapeExpression; | ||
'"': '"', | ||
'\'': ''', | ||
'`': '`' | ||
"'": ''', | ||
'`': '`', | ||
'=': '=' | ||
}; | ||
var badChars = /[&<>"'`]/g, | ||
possible = /[&<>"'`]/; | ||
var badChars = /[&<>"'`=]/g, | ||
possible = /[&<>"'`=]/; | ||
@@ -65,4 +64,7 @@ function escapeChar(chr) { | ||
return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false; | ||
};exports.isArray = isArray; | ||
}; | ||
exports.isArray = isArray; | ||
// Older IE versions do not directly support indexOf so we must implement our own, sadly. | ||
function indexOf(array, value) { | ||
@@ -117,2 +119,2 @@ for (var i = 0, len = array.length; i < len; i++) { | ||
return (contextPath ? contextPath + '.' : '') + id; | ||
} | ||
} |
@@ -0,22 +1,23 @@ | ||
/*eslint-disable no-console */ | ||
'use strict'; | ||
var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } | ||
/*eslint-disable no-console */ | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var _fs = require('fs'); | ||
var _fs2 = _interopRequireWildcard(_fs); | ||
var _fs2 = _interopRequireDefault(_fs); | ||
var _import = require('./handlebars'); | ||
var _handlebars = require('./handlebars'); | ||
var Handlebars = _interopRequireWildcard(_import); | ||
var Handlebars = _interopRequireWildcard(_handlebars); | ||
var _basename = require('path'); | ||
var _path = require('path'); | ||
var _SourceMapConsumer$SourceNode = require('source-map'); | ||
var _sourceMap = require('source-map'); | ||
var _uglify = require('uglify-js'); | ||
var _uglifyJs = require('uglify-js'); | ||
var _uglify2 = _interopRequireWildcard(_uglify); | ||
var _uglifyJs2 = _interopRequireDefault(_uglifyJs); | ||
@@ -65,3 +66,3 @@ module.exports.cli = function (opts) { | ||
var output = new _SourceMapConsumer$SourceNode.SourceNode(); | ||
var output = new _sourceMap.SourceNode(); | ||
if (!opts.simple) { | ||
@@ -116,3 +117,3 @@ if (opts.amd) { | ||
if (!root) { | ||
template = _basename.basename(template); | ||
template = _path.basename(template); | ||
} else if (template.indexOf(root) === 0) { | ||
@@ -127,4 +128,4 @@ template = template.substring(root.length + 1); | ||
if (opts.map) { | ||
var consumer = new _SourceMapConsumer$SourceNode.SourceMapConsumer(precompiled.map); | ||
precompiled = _SourceMapConsumer$SourceNode.SourceNode.fromStringWithSourceMap(precompiled.code, consumer); | ||
var consumer = new _sourceMap.SourceMapConsumer(precompiled.map); | ||
precompiled = _sourceMap.SourceNode.fromStringWithSourceMap(precompiled.code, consumer); | ||
} | ||
@@ -135,3 +136,3 @@ | ||
} else if (opts.partial) { | ||
if (opts.amd && (opts.templates.length == 1 && !_fs2['default'].statSync(opts.templates[0]).isDirectory())) { | ||
if (opts.amd && opts.templates.length == 1 && !_fs2['default'].statSync(opts.templates[0]).isDirectory()) { | ||
output.add('return '); | ||
@@ -141,3 +142,3 @@ } | ||
} else { | ||
if (opts.amd && (opts.templates.length == 1 && !_fs2['default'].statSync(opts.templates[0]).isDirectory())) { | ||
if (opts.amd && opts.templates.length == 1 && !_fs2['default'].statSync(opts.templates[0]).isDirectory()) { | ||
output.add('return '); | ||
@@ -178,3 +179,3 @@ } | ||
if (opts.min) { | ||
output = _uglify2['default'].minify(output.code, { | ||
output = _uglifyJs2['default'].minify(output.code, { | ||
fromString: true, | ||
@@ -200,2 +201,2 @@ | ||
} | ||
}; | ||
}; |
/*! | ||
handlebars v3.0.3 | ||
handlebars v3.0.4 | ||
@@ -28,8 +28,6 @@ Copyright (C) 2011-2014 by Yehuda Katz | ||
define('handlebars/utils',['exports'], function (exports) { | ||
'use strict'; | ||
exports.__esModule = true; | ||
exports.extend = extend; | ||
// Older IE versions do not directly support indexOf so we must implement our own, sadly. | ||
exports.indexOf = indexOf; | ||
@@ -45,8 +43,9 @@ exports.escapeExpression = escapeExpression; | ||
'"': '"', | ||
'\'': ''', | ||
'`': '`' | ||
"'": ''', | ||
'`': '`', | ||
'=': '=' | ||
}; | ||
var badChars = /[&<>"'`]/g, | ||
possible = /[&<>"'`]/; | ||
var badChars = /[&<>"'`=]/g, | ||
possible = /[&<>"'`=]/; | ||
@@ -92,4 +91,7 @@ function escapeChar(chr) { | ||
return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false; | ||
};exports.isArray = isArray; | ||
}; | ||
exports.isArray = isArray; | ||
// Older IE versions do not directly support indexOf so we must implement our own, sadly. | ||
function indexOf(array, value) { | ||
@@ -146,4 +148,5 @@ for (var i = 0, len = array.length; i < len; i++) { | ||
}); | ||
define('handlebars/exception',['exports', 'module'], function (exports, module) { | ||
'use strict'; | ||
@@ -184,7 +187,6 @@ var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack']; | ||
}); | ||
define('handlebars/base',['exports', './utils', './exception'], function (exports, _utils, _exception) { | ||
'use strict'; | ||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; | ||
exports.__esModule = true; | ||
@@ -194,4 +196,6 @@ exports.HandlebarsEnvironment = HandlebarsEnvironment; | ||
var _Exception = _interopRequire(_exception); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var _Exception = _interopRequireDefault(_exception); | ||
var VERSION = '3.0.1'; | ||
@@ -233,3 +237,3 @@ exports.VERSION = VERSION; | ||
if (fn) { | ||
throw new _Exception('Arg not supported with multiple helpers'); | ||
throw new _Exception['default']('Arg not supported with multiple helpers'); | ||
} | ||
@@ -250,3 +254,3 @@ _utils.extend(this.helpers, name); | ||
if (typeof partial === 'undefined') { | ||
throw new _Exception('Attempting to register a partial as undefined'); | ||
throw new _Exception['default']('Attempting to register a partial as undefined'); | ||
} | ||
@@ -262,3 +266,3 @@ this.partials[name] = partial; | ||
function registerDefaultHelpers(instance) { | ||
instance.registerHelper('helperMissing', function () { | ||
instance.registerHelper('helperMissing', function () /* [args, ]options */{ | ||
if (arguments.length === 1) { | ||
@@ -269,3 +273,3 @@ // A missing field in a {{foo}} constuct. | ||
// Someone is actually trying to call something, blow up. | ||
throw new _Exception('Missing helper: "' + arguments[arguments.length - 1].name + '"'); | ||
throw new _Exception['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"'); | ||
} | ||
@@ -305,3 +309,3 @@ }); | ||
if (!options) { | ||
throw new _Exception('Must pass iterator to #each'); | ||
throw new _Exception['default']('Must pass iterator to #each'); | ||
} | ||
@@ -458,6 +462,6 @@ | ||
}); | ||
/* [args, ]options */; | ||
define('handlebars/safe-string',['exports', 'module'], function (exports, module) { | ||
// Build out our basic SafeString type | ||
'use strict'; | ||
@@ -474,12 +478,8 @@ function SafeString(string) { | ||
}); | ||
define('handlebars/runtime',['exports', './utils', './exception', './base'], function (exports, _utils, _exception, _base) { | ||
'use strict'; | ||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; | ||
exports.__esModule = true; | ||
exports.checkRevision = checkRevision; | ||
// TODO: Remove this line and break up compilePartial | ||
exports.template = template; | ||
@@ -491,4 +491,6 @@ exports.wrapProgram = wrapProgram; | ||
var _Exception = _interopRequire(_exception); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var _Exception = _interopRequireDefault(_exception); | ||
function checkRevision(compilerInfo) { | ||
@@ -502,6 +504,6 @@ var compilerRevision = compilerInfo && compilerInfo[0] || 1, | ||
compilerVersions = _base.REVISION_CHANGES[compilerRevision]; | ||
throw new _Exception('Template was precompiled with an older version of Handlebars than the current runtime. ' + 'Please update your precompiler to a newer version (' + runtimeVersions + ') or downgrade your runtime to an older version (' + compilerVersions + ').'); | ||
throw new _Exception['default']('Template was precompiled with an older version of Handlebars than the current runtime. ' + 'Please update your precompiler to a newer version (' + runtimeVersions + ') or downgrade your runtime to an older version (' + compilerVersions + ').'); | ||
} else { | ||
// Use the embedded version info since the runtime doesn't know about this revision yet | ||
throw new _Exception('Template was precompiled with a newer version of Handlebars than the current runtime. ' + 'Please update your runtime to a newer version (' + compilerInfo[1] + ').'); | ||
throw new _Exception['default']('Template was precompiled with a newer version of Handlebars than the current runtime. ' + 'Please update your runtime to a newer version (' + compilerInfo[1] + ').'); | ||
} | ||
@@ -514,6 +516,6 @@ } | ||
if (!env) { | ||
throw new _Exception('No environment passed to template'); | ||
throw new _Exception['default']('No environment passed to template'); | ||
} | ||
if (!templateSpec || !templateSpec.main) { | ||
throw new _Exception('Unknown template object: ' + typeof templateSpec); | ||
throw new _Exception['default']('Unknown template object: ' + typeof templateSpec); | ||
} | ||
@@ -551,3 +553,3 @@ | ||
} else { | ||
throw new _Exception('The partial ' + options.name + ' could not be compiled when running in runtime-only mode'); | ||
throw new _Exception['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode'); | ||
} | ||
@@ -560,3 +562,3 @@ } | ||
if (!(name in obj)) { | ||
throw new _Exception('"' + name + '" not defined in ' + obj); | ||
throw new _Exception['default']('"' + name + '" not defined in ' + obj); | ||
} | ||
@@ -617,3 +619,3 @@ return obj[name]; | ||
function ret(context) { | ||
var options = arguments[1] === undefined ? {} : arguments[1]; | ||
var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; | ||
@@ -651,6 +653,6 @@ var data = options.data; | ||
if (templateSpec.useBlockParams && !blockParams) { | ||
throw new _Exception('must pass block params'); | ||
throw new _Exception['default']('must pass block params'); | ||
} | ||
if (templateSpec.useDepths && !depths) { | ||
throw new _Exception('must pass parent depths'); | ||
throw new _Exception['default']('must pass parent depths'); | ||
} | ||
@@ -665,3 +667,3 @@ | ||
function prog(context) { | ||
var options = arguments[1] === undefined ? {} : arguments[1]; | ||
var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; | ||
@@ -691,3 +693,3 @@ return fn.call(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), depths && [context].concat(depths)); | ||
if (partial === undefined) { | ||
throw new _Exception('The partial ' + options.name + ' could not be found'); | ||
throw new _Exception['default']('The partial ' + options.name + ' could not be found'); | ||
} else if (partial instanceof Function) { | ||
@@ -710,5 +712,6 @@ return partial(context, options); | ||
}); | ||
define('handlebars/no-conflict',['exports', 'module'], function (exports, module) { | ||
/*global window */ | ||
'use strict'; | ||
@@ -727,6 +730,7 @@ module.exports = function (Handlebars) { | ||
}); | ||
define('handlebars.runtime',['exports', 'module', './handlebars/base', './handlebars/safe-string', './handlebars/exception', './handlebars/utils', './handlebars/runtime', './handlebars/no-conflict'], function (exports, module, _handlebarsBase, _handlebarsSafeString, _handlebarsException, _handlebarsUtils, _handlebarsRuntime, _handlebarsNoConflict) { | ||
'use strict'; | ||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
@@ -736,7 +740,7 @@ // Each of these augment the Handlebars object. No need to setup here. | ||
var _SafeString = _interopRequire(_handlebarsSafeString); | ||
var _SafeString = _interopRequireDefault(_handlebarsSafeString); | ||
var _Exception = _interopRequire(_handlebarsException); | ||
var _Exception = _interopRequireDefault(_handlebarsException); | ||
var _noConflict = _interopRequire(_handlebarsNoConflict); | ||
var _noConflict = _interopRequireDefault(_handlebarsNoConflict); | ||
@@ -748,4 +752,4 @@ // For compatibility and usage outside of module systems, make the Handlebars object a namespace | ||
_handlebarsUtils.extend(hb, _handlebarsBase); | ||
hb.SafeString = _SafeString; | ||
hb.Exception = _Exception; | ||
hb.SafeString = _SafeString['default']; | ||
hb.Exception = _Exception['default']; | ||
hb.Utils = _handlebarsUtils; | ||
@@ -765,3 +769,3 @@ hb.escapeExpression = _handlebarsUtils.escapeExpression; | ||
_noConflict(inst); | ||
_noConflict['default'](inst); | ||
@@ -772,1 +776,2 @@ inst['default'] = inst; | ||
}); | ||
/*! | ||
handlebars v3.0.3 | ||
handlebars v3.0.4 | ||
@@ -27,2 +27,59 @@ Copyright (C) 2011-2014 by Yehuda Katz | ||
*/ | ||
define("handlebars/utils",["exports"],function(a){function b(a){return i[a]}function c(a){for(var b=1;b<arguments.length;b++)for(var c in arguments[b])Object.prototype.hasOwnProperty.call(arguments[b],c)&&(a[c]=arguments[b][c]);return a}function d(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1}function e(a){if("string"!=typeof a){if(a&&a.toHTML)return a.toHTML();if(null==a)return"";if(!a)return a+"";a=""+a}return k.test(a)?a.replace(j,b):a}function f(a){return a||0===a?n(a)&&0===a.length?!0:!1:!0}function g(a,b){return a.path=b,a}function h(a,b){return(a?a+".":"")+b}a.__esModule=!0,a.extend=c,a.indexOf=d,a.escapeExpression=e,a.isEmpty=f,a.blockParams=g,a.appendContextPath=h;var i={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},j=/[&<>"'`]/g,k=/[&<>"'`]/,l=Object.prototype.toString;a.toString=l;var m=function(a){return"function"==typeof a};m(/x/)&&(a.isFunction=m=function(a){return"function"==typeof a&&"[object Function]"===l.call(a)});var m;a.isFunction=m;var n=Array.isArray||function(a){return a&&"object"==typeof a?"[object Array]"===l.call(a):!1};a.isArray=n}),define("handlebars/exception",["exports","module"],function(a,b){function c(a,b){var e=b&&b.loc,f=void 0,g=void 0;e&&(f=e.start.line,g=e.start.column,a+=" - "+f+":"+g);for(var h=Error.prototype.constructor.call(this,a),i=0;i<d.length;i++)this[d[i]]=h[d[i]];Error.captureStackTrace&&Error.captureStackTrace(this,c),e&&(this.lineNumber=f,this.column=g)}var d=["description","fileName","lineNumber","message","name","number","stack"];c.prototype=new Error,b.exports=c}),define("handlebars/base",["exports","./utils","./exception"],function(a,b,c){function d(a,b){this.helpers=a||{},this.partials=b||{},e(this)}function e(a){a.registerHelper("helperMissing",function(){if(1===arguments.length)return void 0;throw new h('Missing helper: "'+arguments[arguments.length-1].name+'"')}),a.registerHelper("blockHelperMissing",function(c,d){var e=d.inverse,g=d.fn;if(c===!0)return g(this);if(c===!1||null==c)return e(this);if(l(c))return c.length>0?(d.ids&&(d.ids=[d.name]),a.helpers.each(c,d)):e(this);if(d.data&&d.ids){var h=f(d.data);h.contextPath=b.appendContextPath(d.data.contextPath,d.name),d={data:h}}return g(c,d)}),a.registerHelper("each",function(a,c){function d(c,d,f){k&&(k.key=c,k.index=d,k.first=0===d,k.last=!!f,n&&(k.contextPath=n+c)),j+=e(a[c],{data:k,blockParams:b.blockParams([a[c],c],[n+c,null])})}if(!c)throw new h("Must pass iterator to #each");var e=c.fn,g=c.inverse,i=0,j="",k=void 0,n=void 0;if(c.data&&c.ids&&(n=b.appendContextPath(c.data.contextPath,c.ids[0])+"."),m(a)&&(a=a.call(this)),c.data&&(k=f(c.data)),a&&"object"==typeof a)if(l(a))for(var o=a.length;o>i;i++)d(i,i,i===a.length-1);else{var p=void 0;for(var q in a)a.hasOwnProperty(q)&&(p&&d(p,i-1),p=q,i++);p&&d(p,i-1,!0)}return 0===i&&(j=g(this)),j}),a.registerHelper("if",function(a,c){return m(a)&&(a=a.call(this)),!c.hash.includeZero&&!a||b.isEmpty(a)?c.inverse(this):c.fn(this)}),a.registerHelper("unless",function(b,c){return a.helpers["if"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})}),a.registerHelper("with",function(a,c){m(a)&&(a=a.call(this));var d=c.fn;if(b.isEmpty(a))return c.inverse(this);if(c.data&&c.ids){var e=f(c.data);e.contextPath=b.appendContextPath(c.data.contextPath,c.ids[0]),c={data:e}}return d(a,c)}),a.registerHelper("log",function(b,c){var d=c.data&&null!=c.data.level?parseInt(c.data.level,10):1;a.log(d,b)}),a.registerHelper("lookup",function(a,b){return a&&a[b]})}function f(a){var c=b.extend({},a);return c._parent=a,c}var g=function(a){return a&&a.__esModule?a["default"]:a};a.__esModule=!0,a.HandlebarsEnvironment=d,a.createFrame=f;var h=g(c),i="3.0.1";a.VERSION=i;var j=6;a.COMPILER_REVISION=j;var k={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1"};a.REVISION_CHANGES=k;var l=b.isArray,m=b.isFunction,n=b.toString,o="[object Object]";d.prototype={constructor:d,logger:p,log:q,registerHelper:function(a,c){if(n.call(a)===o){if(c)throw new h("Arg not supported with multiple helpers");b.extend(this.helpers,a)}else this.helpers[a]=c},unregisterHelper:function(a){delete this.helpers[a]},registerPartial:function(a,c){if(n.call(a)===o)b.extend(this.partials,a);else{if("undefined"==typeof c)throw new h("Attempting to register a partial as undefined");this.partials[a]=c}},unregisterPartial:function(a){delete this.partials[a]}};var p={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:1,log:function(a,b){if("undefined"!=typeof console&&p.level<=a){var c=p.methodMap[a];(console[c]||console.log).call(console,b)}}};a.logger=p;var q=p.log;a.log=q}),define("handlebars/safe-string",["exports","module"],function(a,b){function c(a){this.string=a}c.prototype.toString=c.prototype.toHTML=function(){return""+this.string},b.exports=c}),define("handlebars/runtime",["exports","./utils","./exception","./base"],function(a,b,c,d){function e(a){var b=a&&a[0]||1,c=d.COMPILER_REVISION;if(b!==c){if(c>b){var e=d.REVISION_CHANGES[c],f=d.REVISION_CHANGES[b];throw new m("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+e+") or downgrade your runtime to an older version ("+f+").")}throw new m("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+a[1]+").")}}function f(a,c){function d(d,e,f){f.hash&&(e=b.extend({},e,f.hash)),d=c.VM.resolvePartial.call(this,d,e,f);var g=c.VM.invokePartial.call(this,d,e,f);if(null==g&&c.compile&&(f.partials[f.name]=c.compile(d,a.compilerOptions,c),g=f.partials[f.name](e,f)),null!=g){if(f.indent){for(var h=g.split("\n"),i=0,j=h.length;j>i&&(h[i]||i+1!==j);i++)h[i]=f.indent+h[i];g=h.join("\n")}return g}throw new m("The partial "+f.name+" could not be compiled when running in runtime-only mode")}function e(b){var c=void 0===arguments[1]?{}:arguments[1],d=c.data;e._setup(c),!c.partial&&a.useData&&(d=k(b,d));var g=void 0,h=a.useBlockParams?[]:void 0;return a.useDepths&&(g=c.depths?[b].concat(c.depths):[b]),a.main.call(f,b,f.helpers,f.partials,d,h,g)}if(!c)throw new m("No environment passed to template");if(!a||!a.main)throw new m("Unknown template object: "+typeof a);c.VM.checkRevision(a.compiler);var f={strict:function(a,b){if(!(b in a))throw new m('"'+b+'" not defined in '+a);return a[b]},lookup:function(a,b){for(var c=a.length,d=0;c>d;d++)if(a[d]&&null!=a[d][b])return a[d][b]},lambda:function(a,b){return"function"==typeof a?a.call(b):a},escapeExpression:b.escapeExpression,invokePartial:d,fn:function(b){return a[b]},programs:[],program:function(a,b,c,d,e){var f=this.programs[a],h=this.fn(a);return b||e||d||c?f=g(this,a,h,b,c,d,e):f||(f=this.programs[a]=g(this,a,h)),f},data:function(a,b){for(;a&&b--;)a=a._parent;return a},merge:function(a,c){var d=a||c;return a&&c&&a!==c&&(d=b.extend({},c,a)),d},noop:c.VM.noop,compilerInfo:a.compiler};return e.isTop=!0,e._setup=function(b){b.partial?(f.helpers=b.helpers,f.partials=b.partials):(f.helpers=f.merge(b.helpers,c.helpers),a.usePartial&&(f.partials=f.merge(b.partials,c.partials)))},e._child=function(b,c,d,e){if(a.useBlockParams&&!d)throw new m("must pass block params");if(a.useDepths&&!e)throw new m("must pass parent depths");return g(f,b,a[b],c,0,d,e)},e}function g(a,b,c,d,e,f,g){function h(b){var e=void 0===arguments[1]?{}:arguments[1];return c.call(a,b,a.helpers,a.partials,e.data||d,f&&[e.blockParams].concat(f),g&&[b].concat(g))}return h.program=b,h.depth=g?g.length:0,h.blockParams=e||0,h}function h(a,b,c){return a?a.call||c.name||(c.name=a,a=c.partials[a]):a=c.partials[c.name],a}function i(a,b,c){if(c.partial=!0,void 0===a)throw new m("The partial "+c.name+" could not be found");return a instanceof Function?a(b,c):void 0}function j(){return""}function k(a,b){return b&&"root"in b||(b=b?d.createFrame(b):{},b.root=a),b}var l=function(a){return a&&a.__esModule?a["default"]:a};a.__esModule=!0,a.checkRevision=e,a.template=f,a.wrapProgram=g,a.resolvePartial=h,a.invokePartial=i,a.noop=j;var m=l(c)}),define("handlebars/no-conflict",["exports","module"],function(a,b){b.exports=function(a){var b="undefined"!=typeof global?global:window,c=b.Handlebars;a.noConflict=function(){b.Handlebars===a&&(b.Handlebars=c)}}}),define("handlebars.runtime",["exports","module","./handlebars/base","./handlebars/safe-string","./handlebars/exception","./handlebars/utils","./handlebars/runtime","./handlebars/no-conflict"],function(a,b,c,d,e,f,g,h){function i(){var a=new c.HandlebarsEnvironment;return f.extend(a,c),a.SafeString=k,a.Exception=l,a.Utils=f,a.escapeExpression=f.escapeExpression,a.VM=g,a.template=function(b){return g.template(b,a)},a}var j=function(a){return a&&a.__esModule?a["default"]:a},k=j(d),l=j(e),m=j(h),n=i();n.create=i,m(n),n["default"]=n,b.exports=n}); | ||
define("handlebars/utils",["exports"],function(a){"use strict";function b(a){return i[a]}function c(a){for(var b=1;b<arguments.length;b++)for(var c in arguments[b])Object.prototype.hasOwnProperty.call(arguments[b],c)&&(a[c]=arguments[b][c]);return a} | ||
// Older IE versions do not directly support indexOf so we must implement our own, sadly. | ||
function d(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1}function e(a){if("string"!=typeof a){ | ||
// don't escape SafeStrings, since they're already safe | ||
if(a&&a.toHTML)return a.toHTML();if(null==a)return"";if(!a)return a+""; | ||
// Force a string conversion as this will be done by the append regardless and | ||
// the regex test will do this transparently behind the scenes, causing issues if | ||
// an object's to string has escaped characters in it. | ||
a=""+a}return k.test(a)?a.replace(j,b):a}function f(a){return!a&&0!==a||!(!n(a)||0!==a.length)}function g(a,b){return a.path=b,a}function h(a,b){return(a?a+".":"")+b}a.__esModule=!0,a.extend=c,a.indexOf=d,a.escapeExpression=e,a.isEmpty=f,a.blockParams=g,a.appendContextPath=h;var i={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},j=/[&<>"'`=]/g,k=/[&<>"'`=]/,l=Object.prototype.toString;a.toString=l; | ||
// Sourced from lodash | ||
// https://github.com/bestiejs/lodash/blob/master/LICENSE.txt | ||
/*eslint-disable func-style, no-var */ | ||
var m=function(a){return"function"==typeof a}; | ||
// fallback for older versions of Chrome and Safari | ||
/* istanbul ignore next */ | ||
m(/x/)&&(a.isFunction=m=function(a){return"function"==typeof a&&"[object Function]"===l.call(a)});var m;a.isFunction=m;/*eslint-enable func-style, no-var */ | ||
/* istanbul ignore next */ | ||
var n=Array.isArray||function(a){return!(!a||"object"!=typeof a)&&"[object Array]"===l.call(a)};a.isArray=n}),define("handlebars/exception",["exports","module"],function(a,b){"use strict";function c(a,b){var e=b&&b.loc,f=void 0,g=void 0;e&&(f=e.start.line,g=e.start.column,a+=" - "+f+":"+g); | ||
// Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work. | ||
for(var h=Error.prototype.constructor.call(this,a),i=0;i<d.length;i++)this[d[i]]=h[d[i]];Error.captureStackTrace&&Error.captureStackTrace(this,c),e&&(this.lineNumber=f,this.column=g)}var d=["description","fileName","lineNumber","message","name","number","stack"];c.prototype=new Error,b.exports=c}),define("handlebars/base",["exports","./utils","./exception"],function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){this.helpers=a||{},this.partials=b||{},f(this)}function f(a){a.registerHelper("helperMissing",function(){if(1!==arguments.length) | ||
// Someone is actually trying to call something, blow up. | ||
throw new h["default"]('Missing helper: "'+arguments[arguments.length-1].name+'"')}),a.registerHelper("blockHelperMissing",function(c,d){var e=d.inverse,f=d.fn;if(c===!0)return f(this);if(c===!1||null==c)return e(this);if(l(c))return c.length>0?(d.ids&&(d.ids=[d.name]),a.helpers.each(c,d)):e(this);if(d.data&&d.ids){var h=g(d.data);h.contextPath=b.appendContextPath(d.data.contextPath,d.name),d={data:h}}return f(c,d)}),a.registerHelper("each",function(a,c){function d(c,d,f){k&&(k.key=c,k.index=d,k.first=0===d,k.last=!!f,n&&(k.contextPath=n+c)),j+=e(a[c],{data:k,blockParams:b.blockParams([a[c],c],[n+c,null])})}if(!c)throw new h["default"]("Must pass iterator to #each");var e=c.fn,f=c.inverse,i=0,j="",k=void 0,n=void 0;if(c.data&&c.ids&&(n=b.appendContextPath(c.data.contextPath,c.ids[0])+"."),m(a)&&(a=a.call(this)),c.data&&(k=g(c.data)),a&&"object"==typeof a)if(l(a))for(var o=a.length;i<o;i++)d(i,i,i===a.length-1);else{var p=void 0;for(var q in a)a.hasOwnProperty(q)&&( | ||
// We're running the iterations one step out of sync so we can detect | ||
// the last iteration without have to scan the object twice and create | ||
// an itermediate keys array. | ||
p&&d(p,i-1),p=q,i++);p&&d(p,i-1,!0)}return 0===i&&(j=f(this)),j}),a.registerHelper("if",function(a,c){ | ||
// Default behavior is to render the positive path if the value is truthy and not empty. | ||
// The `includeZero` option may be set to treat the condtional as purely not empty based on the | ||
// behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative. | ||
// Default behavior is to render the positive path if the value is truthy and not empty. | ||
// The `includeZero` option may be set to treat the condtional as purely not empty based on the | ||
// behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative. | ||
return m(a)&&(a=a.call(this)),!c.hash.includeZero&&!a||b.isEmpty(a)?c.inverse(this):c.fn(this)}),a.registerHelper("unless",function(b,c){return a.helpers["if"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})}),a.registerHelper("with",function(a,c){m(a)&&(a=a.call(this));var d=c.fn;if(b.isEmpty(a))return c.inverse(this);if(c.data&&c.ids){var e=g(c.data);e.contextPath=b.appendContextPath(c.data.contextPath,c.ids[0]),c={data:e}}return d(a,c)}),a.registerHelper("log",function(b,c){var d=c.data&&null!=c.data.level?parseInt(c.data.level,10):1;a.log(d,b)}),a.registerHelper("lookup",function(a,b){return a&&a[b]})}function g(a){var c=b.extend({},a);return c._parent=a,c}a.__esModule=!0,a.HandlebarsEnvironment=e,a.createFrame=g;var h=d(c),i="3.0.1";a.VERSION=i;var j=6;a.COMPILER_REVISION=j;var k={1:"<= 1.0.rc.2",// 1.0.rc.2 is actually rev2 but doesn't report it | ||
2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1"};a.REVISION_CHANGES=k;var l=b.isArray,m=b.isFunction,n=b.toString,o="[object Object]";e.prototype={constructor:e,logger:p,log:q,registerHelper:function(a,c){if(n.call(a)===o){if(c)throw new h["default"]("Arg not supported with multiple helpers");b.extend(this.helpers,a)}else this.helpers[a]=c},unregisterHelper:function(a){delete this.helpers[a]},registerPartial:function(a,c){if(n.call(a)===o)b.extend(this.partials,a);else{if("undefined"==typeof c)throw new h["default"]("Attempting to register a partial as undefined");this.partials[a]=c}},unregisterPartial:function(a){delete this.partials[a]}};var p={methodMap:{0:"debug",1:"info",2:"warn",3:"error"}, | ||
// State enum | ||
DEBUG:0,INFO:1,WARN:2,ERROR:3,level:1, | ||
// Can be overridden in the host environment | ||
log:function(a,b){if("undefined"!=typeof console&&p.level<=a){var c=p.methodMap[a];(console[c]||console.log).call(console,b)}}};a.logger=p;var q=p.log;a.log=q}),define("handlebars/safe-string",["exports","module"],function(a,b){ | ||
// Build out our basic SafeString type | ||
"use strict";function c(a){this.string=a}c.prototype.toString=c.prototype.toHTML=function(){return""+this.string},b.exports=c}),define("handlebars/runtime",["exports","./utils","./exception","./base"],function(a,b,c,d){"use strict";function e(a){return a&&a.__esModule?a:{"default":a}}function f(a){var b=a&&a[0]||1,c=d.COMPILER_REVISION;if(b!==c){if(b<c){var e=d.REVISION_CHANGES[c],f=d.REVISION_CHANGES[b];throw new m["default"]("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+e+") or downgrade your runtime to an older version ("+f+").")} | ||
// Use the embedded version info since the runtime doesn't know about this revision yet | ||
throw new m["default"]("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+a[1]+").")}}function g(a,c){function d(d,e,f){f.hash&&(e=b.extend({},e,f.hash)),d=c.VM.resolvePartial.call(this,d,e,f);var g=c.VM.invokePartial.call(this,d,e,f);if(null==g&&c.compile&&(f.partials[f.name]=c.compile(d,a.compilerOptions,c),g=f.partials[f.name](e,f)),null!=g){if(f.indent){for(var h=g.split("\n"),i=0,j=h.length;i<j&&(h[i]||i+1!==j);i++)h[i]=f.indent+h[i];g=h.join("\n")}return g}throw new m["default"]("The partial "+f.name+" could not be compiled when running in runtime-only mode")}function e(b){var c=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],d=c.data;e._setup(c),!c.partial&&a.useData&&(d=l(b,d));var g=void 0,h=a.useBlockParams?[]:void 0;return a.useDepths&&(g=c.depths?[b].concat(c.depths):[b]),a.main.call(f,b,f.helpers,f.partials,d,h,g)}/* istanbul ignore next */ | ||
if(!c)throw new m["default"]("No environment passed to template");if(!a||!a.main)throw new m["default"]("Unknown template object: "+typeof a); | ||
// Note: Using env.VM references rather than local var references throughout this section to allow | ||
// for external users to override these as psuedo-supported APIs. | ||
c.VM.checkRevision(a.compiler); | ||
// Just add water | ||
var f={strict:function(a,b){if(!(b in a))throw new m["default"]('"'+b+'" not defined in '+a);return a[b]},lookup:function(a,b){for(var c=a.length,d=0;d<c;d++)if(a[d]&&null!=a[d][b])return a[d][b]},lambda:function(a,b){return"function"==typeof a?a.call(b):a},escapeExpression:b.escapeExpression,invokePartial:d,fn:function(b){return a[b]},programs:[],program:function(a,b,c,d,e){var f=this.programs[a],g=this.fn(a);return b||e||d||c?f=h(this,a,g,b,c,d,e):f||(f=this.programs[a]=h(this,a,g)),f},data:function(a,b){for(;a&&b--;)a=a._parent;return a},merge:function(a,c){var d=a||c;return a&&c&&a!==c&&(d=b.extend({},c,a)),d},noop:c.VM.noop,compilerInfo:a.compiler};return e.isTop=!0,e._setup=function(b){b.partial?(f.helpers=b.helpers,f.partials=b.partials):(f.helpers=f.merge(b.helpers,c.helpers),a.usePartial&&(f.partials=f.merge(b.partials,c.partials)))},e._child=function(b,c,d,e){if(a.useBlockParams&&!d)throw new m["default"]("must pass block params");if(a.useDepths&&!e)throw new m["default"]("must pass parent depths");return h(f,b,a[b],c,0,d,e)},e}function h(a,b,c,d,e,f,g){function h(b){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return c.call(a,b,a.helpers,a.partials,e.data||d,f&&[e.blockParams].concat(f),g&&[b].concat(g))}return h.program=b,h.depth=g?g.length:0,h.blockParams=e||0,h}function i(a,b,c){ | ||
// This is a dynamic partial that returned a string | ||
return a?a.call||c.name||(c.name=a,a=c.partials[a]):a=c.partials[c.name],a}function j(a,b,c){if(c.partial=!0,void 0===a)throw new m["default"]("The partial "+c.name+" could not be found");if(a instanceof Function)return a(b,c)}function k(){return""}function l(a,b){return b&&"root"in b||(b=b?d.createFrame(b):{},b.root=a),b}a.__esModule=!0,a.checkRevision=f,a.template=g,a.wrapProgram=h,a.resolvePartial=i,a.invokePartial=j,a.noop=k;var m=e(c)}),define("handlebars/no-conflict",["exports","module"],function(a,b){/*global window */ | ||
"use strict";b.exports=function(a){/* istanbul ignore next */ | ||
var b="undefined"!=typeof global?global:window,c=b.Handlebars;/* istanbul ignore next */ | ||
a.noConflict=function(){b.Handlebars===a&&(b.Handlebars=c)}}}),define("handlebars.runtime",["exports","module","./handlebars/base","./handlebars/safe-string","./handlebars/exception","./handlebars/utils","./handlebars/runtime","./handlebars/no-conflict"],function(a,b,c,d,e,f,g,h){"use strict";function i(a){return a&&a.__esModule?a:{"default":a}} | ||
// For compatibility and usage outside of module systems, make the Handlebars object a namespace | ||
function j(){var a=new c.HandlebarsEnvironment;return f.extend(a,c),a.SafeString=k["default"],a.Exception=l["default"],a.Utils=f,a.escapeExpression=f.escapeExpression,a.VM=g,a.template=function(b){return g.template(b,a)},a} | ||
// Each of these augment the Handlebars object. No need to setup here. | ||
// (This is done to easily share code between commonjs and browse envs) | ||
var k=i(d),l=i(e),m=i(h),n=j();n.create=j,m["default"](n),n["default"]=n,b.exports=n}); |
/*! | ||
handlebars v3.0.3 | ||
handlebars v3.0.4 | ||
@@ -31,3 +31,3 @@ Copyright (C) 2011-2014 by Yehuda Katz | ||
else if(typeof define === 'function' && define.amd) | ||
define(factory); | ||
define([], factory); | ||
else if(typeof exports === 'object') | ||
@@ -82,13 +82,15 @@ exports["Handlebars"] = factory(); | ||
/* 0 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
/***/ (function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var _interopRequireWildcard = __webpack_require__(7)['default']; | ||
var _interopRequireWildcard = __webpack_require__(1)['default']; | ||
var _interopRequireDefault = __webpack_require__(2)['default']; | ||
exports.__esModule = true; | ||
var _import = __webpack_require__(1); | ||
var _handlebarsBase = __webpack_require__(3); | ||
var base = _interopRequireWildcard(_import); | ||
var base = _interopRequireWildcard(_handlebarsBase); | ||
@@ -98,21 +100,21 @@ // Each of these augment the Handlebars object. No need to setup here. | ||
var _SafeString = __webpack_require__(2); | ||
var _handlebarsSafeString = __webpack_require__(6); | ||
var _SafeString2 = _interopRequireWildcard(_SafeString); | ||
var _handlebarsSafeString2 = _interopRequireDefault(_handlebarsSafeString); | ||
var _Exception = __webpack_require__(3); | ||
var _handlebarsException = __webpack_require__(5); | ||
var _Exception2 = _interopRequireWildcard(_Exception); | ||
var _handlebarsException2 = _interopRequireDefault(_handlebarsException); | ||
var _import2 = __webpack_require__(4); | ||
var _handlebarsUtils = __webpack_require__(4); | ||
var Utils = _interopRequireWildcard(_import2); | ||
var Utils = _interopRequireWildcard(_handlebarsUtils); | ||
var _import3 = __webpack_require__(5); | ||
var _handlebarsRuntime = __webpack_require__(7); | ||
var runtime = _interopRequireWildcard(_import3); | ||
var runtime = _interopRequireWildcard(_handlebarsRuntime); | ||
var _noConflict = __webpack_require__(6); | ||
var _handlebarsNoConflict = __webpack_require__(8); | ||
var _noConflict2 = _interopRequireWildcard(_noConflict); | ||
var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict); | ||
@@ -124,4 +126,4 @@ // For compatibility and usage outside of module systems, make the Handlebars object a namespace | ||
Utils.extend(hb, base); | ||
hb.SafeString = _SafeString2['default']; | ||
hb.Exception = _Exception2['default']; | ||
hb.SafeString = _handlebarsSafeString2['default']; | ||
hb.Exception = _handlebarsException2['default']; | ||
hb.Utils = Utils; | ||
@@ -141,3 +143,3 @@ hb.escapeExpression = Utils.escapeExpression; | ||
_noConflict2['default'](inst); | ||
_handlebarsNoConflict2['default'](inst); | ||
@@ -149,10 +151,51 @@ inst['default'] = inst; | ||
/***/ }, | ||
/***/ }), | ||
/* 1 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
/***/ (function(module, exports) { | ||
"use strict"; | ||
exports["default"] = function (obj) { | ||
if (obj && obj.__esModule) { | ||
return obj; | ||
} else { | ||
var newObj = {}; | ||
if (obj != null) { | ||
for (var key in obj) { | ||
if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; | ||
} | ||
} | ||
newObj["default"] = obj; | ||
return newObj; | ||
} | ||
}; | ||
exports.__esModule = true; | ||
/***/ }), | ||
/* 2 */ | ||
/***/ (function(module, exports) { | ||
"use strict"; | ||
exports["default"] = function (obj) { | ||
return obj && obj.__esModule ? obj : { | ||
"default": obj | ||
}; | ||
}; | ||
exports.__esModule = true; | ||
/***/ }), | ||
/* 3 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var _interopRequireWildcard = __webpack_require__(7)['default']; | ||
var _interopRequireWildcard = __webpack_require__(1)['default']; | ||
var _interopRequireDefault = __webpack_require__(2)['default']; | ||
exports.__esModule = true; | ||
@@ -162,9 +205,9 @@ exports.HandlebarsEnvironment = HandlebarsEnvironment; | ||
var _import = __webpack_require__(4); | ||
var _utils = __webpack_require__(4); | ||
var Utils = _interopRequireWildcard(_import); | ||
var Utils = _interopRequireWildcard(_utils); | ||
var _Exception = __webpack_require__(3); | ||
var _exception = __webpack_require__(5); | ||
var _Exception2 = _interopRequireWildcard(_Exception); | ||
var _exception2 = _interopRequireDefault(_exception); | ||
@@ -207,3 +250,3 @@ var VERSION = '3.0.1'; | ||
if (fn) { | ||
throw new _Exception2['default']('Arg not supported with multiple helpers'); | ||
throw new _exception2['default']('Arg not supported with multiple helpers'); | ||
} | ||
@@ -224,3 +267,3 @@ Utils.extend(this.helpers, name); | ||
if (typeof partial === 'undefined') { | ||
throw new _Exception2['default']('Attempting to register a partial as undefined'); | ||
throw new _exception2['default']('Attempting to register a partial as undefined'); | ||
} | ||
@@ -236,3 +279,3 @@ this.partials[name] = partial; | ||
function registerDefaultHelpers(instance) { | ||
instance.registerHelper('helperMissing', function () { | ||
instance.registerHelper('helperMissing', function () /* [args, ]options */{ | ||
if (arguments.length === 1) { | ||
@@ -243,3 +286,3 @@ // A missing field in a {{foo}} constuct. | ||
// Someone is actually trying to call something, blow up. | ||
throw new _Exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"'); | ||
throw new _exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"'); | ||
} | ||
@@ -279,3 +322,3 @@ }); | ||
if (!options) { | ||
throw new _Exception2['default']('Must pass iterator to #each'); | ||
throw new _exception2['default']('Must pass iterator to #each'); | ||
} | ||
@@ -432,69 +475,5 @@ | ||
/* [args, ]options */ | ||
/***/ }, | ||
/* 2 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
exports.__esModule = true; | ||
// Build out our basic SafeString type | ||
function SafeString(string) { | ||
this.string = string; | ||
} | ||
SafeString.prototype.toString = SafeString.prototype.toHTML = function () { | ||
return '' + this.string; | ||
}; | ||
exports['default'] = SafeString; | ||
module.exports = exports['default']; | ||
/***/ }, | ||
/* 3 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
exports.__esModule = true; | ||
var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack']; | ||
function Exception(message, node) { | ||
var loc = node && node.loc, | ||
line = undefined, | ||
column = undefined; | ||
if (loc) { | ||
line = loc.start.line; | ||
column = loc.start.column; | ||
message += ' - ' + line + ':' + column; | ||
} | ||
var tmp = Error.prototype.constructor.call(this, message); | ||
// Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work. | ||
for (var idx = 0; idx < errorProps.length; idx++) { | ||
this[errorProps[idx]] = tmp[errorProps[idx]]; | ||
} | ||
if (Error.captureStackTrace) { | ||
Error.captureStackTrace(this, Exception); | ||
} | ||
if (loc) { | ||
this.lineNumber = line; | ||
this.column = column; | ||
} | ||
} | ||
Exception.prototype = new Error(); | ||
exports['default'] = Exception; | ||
module.exports = exports['default']; | ||
/***/ }, | ||
/***/ }), | ||
/* 4 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
/***/ (function(module, exports) { | ||
@@ -505,4 +484,2 @@ 'use strict'; | ||
exports.extend = extend; | ||
// Older IE versions do not directly support indexOf so we must implement our own, sadly. | ||
exports.indexOf = indexOf; | ||
@@ -518,8 +495,9 @@ exports.escapeExpression = escapeExpression; | ||
'"': '"', | ||
'\'': ''', | ||
'`': '`' | ||
"'": ''', | ||
'`': '`', | ||
'=': '=' | ||
}; | ||
var badChars = /[&<>"'`]/g, | ||
possible = /[&<>"'`]/; | ||
var badChars = /[&<>"'`=]/g, | ||
possible = /[&<>"'`=]/; | ||
@@ -565,4 +543,7 @@ function escapeChar(chr) { | ||
return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false; | ||
};exports.isArray = isArray; | ||
}; | ||
exports.isArray = isArray; | ||
// Older IE versions do not directly support indexOf so we must implement our own, sadly. | ||
function indexOf(array, value) { | ||
@@ -619,15 +600,76 @@ for (var i = 0, len = array.length; i < len; i++) { | ||
/***/ }, | ||
/***/ }), | ||
/* 5 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
/***/ (function(module, exports) { | ||
'use strict'; | ||
var _interopRequireWildcard = __webpack_require__(7)['default']; | ||
exports.__esModule = true; | ||
var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack']; | ||
function Exception(message, node) { | ||
var loc = node && node.loc, | ||
line = undefined, | ||
column = undefined; | ||
if (loc) { | ||
line = loc.start.line; | ||
column = loc.start.column; | ||
message += ' - ' + line + ':' + column; | ||
} | ||
var tmp = Error.prototype.constructor.call(this, message); | ||
// Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work. | ||
for (var idx = 0; idx < errorProps.length; idx++) { | ||
this[errorProps[idx]] = tmp[errorProps[idx]]; | ||
} | ||
if (Error.captureStackTrace) { | ||
Error.captureStackTrace(this, Exception); | ||
} | ||
if (loc) { | ||
this.lineNumber = line; | ||
this.column = column; | ||
} | ||
} | ||
Exception.prototype = new Error(); | ||
exports['default'] = Exception; | ||
module.exports = exports['default']; | ||
/***/ }), | ||
/* 6 */ | ||
/***/ (function(module, exports) { | ||
// Build out our basic SafeString type | ||
'use strict'; | ||
exports.__esModule = true; | ||
exports.checkRevision = checkRevision; | ||
function SafeString(string) { | ||
this.string = string; | ||
} | ||
// TODO: Remove this line and break up compilePartial | ||
SafeString.prototype.toString = SafeString.prototype.toHTML = function () { | ||
return '' + this.string; | ||
}; | ||
exports['default'] = SafeString; | ||
module.exports = exports['default']; | ||
/***/ }), | ||
/* 7 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var _interopRequireWildcard = __webpack_require__(1)['default']; | ||
var _interopRequireDefault = __webpack_require__(2)['default']; | ||
exports.__esModule = true; | ||
exports.checkRevision = checkRevision; | ||
exports.template = template; | ||
@@ -639,24 +681,24 @@ exports.wrapProgram = wrapProgram; | ||
var _import = __webpack_require__(4); | ||
var _utils = __webpack_require__(4); | ||
var Utils = _interopRequireWildcard(_import); | ||
var Utils = _interopRequireWildcard(_utils); | ||
var _Exception = __webpack_require__(3); | ||
var _exception = __webpack_require__(5); | ||
var _Exception2 = _interopRequireWildcard(_Exception); | ||
var _exception2 = _interopRequireDefault(_exception); | ||
var _COMPILER_REVISION$REVISION_CHANGES$createFrame = __webpack_require__(1); | ||
var _base = __webpack_require__(3); | ||
function checkRevision(compilerInfo) { | ||
var compilerRevision = compilerInfo && compilerInfo[0] || 1, | ||
currentRevision = _COMPILER_REVISION$REVISION_CHANGES$createFrame.COMPILER_REVISION; | ||
currentRevision = _base.COMPILER_REVISION; | ||
if (compilerRevision !== currentRevision) { | ||
if (compilerRevision < currentRevision) { | ||
var runtimeVersions = _COMPILER_REVISION$REVISION_CHANGES$createFrame.REVISION_CHANGES[currentRevision], | ||
compilerVersions = _COMPILER_REVISION$REVISION_CHANGES$createFrame.REVISION_CHANGES[compilerRevision]; | ||
throw new _Exception2['default']('Template was precompiled with an older version of Handlebars than the current runtime. ' + 'Please update your precompiler to a newer version (' + runtimeVersions + ') or downgrade your runtime to an older version (' + compilerVersions + ').'); | ||
var runtimeVersions = _base.REVISION_CHANGES[currentRevision], | ||
compilerVersions = _base.REVISION_CHANGES[compilerRevision]; | ||
throw new _exception2['default']('Template was precompiled with an older version of Handlebars than the current runtime. ' + 'Please update your precompiler to a newer version (' + runtimeVersions + ') or downgrade your runtime to an older version (' + compilerVersions + ').'); | ||
} else { | ||
// Use the embedded version info since the runtime doesn't know about this revision yet | ||
throw new _Exception2['default']('Template was precompiled with a newer version of Handlebars than the current runtime. ' + 'Please update your runtime to a newer version (' + compilerInfo[1] + ').'); | ||
throw new _exception2['default']('Template was precompiled with a newer version of Handlebars than the current runtime. ' + 'Please update your runtime to a newer version (' + compilerInfo[1] + ').'); | ||
} | ||
@@ -669,6 +711,6 @@ } | ||
if (!env) { | ||
throw new _Exception2['default']('No environment passed to template'); | ||
throw new _exception2['default']('No environment passed to template'); | ||
} | ||
if (!templateSpec || !templateSpec.main) { | ||
throw new _Exception2['default']('Unknown template object: ' + typeof templateSpec); | ||
throw new _exception2['default']('Unknown template object: ' + typeof templateSpec); | ||
} | ||
@@ -706,3 +748,3 @@ | ||
} else { | ||
throw new _Exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode'); | ||
throw new _exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode'); | ||
} | ||
@@ -715,3 +757,3 @@ } | ||
if (!(name in obj)) { | ||
throw new _Exception2['default']('"' + name + '" not defined in ' + obj); | ||
throw new _exception2['default']('"' + name + '" not defined in ' + obj); | ||
} | ||
@@ -772,3 +814,3 @@ return obj[name]; | ||
function ret(context) { | ||
var options = arguments[1] === undefined ? {} : arguments[1]; | ||
var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; | ||
@@ -806,6 +848,6 @@ var data = options.data; | ||
if (templateSpec.useBlockParams && !blockParams) { | ||
throw new _Exception2['default']('must pass block params'); | ||
throw new _exception2['default']('must pass block params'); | ||
} | ||
if (templateSpec.useDepths && !depths) { | ||
throw new _Exception2['default']('must pass parent depths'); | ||
throw new _exception2['default']('must pass parent depths'); | ||
} | ||
@@ -820,3 +862,3 @@ | ||
function prog(context) { | ||
var options = arguments[1] === undefined ? {} : arguments[1]; | ||
var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; | ||
@@ -846,3 +888,3 @@ return fn.call(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), depths && [context].concat(depths)); | ||
if (partial === undefined) { | ||
throw new _Exception2['default']('The partial ' + options.name + ' could not be found'); | ||
throw new _exception2['default']('The partial ' + options.name + ' could not be found'); | ||
} else if (partial instanceof Function) { | ||
@@ -859,3 +901,3 @@ return partial(context, options); | ||
if (!data || !('root' in data)) { | ||
data = data ? _COMPILER_REVISION$REVISION_CHANGES$createFrame.createFrame(data) : {}; | ||
data = data ? _base.createFrame(data) : {}; | ||
data.root = context; | ||
@@ -866,10 +908,10 @@ } | ||
/***/ }, | ||
/* 6 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
/***/ }), | ||
/* 8 */ | ||
/***/ (function(module, exports) { | ||
/* WEBPACK VAR INJECTION */(function(global) {'use strict'; | ||
/* WEBPACK VAR INJECTION */(function(global) {/*global window */ | ||
'use strict'; | ||
exports.__esModule = true; | ||
/*global window */ | ||
@@ -891,19 +933,5 @@ exports['default'] = function (Handlebars) { | ||
/***/ }, | ||
/* 7 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
exports["default"] = function (obj) { | ||
return obj && obj.__esModule ? obj : { | ||
"default": obj | ||
}; | ||
}; | ||
exports.__esModule = true; | ||
/***/ } | ||
/***/ }) | ||
/******/ ]) | ||
}); | ||
; |
/*! | ||
handlebars v3.0.3 | ||
handlebars v3.0.4 | ||
@@ -27,2 +27,114 @@ Copyright (C) 2011-2014 by Yehuda Katz | ||
*/ | ||
!function(a,b){"object"==typeof exports&&"object"==typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):"object"==typeof exports?exports.Handlebars=b():a.Handlebars=b()}(this,function(){return function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m=a,b.c=c,b.p="",b(0)}([function(a,b,c){"use strict";function d(){var a=new g.HandlebarsEnvironment;return m.extend(a,g),a.SafeString=i["default"],a.Exception=k["default"],a.Utils=m,a.escapeExpression=m.escapeExpression,a.VM=o,a.template=function(b){return o.template(b,a)},a}var e=c(7)["default"];b.__esModule=!0;var f=c(1),g=e(f),h=c(2),i=e(h),j=c(3),k=e(j),l=c(4),m=e(l),n=c(5),o=e(n),p=c(6),q=e(p),r=d();r.create=d,q["default"](r),r["default"]=r,b["default"]=r,a.exports=b["default"]},function(a,b,c){"use strict";function d(a,b){this.helpers=a||{},this.partials=b||{},e(this)}function e(a){a.registerHelper("helperMissing",function(){if(1===arguments.length)return void 0;throw new k["default"]('Missing helper: "'+arguments[arguments.length-1].name+'"')}),a.registerHelper("blockHelperMissing",function(b,c){var d=c.inverse,e=c.fn;if(b===!0)return e(this);if(b===!1||null==b)return d(this);if(o(b))return b.length>0?(c.ids&&(c.ids=[c.name]),a.helpers.each(b,c)):d(this);if(c.data&&c.ids){var g=f(c.data);g.contextPath=i.appendContextPath(c.data.contextPath,c.name),c={data:g}}return e(b,c)}),a.registerHelper("each",function(a,b){function c(b,c,e){j&&(j.key=b,j.index=c,j.first=0===c,j.last=!!e,l&&(j.contextPath=l+b)),h+=d(a[b],{data:j,blockParams:i.blockParams([a[b],b],[l+b,null])})}if(!b)throw new k["default"]("Must pass iterator to #each");var d=b.fn,e=b.inverse,g=0,h="",j=void 0,l=void 0;if(b.data&&b.ids&&(l=i.appendContextPath(b.data.contextPath,b.ids[0])+"."),p(a)&&(a=a.call(this)),b.data&&(j=f(b.data)),a&&"object"==typeof a)if(o(a))for(var m=a.length;m>g;g++)c(g,g,g===a.length-1);else{var n=void 0;for(var q in a)a.hasOwnProperty(q)&&(n&&c(n,g-1),n=q,g++);n&&c(n,g-1,!0)}return 0===g&&(h=e(this)),h}),a.registerHelper("if",function(a,b){return p(a)&&(a=a.call(this)),!b.hash.includeZero&&!a||i.isEmpty(a)?b.inverse(this):b.fn(this)}),a.registerHelper("unless",function(b,c){return a.helpers["if"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})}),a.registerHelper("with",function(a,b){p(a)&&(a=a.call(this));var c=b.fn;if(i.isEmpty(a))return b.inverse(this);if(b.data&&b.ids){var d=f(b.data);d.contextPath=i.appendContextPath(b.data.contextPath,b.ids[0]),b={data:d}}return c(a,b)}),a.registerHelper("log",function(b,c){var d=c.data&&null!=c.data.level?parseInt(c.data.level,10):1;a.log(d,b)}),a.registerHelper("lookup",function(a,b){return a&&a[b]})}function f(a){var b=i.extend({},a);return b._parent=a,b}var g=c(7)["default"];b.__esModule=!0,b.HandlebarsEnvironment=d,b.createFrame=f;var h=c(4),i=g(h),j=c(3),k=g(j),l="3.0.1";b.VERSION=l;var m=6;b.COMPILER_REVISION=m;var n={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1"};b.REVISION_CHANGES=n;var o=i.isArray,p=i.isFunction,q=i.toString,r="[object Object]";d.prototype={constructor:d,logger:s,log:t,registerHelper:function(a,b){if(q.call(a)===r){if(b)throw new k["default"]("Arg not supported with multiple helpers");i.extend(this.helpers,a)}else this.helpers[a]=b},unregisterHelper:function(a){delete this.helpers[a]},registerPartial:function(a,b){if(q.call(a)===r)i.extend(this.partials,a);else{if("undefined"==typeof b)throw new k["default"]("Attempting to register a partial as undefined");this.partials[a]=b}},unregisterPartial:function(a){delete this.partials[a]}};var s={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:1,log:function(a,b){if("undefined"!=typeof console&&s.level<=a){var c=s.methodMap[a];(console[c]||console.log).call(console,b)}}};b.logger=s;var t=s.log;b.log=t},function(a,b){"use strict";function c(a){this.string=a}b.__esModule=!0,c.prototype.toString=c.prototype.toHTML=function(){return""+this.string},b["default"]=c,a.exports=b["default"]},function(a,b){"use strict";function c(a,b){var e=b&&b.loc,f=void 0,g=void 0;e&&(f=e.start.line,g=e.start.column,a+=" - "+f+":"+g);for(var h=Error.prototype.constructor.call(this,a),i=0;i<d.length;i++)this[d[i]]=h[d[i]];Error.captureStackTrace&&Error.captureStackTrace(this,c),e&&(this.lineNumber=f,this.column=g)}b.__esModule=!0;var d=["description","fileName","lineNumber","message","name","number","stack"];c.prototype=new Error,b["default"]=c,a.exports=b["default"]},function(a,b){"use strict";function c(a){return j[a]}function d(a){for(var b=1;b<arguments.length;b++)for(var c in arguments[b])Object.prototype.hasOwnProperty.call(arguments[b],c)&&(a[c]=arguments[b][c]);return a}function e(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1}function f(a){if("string"!=typeof a){if(a&&a.toHTML)return a.toHTML();if(null==a)return"";if(!a)return a+"";a=""+a}return l.test(a)?a.replace(k,c):a}function g(a){return a||0===a?o(a)&&0===a.length?!0:!1:!0}function h(a,b){return a.path=b,a}function i(a,b){return(a?a+".":"")+b}b.__esModule=!0,b.extend=d,b.indexOf=e,b.escapeExpression=f,b.isEmpty=g,b.blockParams=h,b.appendContextPath=i;var j={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},k=/[&<>"'`]/g,l=/[&<>"'`]/,m=Object.prototype.toString;b.toString=m;var n=function(a){return"function"==typeof a};n(/x/)&&(b.isFunction=n=function(a){return"function"==typeof a&&"[object Function]"===m.call(a)});var n;b.isFunction=n;var o=Array.isArray||function(a){return a&&"object"==typeof a?"[object Array]"===m.call(a):!1};b.isArray=o},function(a,b,c){"use strict";function d(a){var b=a&&a[0]||1,c=p.COMPILER_REVISION;if(b!==c){if(c>b){var d=p.REVISION_CHANGES[c],e=p.REVISION_CHANGES[b];throw new o["default"]("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+d+") or downgrade your runtime to an older version ("+e+").")}throw new o["default"]("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+a[1]+").")}}function e(a,b){function c(c,d,e){e.hash&&(d=m.extend({},d,e.hash)),c=b.VM.resolvePartial.call(this,c,d,e);var f=b.VM.invokePartial.call(this,c,d,e);if(null==f&&b.compile&&(e.partials[e.name]=b.compile(c,a.compilerOptions,b),f=e.partials[e.name](d,e)),null!=f){if(e.indent){for(var g=f.split("\n"),h=0,i=g.length;i>h&&(g[h]||h+1!==i);h++)g[h]=e.indent+g[h];f=g.join("\n")}return f}throw new o["default"]("The partial "+e.name+" could not be compiled when running in runtime-only mode")}function d(b){var c=void 0===arguments[1]?{}:arguments[1],f=c.data;d._setup(c),!c.partial&&a.useData&&(f=j(b,f));var g=void 0,h=a.useBlockParams?[]:void 0;return a.useDepths&&(g=c.depths?[b].concat(c.depths):[b]),a.main.call(e,b,e.helpers,e.partials,f,h,g)}if(!b)throw new o["default"]("No environment passed to template");if(!a||!a.main)throw new o["default"]("Unknown template object: "+typeof a);b.VM.checkRevision(a.compiler);var e={strict:function(a,b){if(!(b in a))throw new o["default"]('"'+b+'" not defined in '+a);return a[b]},lookup:function(a,b){for(var c=a.length,d=0;c>d;d++)if(a[d]&&null!=a[d][b])return a[d][b]},lambda:function(a,b){return"function"==typeof a?a.call(b):a},escapeExpression:m.escapeExpression,invokePartial:c,fn:function(b){return a[b]},programs:[],program:function(a,b,c,d,e){var g=this.programs[a],h=this.fn(a);return b||e||d||c?g=f(this,a,h,b,c,d,e):g||(g=this.programs[a]=f(this,a,h)),g},data:function(a,b){for(;a&&b--;)a=a._parent;return a},merge:function(a,b){var c=a||b;return a&&b&&a!==b&&(c=m.extend({},b,a)),c},noop:b.VM.noop,compilerInfo:a.compiler};return d.isTop=!0,d._setup=function(c){c.partial?(e.helpers=c.helpers,e.partials=c.partials):(e.helpers=e.merge(c.helpers,b.helpers),a.usePartial&&(e.partials=e.merge(c.partials,b.partials)))},d._child=function(b,c,d,g){if(a.useBlockParams&&!d)throw new o["default"]("must pass block params");if(a.useDepths&&!g)throw new o["default"]("must pass parent depths");return f(e,b,a[b],c,0,d,g)},d}function f(a,b,c,d,e,f,g){function h(b){var e=void 0===arguments[1]?{}:arguments[1];return c.call(a,b,a.helpers,a.partials,e.data||d,f&&[e.blockParams].concat(f),g&&[b].concat(g))}return h.program=b,h.depth=g?g.length:0,h.blockParams=e||0,h}function g(a,b,c){return a?a.call||c.name||(c.name=a,a=c.partials[a]):a=c.partials[c.name],a}function h(a,b,c){if(c.partial=!0,void 0===a)throw new o["default"]("The partial "+c.name+" could not be found");return a instanceof Function?a(b,c):void 0}function i(){return""}function j(a,b){return b&&"root"in b||(b=b?p.createFrame(b):{},b.root=a),b}var k=c(7)["default"];b.__esModule=!0,b.checkRevision=d,b.template=e,b.wrapProgram=f,b.resolvePartial=g,b.invokePartial=h,b.noop=i;var l=c(4),m=k(l),n=c(3),o=k(n),p=c(1)},function(a,b){(function(c){"use strict";b.__esModule=!0,b["default"]=function(a){var b="undefined"!=typeof c?c:window,d=b.Handlebars;a.noConflict=function(){b.Handlebars===a&&(b.Handlebars=d)}},a.exports=b["default"]}).call(b,function(){return this}())},function(a,b){"use strict";b["default"]=function(a){return a&&a.__esModule?a:{"default":a}},b.__esModule=!0}])}); | ||
!function(a,b){"object"==typeof exports&&"object"==typeof module?module.exports=b():"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?exports.Handlebars=b():a.Handlebars=b()}(this,function(){/******/ | ||
return function(a){/******/ | ||
// The require function | ||
/******/ | ||
function b(d){/******/ | ||
// Check if module is in cache | ||
/******/ | ||
if(c[d])/******/ | ||
return c[d].exports;/******/ | ||
// Create a new module (and put it into the cache) | ||
/******/ | ||
var e=c[d]={/******/ | ||
exports:{},/******/ | ||
id:d,/******/ | ||
loaded:!1};/******/ | ||
// Return the exports of the module | ||
/******/ | ||
/******/ | ||
// Execute the module function | ||
/******/ | ||
/******/ | ||
// Flag the module as loaded | ||
/******/ | ||
return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}// webpackBootstrap | ||
/******/ | ||
// The module cache | ||
/******/ | ||
var c={};/******/ | ||
// Load entry module and return exports | ||
/******/ | ||
/******/ | ||
// expose the modules object (__webpack_modules__) | ||
/******/ | ||
/******/ | ||
// expose the module cache | ||
/******/ | ||
/******/ | ||
// __webpack_public_path__ | ||
/******/ | ||
return b.m=a,b.c=c,b.p="",b(0)}([/* 0 */ | ||
/***/ | ||
function(a,b,c){"use strict"; | ||
// For compatibility and usage outside of module systems, make the Handlebars object a namespace | ||
function d(){var a=new h.HandlebarsEnvironment;return n.extend(a,h),a.SafeString=j["default"],a.Exception=l["default"],a.Utils=n,a.escapeExpression=n.escapeExpression,a.VM=p,a.template=function(b){return p.template(b,a)},a}var e=c(1)["default"],f=c(2)["default"];b.__esModule=!0;var g=c(3),h=e(g),i=c(6),j=f(i),k=c(5),l=f(k),m=c(4),n=e(m),o=c(7),p=e(o),q=c(8),r=f(q),s=d();s.create=d,r["default"](s),s["default"]=s,b["default"]=s,a.exports=b["default"]},/* 1 */ | ||
/***/ | ||
function(a,b){"use strict";b["default"]=function(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b},b.__esModule=!0},/* 2 */ | ||
/***/ | ||
function(a,b){"use strict";b["default"]=function(a){return a&&a.__esModule?a:{"default":a}},b.__esModule=!0},/* 3 */ | ||
/***/ | ||
function(a,b,c){"use strict";function d(a,b){this.helpers=a||{},this.partials=b||{},e(this)}function e(a){a.registerHelper("helperMissing",function(){if(1!==arguments.length) | ||
// Someone is actually trying to call something, blow up. | ||
throw new l["default"]('Missing helper: "'+arguments[arguments.length-1].name+'"')}),a.registerHelper("blockHelperMissing",function(b,c){var d=c.inverse,e=c.fn;if(b===!0)return e(this);if(b===!1||null==b)return d(this);if(p(b))return b.length>0?(c.ids&&(c.ids=[c.name]),a.helpers.each(b,c)):d(this);if(c.data&&c.ids){var g=f(c.data);g.contextPath=j.appendContextPath(c.data.contextPath,c.name),c={data:g}}return e(b,c)}),a.registerHelper("each",function(a,b){function c(b,c,e){i&&(i.key=b,i.index=c,i.first=0===c,i.last=!!e,k&&(i.contextPath=k+b)),h+=d(a[b],{data:i,blockParams:j.blockParams([a[b],b],[k+b,null])})}if(!b)throw new l["default"]("Must pass iterator to #each");var d=b.fn,e=b.inverse,g=0,h="",i=void 0,k=void 0;if(b.data&&b.ids&&(k=j.appendContextPath(b.data.contextPath,b.ids[0])+"."),q(a)&&(a=a.call(this)),b.data&&(i=f(b.data)),a&&"object"==typeof a)if(p(a))for(var m=a.length;g<m;g++)c(g,g,g===a.length-1);else{var n=void 0;for(var o in a)a.hasOwnProperty(o)&&( | ||
// We're running the iterations one step out of sync so we can detect | ||
// the last iteration without have to scan the object twice and create | ||
// an itermediate keys array. | ||
n&&c(n,g-1),n=o,g++);n&&c(n,g-1,!0)}return 0===g&&(h=e(this)),h}),a.registerHelper("if",function(a,b){ | ||
// Default behavior is to render the positive path if the value is truthy and not empty. | ||
// The `includeZero` option may be set to treat the condtional as purely not empty based on the | ||
// behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative. | ||
// Default behavior is to render the positive path if the value is truthy and not empty. | ||
// The `includeZero` option may be set to treat the condtional as purely not empty based on the | ||
// behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative. | ||
return q(a)&&(a=a.call(this)),!b.hash.includeZero&&!a||j.isEmpty(a)?b.inverse(this):b.fn(this)}),a.registerHelper("unless",function(b,c){return a.helpers["if"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})}),a.registerHelper("with",function(a,b){q(a)&&(a=a.call(this));var c=b.fn;if(j.isEmpty(a))return b.inverse(this);if(b.data&&b.ids){var d=f(b.data);d.contextPath=j.appendContextPath(b.data.contextPath,b.ids[0]),b={data:d}}return c(a,b)}),a.registerHelper("log",function(b,c){var d=c.data&&null!=c.data.level?parseInt(c.data.level,10):1;a.log(d,b)}),a.registerHelper("lookup",function(a,b){return a&&a[b]})}function f(a){var b=j.extend({},a);return b._parent=a,b}var g=c(1)["default"],h=c(2)["default"];b.__esModule=!0,b.HandlebarsEnvironment=d,b.createFrame=f;var i=c(4),j=g(i),k=c(5),l=h(k),m="3.0.1";b.VERSION=m;var n=6;b.COMPILER_REVISION=n;var o={1:"<= 1.0.rc.2",// 1.0.rc.2 is actually rev2 but doesn't report it | ||
2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1"};b.REVISION_CHANGES=o;var p=j.isArray,q=j.isFunction,r=j.toString,s="[object Object]";d.prototype={constructor:d,logger:t,log:u,registerHelper:function(a,b){if(r.call(a)===s){if(b)throw new l["default"]("Arg not supported with multiple helpers");j.extend(this.helpers,a)}else this.helpers[a]=b},unregisterHelper:function(a){delete this.helpers[a]},registerPartial:function(a,b){if(r.call(a)===s)j.extend(this.partials,a);else{if("undefined"==typeof b)throw new l["default"]("Attempting to register a partial as undefined");this.partials[a]=b}},unregisterPartial:function(a){delete this.partials[a]}};var t={methodMap:{0:"debug",1:"info",2:"warn",3:"error"}, | ||
// State enum | ||
DEBUG:0,INFO:1,WARN:2,ERROR:3,level:1, | ||
// Can be overridden in the host environment | ||
log:function(a,b){if("undefined"!=typeof console&&t.level<=a){var c=t.methodMap[a];(console[c]||console.log).call(console,b)}}};b.logger=t;var u=t.log;b.log=u},/* 4 */ | ||
/***/ | ||
function(a,b){"use strict";function c(a){return j[a]}function d(a){for(var b=1;b<arguments.length;b++)for(var c in arguments[b])Object.prototype.hasOwnProperty.call(arguments[b],c)&&(a[c]=arguments[b][c]);return a} | ||
// Older IE versions do not directly support indexOf so we must implement our own, sadly. | ||
function e(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1}function f(a){if("string"!=typeof a){ | ||
// don't escape SafeStrings, since they're already safe | ||
if(a&&a.toHTML)return a.toHTML();if(null==a)return"";if(!a)return a+""; | ||
// Force a string conversion as this will be done by the append regardless and | ||
// the regex test will do this transparently behind the scenes, causing issues if | ||
// an object's to string has escaped characters in it. | ||
a=""+a}return l.test(a)?a.replace(k,c):a}function g(a){return!a&&0!==a||!(!o(a)||0!==a.length)}function h(a,b){return a.path=b,a}function i(a,b){return(a?a+".":"")+b}b.__esModule=!0,b.extend=d,b.indexOf=e,b.escapeExpression=f,b.isEmpty=g,b.blockParams=h,b.appendContextPath=i;var j={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},k=/[&<>"'`=]/g,l=/[&<>"'`=]/,m=Object.prototype.toString;b.toString=m; | ||
// Sourced from lodash | ||
// https://github.com/bestiejs/lodash/blob/master/LICENSE.txt | ||
/*eslint-disable func-style, no-var */ | ||
var n=function(a){return"function"==typeof a}; | ||
// fallback for older versions of Chrome and Safari | ||
/* istanbul ignore next */ | ||
n(/x/)&&(b.isFunction=n=function(a){return"function"==typeof a&&"[object Function]"===m.call(a)});var n;b.isFunction=n;/*eslint-enable func-style, no-var */ | ||
/* istanbul ignore next */ | ||
var o=Array.isArray||function(a){return!(!a||"object"!=typeof a)&&"[object Array]"===m.call(a)};b.isArray=o},/* 5 */ | ||
/***/ | ||
function(a,b){"use strict";function c(a,b){var e=b&&b.loc,f=void 0,g=void 0;e&&(f=e.start.line,g=e.start.column,a+=" - "+f+":"+g); | ||
// Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work. | ||
for(var h=Error.prototype.constructor.call(this,a),i=0;i<d.length;i++)this[d[i]]=h[d[i]];Error.captureStackTrace&&Error.captureStackTrace(this,c),e&&(this.lineNumber=f,this.column=g)}b.__esModule=!0;var d=["description","fileName","lineNumber","message","name","number","stack"];c.prototype=new Error,b["default"]=c,a.exports=b["default"]},/* 6 */ | ||
/***/ | ||
function(a,b){ | ||
// Build out our basic SafeString type | ||
"use strict";function c(a){this.string=a}b.__esModule=!0,c.prototype.toString=c.prototype.toHTML=function(){return""+this.string},b["default"]=c,a.exports=b["default"]},/* 7 */ | ||
/***/ | ||
function(a,b,c){"use strict";function d(a){var b=a&&a[0]||1,c=q.COMPILER_REVISION;if(b!==c){if(b<c){var d=q.REVISION_CHANGES[c],e=q.REVISION_CHANGES[b];throw new p["default"]("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+d+") or downgrade your runtime to an older version ("+e+").")} | ||
// Use the embedded version info since the runtime doesn't know about this revision yet | ||
throw new p["default"]("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+a[1]+").")}}function e(a,b){function c(c,d,e){e.hash&&(d=n.extend({},d,e.hash)),c=b.VM.resolvePartial.call(this,c,d,e);var f=b.VM.invokePartial.call(this,c,d,e);if(null==f&&b.compile&&(e.partials[e.name]=b.compile(c,a.compilerOptions,b),f=e.partials[e.name](d,e)),null!=f){if(e.indent){for(var g=f.split("\n"),h=0,i=g.length;h<i&&(g[h]||h+1!==i);h++)g[h]=e.indent+g[h];f=g.join("\n")}return f}throw new p["default"]("The partial "+e.name+" could not be compiled when running in runtime-only mode")}function d(b){var c=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],f=c.data;d._setup(c),!c.partial&&a.useData&&(f=j(b,f));var g=void 0,h=a.useBlockParams?[]:void 0;return a.useDepths&&(g=c.depths?[b].concat(c.depths):[b]),a.main.call(e,b,e.helpers,e.partials,f,h,g)}/* istanbul ignore next */ | ||
if(!b)throw new p["default"]("No environment passed to template");if(!a||!a.main)throw new p["default"]("Unknown template object: "+typeof a); | ||
// Note: Using env.VM references rather than local var references throughout this section to allow | ||
// for external users to override these as psuedo-supported APIs. | ||
b.VM.checkRevision(a.compiler); | ||
// Just add water | ||
var e={strict:function(a,b){if(!(b in a))throw new p["default"]('"'+b+'" not defined in '+a);return a[b]},lookup:function(a,b){for(var c=a.length,d=0;d<c;d++)if(a[d]&&null!=a[d][b])return a[d][b]},lambda:function(a,b){return"function"==typeof a?a.call(b):a},escapeExpression:n.escapeExpression,invokePartial:c,fn:function(b){return a[b]},programs:[],program:function(a,b,c,d,e){var g=this.programs[a],h=this.fn(a);return b||e||d||c?g=f(this,a,h,b,c,d,e):g||(g=this.programs[a]=f(this,a,h)),g},data:function(a,b){for(;a&&b--;)a=a._parent;return a},merge:function(a,b){var c=a||b;return a&&b&&a!==b&&(c=n.extend({},b,a)),c},noop:b.VM.noop,compilerInfo:a.compiler};return d.isTop=!0,d._setup=function(c){c.partial?(e.helpers=c.helpers,e.partials=c.partials):(e.helpers=e.merge(c.helpers,b.helpers),a.usePartial&&(e.partials=e.merge(c.partials,b.partials)))},d._child=function(b,c,d,g){if(a.useBlockParams&&!d)throw new p["default"]("must pass block params");if(a.useDepths&&!g)throw new p["default"]("must pass parent depths");return f(e,b,a[b],c,0,d,g)},d}function f(a,b,c,d,e,f,g){function h(b){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return c.call(a,b,a.helpers,a.partials,e.data||d,f&&[e.blockParams].concat(f),g&&[b].concat(g))}return h.program=b,h.depth=g?g.length:0,h.blockParams=e||0,h}function g(a,b,c){ | ||
// This is a dynamic partial that returned a string | ||
return a?a.call||c.name||(c.name=a,a=c.partials[a]):a=c.partials[c.name],a}function h(a,b,c){if(c.partial=!0,void 0===a)throw new p["default"]("The partial "+c.name+" could not be found");if(a instanceof Function)return a(b,c)}function i(){return""}function j(a,b){return b&&"root"in b||(b=b?q.createFrame(b):{},b.root=a),b}var k=c(1)["default"],l=c(2)["default"];b.__esModule=!0,b.checkRevision=d,b.template=e,b.wrapProgram=f,b.resolvePartial=g,b.invokePartial=h,b.noop=i;var m=c(4),n=k(m),o=c(5),p=l(o),q=c(3)},/* 8 */ | ||
/***/ | ||
function(a,b){/* WEBPACK VAR INJECTION */ | ||
(function(c){/*global window */ | ||
"use strict";b.__esModule=!0,b["default"]=function(a){/* istanbul ignore next */ | ||
var b="undefined"!=typeof c?c:window,d=b.Handlebars;/* istanbul ignore next */ | ||
a.noConflict=function(){b.Handlebars===a&&(b.Handlebars=d)}},a.exports=b["default"]}).call(b,function(){return this}())}])}); |
@@ -9,3 +9,4 @@ /* istanbul ignore next */ | ||
productions_: [0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[12,1],[10,3],[15,5],[9,4],[9,4],[22,6],[25,6],[36,6],[41,2],[43,3],[43,1],[24,3],[8,5],[8,5],[11,5],[57,1],[57,1],[58,5],[63,1],[65,3],[68,3],[18,1],[18,1],[18,1],[18,1],[18,1],[18,1],[18,1],[54,1],[54,1],[73,2],[72,1],[80,3],[80,1],[6,0],[6,2],[19,0],[19,2],[20,0],[20,1],[23,0],[23,1],[26,0],[26,1],[28,0],[28,2],[29,0],[29,1],[30,0],[30,1],[33,0],[33,2],[34,0],[34,1],[35,0],[35,1],[38,0],[38,2],[39,0],[39,1],[40,0],[40,1],[44,0],[44,1],[47,0],[47,2],[48,0],[48,1],[50,0],[50,2],[51,0],[51,1],[55,0],[55,2],[56,0],[56,1],[60,0],[60,2],[61,0],[61,1],[64,1],[64,2],[70,1],[70,2]], | ||
performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) { | ||
performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$ | ||
/*``*/) { | ||
@@ -428,3 +429,4 @@ var $0 = $$.length - 1; | ||
lexer.options = {}; | ||
lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { | ||
lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START | ||
/*``*/) { | ||
@@ -431,0 +433,0 @@ |
@@ -23,4 +23,2 @@ import * as Utils from './utils'; | ||
// TODO: Remove this line and break up compilePartial | ||
export function template(templateSpec, env) { | ||
@@ -27,0 +25,0 @@ /* istanbul ignore next */ |
@@ -7,7 +7,8 @@ const escape = { | ||
"'": ''', | ||
'`': '`' | ||
'`': '`', | ||
'=': '=' | ||
}; | ||
const badChars = /[&<>"'`]/g, | ||
possible = /[&<>"'`]/; | ||
const badChars = /[&<>"'`=]/g, | ||
possible = /[&<>"'`=]/; | ||
@@ -14,0 +15,0 @@ function escapeChar(chr) { |
{ | ||
"name": "handlebars", | ||
"barename": "handlebars", | ||
"version": "3.0.3", | ||
"version": "3.0.4", | ||
"description": "Handlebars provides the power necessary to let you build semantic templates effectively with no frustration", | ||
@@ -28,3 +28,3 @@ "homepage": "http://www.handlebarsjs.com/", | ||
"optionalDependencies": { | ||
"uglify-js": "~2.3" | ||
"uglify-js": "^2.6" | ||
}, | ||
@@ -58,3 +58,5 @@ "devDependencies": { | ||
"semver": "^4.0.0", | ||
"underscore": "^1.5.1" | ||
"underscore": "^1.5.1", | ||
"webpack": "^1.15.0", | ||
"webpack-dev-server": "^1.16.5" | ||
}, | ||
@@ -61,0 +63,0 @@ "main": "lib/index.js", |
@@ -5,4 +5,14 @@ # Release Notes | ||
[Commits](https://github.com/wycats/handlebars.js/compare/v3.0.3...master) | ||
[Commits](https://github.com/wycats/handlebars.js/compare/v3.0.4...master) | ||
## v3.0.4 - December 15th, 2018 | ||
- Further relax uglify dependency - 4cd5305 | ||
- Update uglify-js to avoid vulnerability - d97c2e6 | ||
- Escape = in HTML content - 1c863e3 | ||
Compatibility notes: | ||
- No breaking changes | ||
[Commits](https://github.com/wycats/handlebars.js/compare/v3.0.3...v3.0.4) | ||
## v3.0.3 - April 28th, 2015 | ||
@@ -9,0 +19,0 @@ - [#1004](https://github.com/wycats/handlebars.js/issues/1004) - Latest version breaks with RequireJS (global is undefined) ([@boskee](https://api.github.com/users/boskee)) |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1033907
82
20449
29