vendor/assets/javascripts/handlebars.runtime.js in handlebars_assets-0.21.0 vs vendor/assets/javascripts/handlebars.runtime.js in handlebars_assets-0.22.0
- old
+ new
@@ -1,8 +1,8 @@
/*!
- handlebars v4.0.2
+ handlebars v4.0.5
Copyright (C) 2011-2015 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__(16);
var _logger2 = _interopRequireDefault(_logger);
- var VERSION = '4.0.2';
+ var VERSION = '4.0.5';
exports.VERSION = VERSION;
var COMPILER_REVISION = 7;
exports.COMPILER_REVISION = COMPILER_REVISION;
var REVISION_CHANGES = {
@@ -257,11 +257,11 @@
registerPartial: function registerPartial(name, partial) {
if (_utils.toString.call(name) === objectType) {
_utils.extend(this.partials, name);
} else {
if (typeof partial === 'undefined') {
- throw new _exception2['default']('Attempting to register a partial as undefined');
+ throw new _exception2['default']('Attempting to register a partial called "' + name + '" as undefined');
}
this.partials[name] = partial;
}
},
unregisterPartial: function unregisterPartial(name) {
@@ -593,16 +593,10 @@
if (options.data) {
data = _utils.createFrame(options.data);
}
function execIteration(field, index, last) {
- // Don't iterate over undefined values since we can't execute blocks against them
- // in non-strict (js) mode.
- if (context[field] == null) {
- return;
- }
-
if (data) {
data.key = field;
data.index = index;
data.first = index === 0;
data.last = !!last;
@@ -619,11 +613,13 @@
}
if (context && typeof context === 'object') {
if (_utils.isArray(context)) {
for (var j = context.length; i < j; i++) {
- execIteration(i, i, i === context.length - 1);
+ if (i in context) {
+ execIteration(i, i, i === context.length - 1);
+ }
}
} else {
var priorKey = undefined;
for (var key in context) {
@@ -850,23 +846,26 @@
module.exports = exports['default'];
/***/ },
/* 16 */
-/***/ function(module, exports) {
+/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
+
+ var _utils = __webpack_require__(4);
+
var logger = {
methodMap: ['debug', 'info', 'warn', 'error'],
level: 'info',
// Maps a given level value to the `methodMap` indexes above.
lookupLevel: function lookupLevel(level) {
if (typeof level === 'string') {
- var levelMap = logger.methodMap.indexOf(level.toLowerCase());
+ var levelMap = _utils.indexOf(logger.methodMap, level.toLowerCase());
if (levelMap >= 0) {
level = levelMap;
} else {
level = parseInt(level, 10);
}
@@ -1168,10 +1167,11 @@
options.data.contextPath = options.ids[0] || options.data.contextPath;
}
var partialBlock = undefined;
if (options.fn && options.fn !== noop) {
+ options.data = _base.createFrame(options.data);
partialBlock = options.data['partial-block'] = options.fn;
if (partialBlock.partials) {
options.partials = Utils.extend({}, options.partials, partialBlock.partials);
}
@@ -1225,9 +1225,10 @@
/* istanbul ignore next */
Handlebars.noConflict = function () {
if (root.Handlebars === Handlebars) {
root.Handlebars = $Handlebars;
}
+ return Handlebars;
};
};
module.exports = exports['default'];
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
\ No newline at end of file