handlebars.runtime.js in handlebars-source-4.4.5 vs handlebars.runtime.js in handlebars-source-4.5.0

- old
+ new

@@ -1,9 +1,9 @@ /**! @license - handlebars v4.4.5 + handlebars v4.5.0 Copyright (C) 2011-2017 by Yehuda Katz Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -205,11 +205,11 @@ var _logger = __webpack_require__(19); var _logger2 = _interopRequireDefault(_logger); - var VERSION = '4.4.5'; + var VERSION = '4.5.0'; exports.VERSION = VERSION; var COMPILER_REVISION = 8; exports.COMPILER_REVISION = COMPILER_REVISION; var LAST_COMPATIBLE_COMPILER_REVISION = 7; @@ -429,19 +429,24 @@ var _Object$defineProperty = __webpack_require__(6)['default']; exports.__esModule = true; - var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack']; + var errorProps = ['description', 'fileName', 'lineNumber', 'endLineNumber', 'message', 'name', 'number', 'stack']; function Exception(message, node) { var loc = node && node.loc, line = undefined, - column = undefined; + endLineNumber = undefined, + column = undefined, + endColumn = undefined; + if (loc) { line = loc.start.line; + endLineNumber = loc.end.line; column = loc.start.column; + endColumn = loc.end.column; message += ' - ' + line + ':' + column; } var tmp = Error.prototype.constructor.call(this, message); @@ -457,20 +462,26 @@ } try { if (loc) { this.lineNumber = line; + this.endLineNumber = endLineNumber; // Work around issue under safari where we can't directly set the column value /* istanbul ignore next */ if (_Object$defineProperty) { Object.defineProperty(this, 'column', { value: column, enumerable: true }); + Object.defineProperty(this, 'endColumn', { + value: endColumn, + enumerable: true + }); } else { this.column = column; + this.endColumn = endColumn; } } } catch (nop) { /* Ignore if the browser is very particular */ } @@ -756,16 +767,25 @@ /* 13 */ /***/ (function(module, exports, __webpack_require__) { 'use strict'; + var _interopRequireDefault = __webpack_require__(2)['default']; + exports.__esModule = true; var _utils = __webpack_require__(4); + var _exception = __webpack_require__(5); + + var _exception2 = _interopRequireDefault(_exception); + exports['default'] = function (instance) { instance.registerHelper('if', function (conditional, options) { + if (arguments.length != 2) { + throw new _exception2['default']('#if requires exactly one argument'); + } if (_utils.isFunction(conditional)) { conditional = conditional.call(this); } // Default behavior is to render the positive path if the value is truthy and not empty. @@ -777,10 +797,13 @@ return options.fn(this); } }); instance.registerHelper('unless', function (conditional, options) { + if (arguments.length != 2) { + throw new _exception2['default']('#unless requires exactly one argument'); + } return instance.helpers['if'].call(this, conditional, { fn: options.inverse, inverse: options.fn, hash: options.hash }); }); }; module.exports = exports['default']; @@ -841,16 +864,25 @@ /* 16 */ /***/ (function(module, exports, __webpack_require__) { 'use strict'; + var _interopRequireDefault = __webpack_require__(2)['default']; + exports.__esModule = true; var _utils = __webpack_require__(4); + var _exception = __webpack_require__(5); + + var _exception2 = _interopRequireDefault(_exception); + exports['default'] = function (instance) { instance.registerHelper('with', function (context, options) { + if (arguments.length != 2) { + throw new _exception2['default']('#with requires exactly one argument'); + } if (_utils.isFunction(context)) { context = context.call(this); } var fn = options.fn; @@ -1100,12 +1132,12 @@ } } // Just add water var container = { - strict: function strict(obj, name) { - if (!(name in obj)) { - throw new _exception2['default']('"' + name + '" not defined in ' + obj); + strict: function strict(obj, name, loc) { + if (!obj || !(name in obj)) { + throw new _exception2['default']('"' + name + '" not defined in ' + obj, { loc: loc }); } return obj[name]; }, lookup: function lookup(depths, name) { var len = depths.length; \ No newline at end of file