handlebars_assets 0.23.7 → 0.23.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/CHANGELOG.md +12 -0
- data/lib/handlebars_assets/version.rb +1 -1
- data/test/test_helper.rb +11 -11
- data/vendor/assets/javascripts/handlebars.js +299 -99
- data/vendor/assets/javascripts/handlebars.runtime.js +246 -38
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2c02d89d7678f32df3d9581705a823482d9284e78ad2ce2bdfa08aecb9f4507a
|
4
|
+
data.tar.gz: edd1b55719e2bd2c9e8960d1b71b5ac8b8401ddc721e331d82d87ce3b49b549a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba64683f5c81d4884f3614752ee31a32131e5591439836ec2a2c144d6e7fc05ebd4454228ea96e3eab81616971afd5fdce29ef603a874af1d8704155ed8dd15d
|
7
|
+
data.tar.gz: 3e27543648aa054a89c8f80698c04fbc28a64bfc9391dcf333647219871e6b93be6f43c9e5f6e6994e07d03be57607f7a66172a218d3ae11f551235682e2470f
|
data/CHANGELOG.md
CHANGED
data/test/test_helper.rb
CHANGED
@@ -27,25 +27,25 @@ module CompilerSupport
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def hbs_compiled(template_name, source)
|
30
|
-
compiled_hbs = compile_hbs(source)
|
30
|
+
compiled_hbs = compile_hbs(source).strip
|
31
31
|
template_namespace = HandlebarsAssets::Config.template_namespace
|
32
32
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
33
|
+
<<-END_EXPECTED
|
34
|
+
(function() {
|
35
|
+
this.#{template_namespace} || (this.#{template_namespace} = {});
|
36
|
+
this.#{template_namespace}[#{template_name.dump}] = Handlebars.template(#{compiled_hbs});
|
37
|
+
return this.#{template_namespace}[#{template_name.dump}];
|
38
|
+
}).call(this);
|
39
39
|
END_EXPECTED
|
40
40
|
end
|
41
41
|
|
42
42
|
def hbs_compiled_partial(partial_name, source)
|
43
43
|
compiled_hbs = compile_hbs(source)
|
44
44
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
45
|
+
<<-END_EXPECTED
|
46
|
+
(function() {
|
47
|
+
Handlebars.registerPartial(#{partial_name.dump}, Handlebars.template(#{compiled_hbs}));
|
48
|
+
}).call(this);
|
49
49
|
END_EXPECTED
|
50
50
|
end
|
51
51
|
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
/**!
|
2
2
|
|
3
3
|
@license
|
4
|
-
handlebars v4.
|
4
|
+
handlebars v4.7.3
|
5
5
|
|
6
|
-
Copyright (C) 2011-
|
6
|
+
Copyright (C) 2011-2019 by Yehuda Katz
|
7
7
|
|
8
8
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
9
9
|
of this software and associated documentation files (the "Software"), to deal
|
@@ -92,23 +92,23 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
92
92
|
|
93
93
|
// Compiler imports
|
94
94
|
|
95
|
-
var _handlebarsCompilerAst = __webpack_require__(
|
95
|
+
var _handlebarsCompilerAst = __webpack_require__(45);
|
96
96
|
|
97
97
|
var _handlebarsCompilerAst2 = _interopRequireDefault(_handlebarsCompilerAst);
|
98
98
|
|
99
|
-
var _handlebarsCompilerBase = __webpack_require__(
|
99
|
+
var _handlebarsCompilerBase = __webpack_require__(46);
|
100
100
|
|
101
|
-
var _handlebarsCompilerCompiler = __webpack_require__(
|
101
|
+
var _handlebarsCompilerCompiler = __webpack_require__(51);
|
102
102
|
|
103
|
-
var _handlebarsCompilerJavascriptCompiler = __webpack_require__(
|
103
|
+
var _handlebarsCompilerJavascriptCompiler = __webpack_require__(52);
|
104
104
|
|
105
105
|
var _handlebarsCompilerJavascriptCompiler2 = _interopRequireDefault(_handlebarsCompilerJavascriptCompiler);
|
106
106
|
|
107
|
-
var _handlebarsCompilerVisitor = __webpack_require__(
|
107
|
+
var _handlebarsCompilerVisitor = __webpack_require__(49);
|
108
108
|
|
109
109
|
var _handlebarsCompilerVisitor2 = _interopRequireDefault(_handlebarsCompilerVisitor);
|
110
110
|
|
111
|
-
var _handlebarsNoConflict = __webpack_require__(
|
111
|
+
var _handlebarsNoConflict = __webpack_require__(44);
|
112
112
|
|
113
113
|
var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict);
|
114
114
|
|
@@ -178,7 +178,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
178
178
|
// Each of these augment the Handlebars object. No need to setup here.
|
179
179
|
// (This is done to easily share code between commonjs and browse envs)
|
180
180
|
|
181
|
-
var _handlebarsSafeString = __webpack_require__(
|
181
|
+
var _handlebarsSafeString = __webpack_require__(37);
|
182
182
|
|
183
183
|
var _handlebarsSafeString2 = _interopRequireDefault(_handlebarsSafeString);
|
184
184
|
|
@@ -190,11 +190,11 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
190
190
|
|
191
191
|
var Utils = _interopRequireWildcard(_handlebarsUtils);
|
192
192
|
|
193
|
-
var _handlebarsRuntime = __webpack_require__(
|
193
|
+
var _handlebarsRuntime = __webpack_require__(38);
|
194
194
|
|
195
195
|
var runtime = _interopRequireWildcard(_handlebarsRuntime);
|
196
196
|
|
197
|
-
var _handlebarsNoConflict = __webpack_require__(
|
197
|
+
var _handlebarsNoConflict = __webpack_require__(44);
|
198
198
|
|
199
199
|
var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict);
|
200
200
|
|
@@ -276,7 +276,9 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
276
276
|
|
277
277
|
var _logger2 = _interopRequireDefault(_logger);
|
278
278
|
|
279
|
-
var
|
279
|
+
var _internalProtoAccess = __webpack_require__(33);
|
280
|
+
|
281
|
+
var VERSION = '4.7.3';
|
280
282
|
exports.VERSION = VERSION;
|
281
283
|
var COMPILER_REVISION = 8;
|
282
284
|
exports.COMPILER_REVISION = COMPILER_REVISION;
|
@@ -352,6 +354,13 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
352
354
|
},
|
353
355
|
unregisterDecorator: function unregisterDecorator(name) {
|
354
356
|
delete this.decorators[name];
|
357
|
+
},
|
358
|
+
/**
|
359
|
+
* Reset the memory of illegal property accesses that have already been logged.
|
360
|
+
* @deprecated should only be used in handlebars test-cases
|
361
|
+
*/
|
362
|
+
resetLoggedPropertyAccesses: function resetLoggedPropertyAccesses() {
|
363
|
+
_internalProtoAccess.resetLoggedProperties();
|
355
364
|
}
|
356
365
|
};
|
357
366
|
|
@@ -375,7 +384,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
375
384
|
exports.createFrame = createFrame;
|
376
385
|
exports.blockParams = blockParams;
|
377
386
|
exports.appendContextPath = appendContextPath;
|
378
|
-
|
379
387
|
var escape = {
|
380
388
|
'&': '&',
|
381
389
|
'<': '<',
|
@@ -499,7 +507,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
499
507
|
var _Object$defineProperty = __webpack_require__(7)['default'];
|
500
508
|
|
501
509
|
exports.__esModule = true;
|
502
|
-
|
503
510
|
var errorProps = ['description', 'fileName', 'lineNumber', 'endLineNumber', 'message', 'name', 'number', 'stack'];
|
504
511
|
|
505
512
|
function Exception(message, node) {
|
@@ -1047,7 +1054,11 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1047
1054
|
if (arguments.length != 2) {
|
1048
1055
|
throw new _exception2['default']('#unless requires exactly one argument');
|
1049
1056
|
}
|
1050
|
-
return instance.helpers['if'].call(this, conditional, {
|
1057
|
+
return instance.helpers['if'].call(this, conditional, {
|
1058
|
+
fn: options.inverse,
|
1059
|
+
inverse: options.fn,
|
1060
|
+
hash: options.hash
|
1061
|
+
});
|
1051
1062
|
});
|
1052
1063
|
};
|
1053
1064
|
|
@@ -1090,22 +1101,19 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1090
1101
|
'use strict';
|
1091
1102
|
|
1092
1103
|
exports.__esModule = true;
|
1093
|
-
var dangerousPropertyRegex = /^(constructor|__defineGetter__|__defineSetter__|__lookupGetter__|__proto__)$/;
|
1094
|
-
|
1095
|
-
exports.dangerousPropertyRegex = dangerousPropertyRegex;
|
1096
1104
|
|
1097
1105
|
exports['default'] = function (instance) {
|
1098
|
-
instance.registerHelper('lookup', function (obj, field) {
|
1106
|
+
instance.registerHelper('lookup', function (obj, field, options) {
|
1099
1107
|
if (!obj) {
|
1108
|
+
// Note for 5.0: Change to "obj == null" in 5.0
|
1100
1109
|
return obj;
|
1101
1110
|
}
|
1102
|
-
|
1103
|
-
return undefined;
|
1104
|
-
}
|
1105
|
-
return obj[field];
|
1111
|
+
return options.lookupProperty(obj, field);
|
1106
1112
|
});
|
1107
1113
|
};
|
1108
1114
|
|
1115
|
+
module.exports = exports['default'];
|
1116
|
+
|
1109
1117
|
/***/ }),
|
1110
1118
|
/* 29 */
|
1111
1119
|
/***/ (function(module, exports, __webpack_require__) {
|
@@ -1238,8 +1246,8 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1238
1246
|
|
1239
1247
|
if (typeof console !== 'undefined' && logger.lookupLevel(logger.level) <= level) {
|
1240
1248
|
var method = logger.methodMap[level];
|
1249
|
+
// eslint-disable-next-line no-console
|
1241
1250
|
if (!console[method]) {
|
1242
|
-
// eslint-disable-line no-console
|
1243
1251
|
method = 'log';
|
1244
1252
|
}
|
1245
1253
|
|
@@ -1257,6 +1265,129 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1257
1265
|
|
1258
1266
|
/***/ }),
|
1259
1267
|
/* 33 */
|
1268
|
+
/***/ (function(module, exports, __webpack_require__) {
|
1269
|
+
|
1270
|
+
'use strict';
|
1271
|
+
|
1272
|
+
var _Object$create = __webpack_require__(34)['default'];
|
1273
|
+
|
1274
|
+
var _Object$keys = __webpack_require__(13)['default'];
|
1275
|
+
|
1276
|
+
var _interopRequireWildcard = __webpack_require__(3)['default'];
|
1277
|
+
|
1278
|
+
exports.__esModule = true;
|
1279
|
+
exports.createProtoAccessControl = createProtoAccessControl;
|
1280
|
+
exports.resultIsAllowed = resultIsAllowed;
|
1281
|
+
exports.resetLoggedProperties = resetLoggedProperties;
|
1282
|
+
|
1283
|
+
var _createNewLookupObject = __webpack_require__(36);
|
1284
|
+
|
1285
|
+
var _logger = __webpack_require__(32);
|
1286
|
+
|
1287
|
+
var logger = _interopRequireWildcard(_logger);
|
1288
|
+
|
1289
|
+
var loggedProperties = _Object$create(null);
|
1290
|
+
|
1291
|
+
function createProtoAccessControl(runtimeOptions) {
|
1292
|
+
var defaultMethodWhiteList = _Object$create(null);
|
1293
|
+
defaultMethodWhiteList['constructor'] = false;
|
1294
|
+
defaultMethodWhiteList['__defineGetter__'] = false;
|
1295
|
+
defaultMethodWhiteList['__defineSetter__'] = false;
|
1296
|
+
defaultMethodWhiteList['__lookupGetter__'] = false;
|
1297
|
+
|
1298
|
+
var defaultPropertyWhiteList = _Object$create(null);
|
1299
|
+
// eslint-disable-next-line no-proto
|
1300
|
+
defaultPropertyWhiteList['__proto__'] = false;
|
1301
|
+
|
1302
|
+
return {
|
1303
|
+
properties: {
|
1304
|
+
whitelist: _createNewLookupObject.createNewLookupObject(defaultPropertyWhiteList, runtimeOptions.allowedProtoProperties),
|
1305
|
+
defaultValue: runtimeOptions.allowProtoPropertiesByDefault
|
1306
|
+
},
|
1307
|
+
methods: {
|
1308
|
+
whitelist: _createNewLookupObject.createNewLookupObject(defaultMethodWhiteList, runtimeOptions.allowedProtoMethods),
|
1309
|
+
defaultValue: runtimeOptions.allowProtoMethodsByDefault
|
1310
|
+
}
|
1311
|
+
};
|
1312
|
+
}
|
1313
|
+
|
1314
|
+
function resultIsAllowed(result, protoAccessControl, propertyName) {
|
1315
|
+
if (typeof result === 'function') {
|
1316
|
+
return checkWhiteList(protoAccessControl.methods, propertyName);
|
1317
|
+
} else {
|
1318
|
+
return checkWhiteList(protoAccessControl.properties, propertyName);
|
1319
|
+
}
|
1320
|
+
}
|
1321
|
+
|
1322
|
+
function checkWhiteList(protoAccessControlForType, propertyName) {
|
1323
|
+
if (protoAccessControlForType.whitelist[propertyName] !== undefined) {
|
1324
|
+
return protoAccessControlForType.whitelist[propertyName] === true;
|
1325
|
+
}
|
1326
|
+
if (protoAccessControlForType.defaultValue !== undefined) {
|
1327
|
+
return protoAccessControlForType.defaultValue;
|
1328
|
+
}
|
1329
|
+
logUnexpecedPropertyAccessOnce(propertyName);
|
1330
|
+
return false;
|
1331
|
+
}
|
1332
|
+
|
1333
|
+
function logUnexpecedPropertyAccessOnce(propertyName) {
|
1334
|
+
if (loggedProperties[propertyName] !== true) {
|
1335
|
+
loggedProperties[propertyName] = true;
|
1336
|
+
logger.log('error', 'Handlebars: Access has been denied to resolve the property "' + propertyName + '" because it is not an "own property" of its parent.\n' + 'You can add a runtime option to disable the check or this warning:\n' + 'See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details');
|
1337
|
+
}
|
1338
|
+
}
|
1339
|
+
|
1340
|
+
function resetLoggedProperties() {
|
1341
|
+
_Object$keys(loggedProperties).forEach(function (propertyName) {
|
1342
|
+
delete loggedProperties[propertyName];
|
1343
|
+
});
|
1344
|
+
}
|
1345
|
+
|
1346
|
+
/***/ }),
|
1347
|
+
/* 34 */
|
1348
|
+
/***/ (function(module, exports, __webpack_require__) {
|
1349
|
+
|
1350
|
+
module.exports = { "default": __webpack_require__(35), __esModule: true };
|
1351
|
+
|
1352
|
+
/***/ }),
|
1353
|
+
/* 35 */
|
1354
|
+
/***/ (function(module, exports, __webpack_require__) {
|
1355
|
+
|
1356
|
+
var $ = __webpack_require__(9);
|
1357
|
+
module.exports = function create(P, D){
|
1358
|
+
return $.create(P, D);
|
1359
|
+
};
|
1360
|
+
|
1361
|
+
/***/ }),
|
1362
|
+
/* 36 */
|
1363
|
+
/***/ (function(module, exports, __webpack_require__) {
|
1364
|
+
|
1365
|
+
'use strict';
|
1366
|
+
|
1367
|
+
var _Object$create = __webpack_require__(34)['default'];
|
1368
|
+
|
1369
|
+
exports.__esModule = true;
|
1370
|
+
exports.createNewLookupObject = createNewLookupObject;
|
1371
|
+
|
1372
|
+
var _utils = __webpack_require__(5);
|
1373
|
+
|
1374
|
+
/**
|
1375
|
+
* Create a new object with "null"-prototype to avoid truthy results on prototype properties.
|
1376
|
+
* The resulting object can be used with "object[property]" to check if a property exists
|
1377
|
+
* @param {...object} sources a varargs parameter of source objects that will be merged
|
1378
|
+
* @returns {object}
|
1379
|
+
*/
|
1380
|
+
|
1381
|
+
function createNewLookupObject() {
|
1382
|
+
for (var _len = arguments.length, sources = Array(_len), _key = 0; _key < _len; _key++) {
|
1383
|
+
sources[_key] = arguments[_key];
|
1384
|
+
}
|
1385
|
+
|
1386
|
+
return _utils.extend.apply(undefined, [_Object$create(null)].concat(sources));
|
1387
|
+
}
|
1388
|
+
|
1389
|
+
/***/ }),
|
1390
|
+
/* 37 */
|
1260
1391
|
/***/ (function(module, exports) {
|
1261
1392
|
|
1262
1393
|
// Build out our basic SafeString type
|
@@ -1275,12 +1406,14 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1275
1406
|
module.exports = exports['default'];
|
1276
1407
|
|
1277
1408
|
/***/ }),
|
1278
|
-
/*
|
1409
|
+
/* 38 */
|
1279
1410
|
/***/ (function(module, exports, __webpack_require__) {
|
1280
1411
|
|
1281
1412
|
'use strict';
|
1282
1413
|
|
1283
|
-
var _Object$seal = __webpack_require__(
|
1414
|
+
var _Object$seal = __webpack_require__(39)['default'];
|
1415
|
+
|
1416
|
+
var _Object$keys = __webpack_require__(13)['default'];
|
1284
1417
|
|
1285
1418
|
var _interopRequireWildcard = __webpack_require__(3)['default'];
|
1286
1419
|
|
@@ -1306,6 +1439,10 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1306
1439
|
|
1307
1440
|
var _helpers = __webpack_require__(10);
|
1308
1441
|
|
1442
|
+
var _internalWrapHelper = __webpack_require__(43);
|
1443
|
+
|
1444
|
+
var _internalProtoAccess = __webpack_require__(33);
|
1445
|
+
|
1309
1446
|
function checkRevision(compilerInfo) {
|
1310
1447
|
var compilerRevision = compilerInfo && compilerInfo[0] || 1,
|
1311
1448
|
currentRevision = _base.COMPILER_REVISION;
|
@@ -1325,7 +1462,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1325
1462
|
}
|
1326
1463
|
|
1327
1464
|
function template(templateSpec, env) {
|
1328
|
-
|
1329
1465
|
/* istanbul ignore next */
|
1330
1466
|
if (!env) {
|
1331
1467
|
throw new _exception2['default']('No environment passed to template');
|
@@ -1352,13 +1488,16 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1352
1488
|
}
|
1353
1489
|
partial = env.VM.resolvePartial.call(this, partial, context, options);
|
1354
1490
|
|
1355
|
-
var
|
1491
|
+
var extendedOptions = Utils.extend({}, options, {
|
1492
|
+
hooks: this.hooks,
|
1493
|
+
protoAccessControl: this.protoAccessControl
|
1494
|
+
});
|
1356
1495
|
|
1357
|
-
var result = env.VM.invokePartial.call(this, partial, context,
|
1496
|
+
var result = env.VM.invokePartial.call(this, partial, context, extendedOptions);
|
1358
1497
|
|
1359
1498
|
if (result == null && env.compile) {
|
1360
1499
|
options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env);
|
1361
|
-
result = options.partials[options.name](context,
|
1500
|
+
result = options.partials[options.name](context, extendedOptions);
|
1362
1501
|
}
|
1363
1502
|
if (result != null) {
|
1364
1503
|
if (options.indent) {
|
@@ -1382,14 +1521,31 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1382
1521
|
var container = {
|
1383
1522
|
strict: function strict(obj, name, loc) {
|
1384
1523
|
if (!obj || !(name in obj)) {
|
1385
|
-
throw new _exception2['default']('"' + name + '" not defined in ' + obj, {
|
1524
|
+
throw new _exception2['default']('"' + name + '" not defined in ' + obj, {
|
1525
|
+
loc: loc
|
1526
|
+
});
|
1386
1527
|
}
|
1387
1528
|
return obj[name];
|
1388
1529
|
},
|
1530
|
+
lookupProperty: function lookupProperty(parent, propertyName) {
|
1531
|
+
var result = parent[propertyName];
|
1532
|
+
if (result == null) {
|
1533
|
+
return result;
|
1534
|
+
}
|
1535
|
+
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
1536
|
+
return result;
|
1537
|
+
}
|
1538
|
+
|
1539
|
+
if (_internalProtoAccess.resultIsAllowed(result, container.protoAccessControl, propertyName)) {
|
1540
|
+
return result;
|
1541
|
+
}
|
1542
|
+
return undefined;
|
1543
|
+
},
|
1389
1544
|
lookup: function lookup(depths, name) {
|
1390
1545
|
var len = depths.length;
|
1391
1546
|
for (var i = 0; i < len; i++) {
|
1392
|
-
|
1547
|
+
var result = depths[i] && container.lookupProperty(depths[i], name);
|
1548
|
+
if (result != null) {
|
1393
1549
|
return depths[i][name];
|
1394
1550
|
}
|
1395
1551
|
}
|
@@ -1425,6 +1581,15 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1425
1581
|
}
|
1426
1582
|
return value;
|
1427
1583
|
},
|
1584
|
+
mergeIfNeeded: function mergeIfNeeded(param, common) {
|
1585
|
+
var obj = param || common;
|
1586
|
+
|
1587
|
+
if (param && common && param !== common) {
|
1588
|
+
obj = Utils.extend({}, common, param);
|
1589
|
+
}
|
1590
|
+
|
1591
|
+
return obj;
|
1592
|
+
},
|
1428
1593
|
// An empty object to use as replacement for null-contexts
|
1429
1594
|
nullContext: _Object$seal({}),
|
1430
1595
|
|
@@ -1454,28 +1619,35 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1454
1619
|
function main(context /*, options*/) {
|
1455
1620
|
return '' + templateSpec.main(container, context, container.helpers, container.partials, data, blockParams, depths);
|
1456
1621
|
}
|
1622
|
+
|
1457
1623
|
main = executeDecorators(templateSpec.main, main, container, options.depths || [], data, blockParams);
|
1458
1624
|
return main(context, options);
|
1459
1625
|
}
|
1626
|
+
|
1460
1627
|
ret.isTop = true;
|
1461
1628
|
|
1462
1629
|
ret._setup = function (options) {
|
1463
1630
|
if (!options.partial) {
|
1464
|
-
|
1631
|
+
var mergedHelpers = Utils.extend({}, env.helpers, options.helpers);
|
1632
|
+
wrapHelpersToPassLookupProperty(mergedHelpers, container);
|
1633
|
+
container.helpers = mergedHelpers;
|
1465
1634
|
|
1466
1635
|
if (templateSpec.usePartial) {
|
1467
|
-
|
1636
|
+
// Use mergeIfNeeded here to prevent compiling global partials multiple times
|
1637
|
+
container.partials = container.mergeIfNeeded(options.partials, env.partials);
|
1468
1638
|
}
|
1469
1639
|
if (templateSpec.usePartial || templateSpec.useDecorators) {
|
1470
1640
|
container.decorators = Utils.extend({}, env.decorators, options.decorators);
|
1471
1641
|
}
|
1472
1642
|
|
1473
1643
|
container.hooks = {};
|
1644
|
+
container.protoAccessControl = _internalProtoAccess.createProtoAccessControl(options);
|
1474
1645
|
|
1475
1646
|
var keepHelperInHelpers = options.allowCallsToHelperMissing || templateWasPrecompiledWithCompilerV7;
|
1476
1647
|
_helpers.moveHelperToHooks(container, 'helperMissing', keepHelperInHelpers);
|
1477
1648
|
_helpers.moveHelperToHooks(container, 'blockHelperMissing', keepHelperInHelpers);
|
1478
1649
|
} else {
|
1650
|
+
container.protoAccessControl = options.protoAccessControl; // internal option
|
1479
1651
|
container.helpers = options.helpers;
|
1480
1652
|
container.partials = options.partials;
|
1481
1653
|
container.decorators = options.decorators;
|
@@ -1596,25 +1768,39 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1596
1768
|
return prog;
|
1597
1769
|
}
|
1598
1770
|
|
1771
|
+
function wrapHelpersToPassLookupProperty(mergedHelpers, container) {
|
1772
|
+
_Object$keys(mergedHelpers).forEach(function (helperName) {
|
1773
|
+
var helper = mergedHelpers[helperName];
|
1774
|
+
mergedHelpers[helperName] = passLookupPropertyOption(helper, container);
|
1775
|
+
});
|
1776
|
+
}
|
1777
|
+
|
1778
|
+
function passLookupPropertyOption(helper, container) {
|
1779
|
+
var lookupProperty = container.lookupProperty;
|
1780
|
+
return _internalWrapHelper.wrapHelper(helper, function (options) {
|
1781
|
+
return Utils.extend({ lookupProperty: lookupProperty }, options);
|
1782
|
+
});
|
1783
|
+
}
|
1784
|
+
|
1599
1785
|
/***/ }),
|
1600
|
-
/*
|
1786
|
+
/* 39 */
|
1601
1787
|
/***/ (function(module, exports, __webpack_require__) {
|
1602
1788
|
|
1603
|
-
module.exports = { "default": __webpack_require__(
|
1789
|
+
module.exports = { "default": __webpack_require__(40), __esModule: true };
|
1604
1790
|
|
1605
1791
|
/***/ }),
|
1606
|
-
/*
|
1792
|
+
/* 40 */
|
1607
1793
|
/***/ (function(module, exports, __webpack_require__) {
|
1608
1794
|
|
1609
|
-
__webpack_require__(
|
1795
|
+
__webpack_require__(41);
|
1610
1796
|
module.exports = __webpack_require__(21).Object.seal;
|
1611
1797
|
|
1612
1798
|
/***/ }),
|
1613
|
-
/*
|
1799
|
+
/* 41 */
|
1614
1800
|
/***/ (function(module, exports, __webpack_require__) {
|
1615
1801
|
|
1616
1802
|
// 19.1.2.17 Object.seal(O)
|
1617
|
-
var isObject = __webpack_require__(
|
1803
|
+
var isObject = __webpack_require__(42);
|
1618
1804
|
|
1619
1805
|
__webpack_require__(18)('seal', function($seal){
|
1620
1806
|
return function seal(it){
|
@@ -1623,7 +1809,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1623
1809
|
});
|
1624
1810
|
|
1625
1811
|
/***/ }),
|
1626
|
-
/*
|
1812
|
+
/* 42 */
|
1627
1813
|
/***/ (function(module, exports) {
|
1628
1814
|
|
1629
1815
|
module.exports = function(it){
|
@@ -1631,12 +1817,34 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1631
1817
|
};
|
1632
1818
|
|
1633
1819
|
/***/ }),
|
1634
|
-
/*
|
1820
|
+
/* 43 */
|
1635
1821
|
/***/ (function(module, exports) {
|
1636
1822
|
|
1637
|
-
/* WEBPACK VAR INJECTION */(function(global) {/* global window */
|
1638
1823
|
'use strict';
|
1639
1824
|
|
1825
|
+
exports.__esModule = true;
|
1826
|
+
exports.wrapHelper = wrapHelper;
|
1827
|
+
|
1828
|
+
function wrapHelper(helper, transformOptionsFn) {
|
1829
|
+
if (typeof helper !== 'function') {
|
1830
|
+
// This should not happen, but apparently it does in https://github.com/wycats/handlebars.js/issues/1639
|
1831
|
+
// We try to make the wrapper least-invasive by not wrapping it, if the helper is not a function.
|
1832
|
+
return helper;
|
1833
|
+
}
|
1834
|
+
var wrapper = function wrapper() /* dynamic arguments */{
|
1835
|
+
var options = arguments[arguments.length - 1];
|
1836
|
+
arguments[arguments.length - 1] = transformOptionsFn(options);
|
1837
|
+
return helper.apply(this, arguments);
|
1838
|
+
};
|
1839
|
+
return wrapper;
|
1840
|
+
}
|
1841
|
+
|
1842
|
+
/***/ }),
|
1843
|
+
/* 44 */
|
1844
|
+
/***/ (function(module, exports) {
|
1845
|
+
|
1846
|
+
/* WEBPACK VAR INJECTION */(function(global) {'use strict';
|
1847
|
+
|
1640
1848
|
exports.__esModule = true;
|
1641
1849
|
|
1642
1850
|
exports['default'] = function (Handlebars) {
|
@@ -1656,7 +1864,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1656
1864
|
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
|
1657
1865
|
|
1658
1866
|
/***/ }),
|
1659
|
-
/*
|
1867
|
+
/* 45 */
|
1660
1868
|
/***/ (function(module, exports) {
|
1661
1869
|
|
1662
1870
|
'use strict';
|
@@ -1691,7 +1899,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1691
1899
|
module.exports = exports['default'];
|
1692
1900
|
|
1693
1901
|
/***/ }),
|
1694
|
-
/*
|
1902
|
+
/* 46 */
|
1695
1903
|
/***/ (function(module, exports, __webpack_require__) {
|
1696
1904
|
|
1697
1905
|
'use strict';
|
@@ -1704,15 +1912,15 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1704
1912
|
exports.parseWithoutProcessing = parseWithoutProcessing;
|
1705
1913
|
exports.parse = parse;
|
1706
1914
|
|
1707
|
-
var _parser = __webpack_require__(
|
1915
|
+
var _parser = __webpack_require__(47);
|
1708
1916
|
|
1709
1917
|
var _parser2 = _interopRequireDefault(_parser);
|
1710
1918
|
|
1711
|
-
var _whitespaceControl = __webpack_require__(
|
1919
|
+
var _whitespaceControl = __webpack_require__(48);
|
1712
1920
|
|
1713
1921
|
var _whitespaceControl2 = _interopRequireDefault(_whitespaceControl);
|
1714
1922
|
|
1715
|
-
var _helpers = __webpack_require__(
|
1923
|
+
var _helpers = __webpack_require__(50);
|
1716
1924
|
|
1717
1925
|
var Helpers = _interopRequireWildcard(_helpers);
|
1718
1926
|
|
@@ -1749,7 +1957,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1749
1957
|
}
|
1750
1958
|
|
1751
1959
|
/***/ }),
|
1752
|
-
/*
|
1960
|
+
/* 47 */
|
1753
1961
|
/***/ (function(module, exports) {
|
1754
1962
|
|
1755
1963
|
// File ignored in coverage tests via setting in .istanbul.yml
|
@@ -2490,7 +2698,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
2490
2698
|
module.exports = exports["default"];
|
2491
2699
|
|
2492
2700
|
/***/ }),
|
2493
|
-
/*
|
2701
|
+
/* 48 */
|
2494
2702
|
/***/ (function(module, exports, __webpack_require__) {
|
2495
2703
|
|
2496
2704
|
'use strict';
|
@@ -2499,7 +2707,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
2499
2707
|
|
2500
2708
|
exports.__esModule = true;
|
2501
2709
|
|
2502
|
-
var _visitor = __webpack_require__(
|
2710
|
+
var _visitor = __webpack_require__(49);
|
2503
2711
|
|
2504
2712
|
var _visitor2 = _interopRequireDefault(_visitor);
|
2505
2713
|
|
@@ -2714,7 +2922,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
2714
2922
|
module.exports = exports['default'];
|
2715
2923
|
|
2716
2924
|
/***/ }),
|
2717
|
-
/*
|
2925
|
+
/* 49 */
|
2718
2926
|
/***/ (function(module, exports, __webpack_require__) {
|
2719
2927
|
|
2720
2928
|
'use strict';
|
@@ -2857,7 +3065,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
2857
3065
|
module.exports = exports['default'];
|
2858
3066
|
|
2859
3067
|
/***/ }),
|
2860
|
-
/*
|
3068
|
+
/* 50 */
|
2861
3069
|
/***/ (function(module, exports, __webpack_require__) {
|
2862
3070
|
|
2863
3071
|
'use strict';
|
@@ -3088,14 +3296,14 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
3088
3296
|
}
|
3089
3297
|
|
3090
3298
|
/***/ }),
|
3091
|
-
/*
|
3299
|
+
/* 51 */
|
3092
3300
|
/***/ (function(module, exports, __webpack_require__) {
|
3093
3301
|
|
3094
3302
|
/* eslint-disable new-cap */
|
3095
3303
|
|
3096
3304
|
'use strict';
|
3097
3305
|
|
3098
|
-
var _Object$create = __webpack_require__(
|
3306
|
+
var _Object$create = __webpack_require__(34)['default'];
|
3099
3307
|
|
3100
3308
|
var _interopRequireDefault = __webpack_require__(1)['default'];
|
3101
3309
|
|
@@ -3110,7 +3318,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
3110
3318
|
|
3111
3319
|
var _utils = __webpack_require__(5);
|
3112
3320
|
|
3113
|
-
var _ast = __webpack_require__(
|
3321
|
+
var _ast = __webpack_require__(45);
|
3114
3322
|
|
3115
3323
|
var _ast2 = _interopRequireDefault(_ast);
|
3116
3324
|
|
@@ -3165,14 +3373,14 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
3165
3373
|
options.blockParams = options.blockParams || [];
|
3166
3374
|
|
3167
3375
|
options.knownHelpers = _utils.extend(_Object$create(null), {
|
3168
|
-
|
3169
|
-
|
3170
|
-
|
3376
|
+
helperMissing: true,
|
3377
|
+
blockHelperMissing: true,
|
3378
|
+
each: true,
|
3171
3379
|
'if': true,
|
3172
|
-
|
3380
|
+
unless: true,
|
3173
3381
|
'with': true,
|
3174
|
-
|
3175
|
-
|
3382
|
+
log: true,
|
3383
|
+
lookup: true
|
3176
3384
|
}, options.knownHelpers);
|
3177
3385
|
|
3178
3386
|
return this.accept(program);
|
@@ -3439,7 +3647,11 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
3439
3647
|
|
3440
3648
|
// HELPERS
|
3441
3649
|
opcode: function opcode(name) {
|
3442
|
-
this.opcodes.push({
|
3650
|
+
this.opcodes.push({
|
3651
|
+
opcode: name,
|
3652
|
+
args: slice.call(arguments, 1),
|
3653
|
+
loc: this.sourceNode[0].loc
|
3654
|
+
});
|
3443
3655
|
},
|
3444
3656
|
|
3445
3657
|
addDepth: function addDepth(depth) {
|
@@ -3655,22 +3867,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
3655
3867
|
}
|
3656
3868
|
|
3657
3869
|
/***/ }),
|
3658
|
-
/*
|
3659
|
-
/***/ (function(module, exports, __webpack_require__) {
|
3660
|
-
|
3661
|
-
module.exports = { "default": __webpack_require__(48), __esModule: true };
|
3662
|
-
|
3663
|
-
/***/ }),
|
3664
|
-
/* 48 */
|
3665
|
-
/***/ (function(module, exports, __webpack_require__) {
|
3666
|
-
|
3667
|
-
var $ = __webpack_require__(9);
|
3668
|
-
module.exports = function create(P, D){
|
3669
|
-
return $.create(P, D);
|
3670
|
-
};
|
3671
|
-
|
3672
|
-
/***/ }),
|
3673
|
-
/* 49 */
|
3870
|
+
/* 52 */
|
3674
3871
|
/***/ (function(module, exports, __webpack_require__) {
|
3675
3872
|
|
3676
3873
|
'use strict';
|
@@ -3689,12 +3886,10 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
3689
3886
|
|
3690
3887
|
var _utils = __webpack_require__(5);
|
3691
3888
|
|
3692
|
-
var _codeGen = __webpack_require__(
|
3889
|
+
var _codeGen = __webpack_require__(53);
|
3693
3890
|
|
3694
3891
|
var _codeGen2 = _interopRequireDefault(_codeGen);
|
3695
3892
|
|
3696
|
-
var _helpersLookup = __webpack_require__(28);
|
3697
|
-
|
3698
3893
|
function Literal(value) {
|
3699
3894
|
this.value = value;
|
3700
3895
|
}
|
@@ -3704,20 +3899,8 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
3704
3899
|
JavaScriptCompiler.prototype = {
|
3705
3900
|
// PUBLIC API: You can override these methods in a subclass to provide
|
3706
3901
|
// alternative compiled forms for name lookup and buffering semantics
|
3707
|
-
nameLookup: function nameLookup(parent, name
|
3708
|
-
|
3709
|
-
var isEnumerable = [this.aliasable('container.propertyIsEnumerable'), '.call(', parent, ',', JSON.stringify(name), ')'];
|
3710
|
-
return ['(', isEnumerable, '?', _actualLookup(), ' : undefined)'];
|
3711
|
-
}
|
3712
|
-
return _actualLookup();
|
3713
|
-
|
3714
|
-
function _actualLookup() {
|
3715
|
-
if (JavaScriptCompiler.isValidJavaScriptVariableName(name)) {
|
3716
|
-
return [parent, '.', name];
|
3717
|
-
} else {
|
3718
|
-
return [parent, '[', JSON.stringify(name), ']'];
|
3719
|
-
}
|
3720
|
-
}
|
3902
|
+
nameLookup: function nameLookup(parent, name /*, type */) {
|
3903
|
+
return this.internalNameLookup(parent, name);
|
3721
3904
|
},
|
3722
3905
|
depthedLookup: function depthedLookup(name) {
|
3723
3906
|
return [this.aliasable('container.lookup'), '(depths, "', name, '")'];
|
@@ -3753,6 +3936,12 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
3753
3936
|
return this.quotedString('');
|
3754
3937
|
},
|
3755
3938
|
// END PUBLIC API
|
3939
|
+
internalNameLookup: function internalNameLookup(parent, name) {
|
3940
|
+
this.lookupPropertyFunctionIsUsed = true;
|
3941
|
+
return ['lookupProperty(', parent, ',', JSON.stringify(name), ')'];
|
3942
|
+
},
|
3943
|
+
|
3944
|
+
lookupPropertyFunctionIsUsed: false,
|
3756
3945
|
|
3757
3946
|
compile: function compile(environment, options, context, asObject) {
|
3758
3947
|
this.environment = environment;
|
@@ -3811,7 +4000,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
3811
4000
|
if (!this.decorators.isEmpty()) {
|
3812
4001
|
this.useDecorators = true;
|
3813
4002
|
|
3814
|
-
this.decorators.prepend('var decorators = container.decorators;\n');
|
4003
|
+
this.decorators.prepend(['var decorators = container.decorators, ', this.lookupPropertyFunctionVarDeclaration(), ';\n']);
|
3815
4004
|
this.decorators.push('return fn;');
|
3816
4005
|
|
3817
4006
|
if (asObject) {
|
@@ -3924,6 +4113,10 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
3924
4113
|
}
|
3925
4114
|
});
|
3926
4115
|
|
4116
|
+
if (this.lookupPropertyFunctionIsUsed) {
|
4117
|
+
varDeclarations += ', ' + this.lookupPropertyFunctionVarDeclaration();
|
4118
|
+
}
|
4119
|
+
|
3927
4120
|
var params = ['container', 'depth0', 'helpers', 'partials', 'data'];
|
3928
4121
|
|
3929
4122
|
if (this.useBlockParams || this.useDepths) {
|
@@ -4002,6 +4195,10 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
4002
4195
|
return this.source.merge();
|
4003
4196
|
},
|
4004
4197
|
|
4198
|
+
lookupPropertyFunctionVarDeclaration: function lookupPropertyFunctionVarDeclaration() {
|
4199
|
+
return '\n lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n }\n '.trim();
|
4200
|
+
},
|
4201
|
+
|
4005
4202
|
// [blockValue]
|
4006
4203
|
//
|
4007
4204
|
// On stack, before: hash, inverse, program, value
|
@@ -4804,6 +5001,9 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
4804
5001
|
}
|
4805
5002
|
})();
|
4806
5003
|
|
5004
|
+
/**
|
5005
|
+
* @deprecated May be removed in the next major version
|
5006
|
+
*/
|
4807
5007
|
JavaScriptCompiler.isValidJavaScriptVariableName = function (name) {
|
4808
5008
|
return !JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name);
|
4809
5009
|
};
|
@@ -4831,7 +5031,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
4831
5031
|
module.exports = exports['default'];
|
4832
5032
|
|
4833
5033
|
/***/ }),
|
4834
|
-
/*
|
5034
|
+
/* 53 */
|
4835
5035
|
/***/ (function(module, exports, __webpack_require__) {
|
4836
5036
|
|
4837
5037
|
/* global define */
|
@@ -5007,4 +5207,4 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
5007
5207
|
/***/ })
|
5008
5208
|
/******/ ])
|
5009
5209
|
});
|
5010
|
-
;
|
5210
|
+
;
|