handlebars-source 4.4.5 → 4.5.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of handlebars-source might be problematic. Click here for more details.

Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/handlebars.js +54 -11
  3. data/handlebars.runtime.js +39 -7
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 938a1451088ee04b86e7160ebbefaf459e36a17908d98900b466220d0b9c0d00
4
- data.tar.gz: b1d636f219de2a18408242508f5417d4d5901585c569afd6367f5b4ec7e0d0fb
3
+ metadata.gz: e672972fab1b5ace1385bd429d650e3644fe63b318331977ac9b43d30ee55455
4
+ data.tar.gz: 1d59b63a6034db6736b67e72f5dcf420a93e8a97991323c88ca418912920b60b
5
5
  SHA512:
6
- metadata.gz: 2523542850a534c034f709d48d5b3f10cb7dc8b463deffc1a8311baadbd6064741c2cdca140fe8f46b44857de4f76b4fcce494b6e225b53f021fe6c56b418535
7
- data.tar.gz: 418c3b34667ddf091b6f8f61150e37c07ffa47b3b922174896f1ff9503e556204228676ab7c6e636881147cc32b0f8dfe0dfd9dd19e1bb450643ece16d1a99f6
6
+ metadata.gz: 9ec15c1e9865f0baff4f65681ec13e1ebd9cd6db5835b591908493666142898cf6ec4758b614360799183dfbd616e55daf71d6bfb34bf8d86c7fd8158e6ff20a
7
+ data.tar.gz: 4221e030b8ac961b69b324cd21293f62ec814cb17c372195c65dc883892a895f9bdc181b676ea95b2e114b63481c91eccbf935624469c0b7f027a161eb308173
@@ -1,7 +1,7 @@
1
1
  /**!
2
2
 
3
3
  @license
4
- handlebars v4.4.5
4
+ handlebars v4.5.0
5
5
 
6
6
  Copyright (C) 2011-2017 by Yehuda Katz
7
7
 
@@ -128,6 +128,7 @@ return /******/ (function(modules) { // webpackBootstrap
128
128
  hb.JavaScriptCompiler = _handlebarsCompilerJavascriptCompiler2['default'];
129
129
  hb.Parser = _handlebarsCompilerBase.parser;
130
130
  hb.parse = _handlebarsCompilerBase.parse;
131
+ hb.parseWithoutProcessing = _handlebarsCompilerBase.parseWithoutProcessing;
131
132
 
132
133
  return hb;
133
134
  }
@@ -275,7 +276,7 @@ return /******/ (function(modules) { // webpackBootstrap
275
276
 
276
277
  var _logger2 = _interopRequireDefault(_logger);
277
278
 
278
- var VERSION = '4.4.5';
279
+ var VERSION = '4.5.0';
279
280
  exports.VERSION = VERSION;
280
281
  var COMPILER_REVISION = 8;
281
282
  exports.COMPILER_REVISION = COMPILER_REVISION;
@@ -499,15 +500,20 @@ return /******/ (function(modules) { // webpackBootstrap
499
500
 
500
501
  exports.__esModule = true;
501
502
 
502
- var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];
503
+ var errorProps = ['description', 'fileName', 'lineNumber', 'endLineNumber', 'message', 'name', 'number', 'stack'];
503
504
 
504
505
  function Exception(message, node) {
505
506
  var loc = node && node.loc,
506
507
  line = undefined,
507
- column = undefined;
508
+ endLineNumber = undefined,
509
+ column = undefined,
510
+ endColumn = undefined;
511
+
508
512
  if (loc) {
509
513
  line = loc.start.line;
514
+ endLineNumber = loc.end.line;
510
515
  column = loc.start.column;
516
+ endColumn = loc.end.column;
511
517
 
512
518
  message += ' - ' + line + ':' + column;
513
519
  }
@@ -527,6 +533,7 @@ return /******/ (function(modules) { // webpackBootstrap
527
533
  try {
528
534
  if (loc) {
529
535
  this.lineNumber = line;
536
+ this.endLineNumber = endLineNumber;
530
537
 
531
538
  // Work around issue under safari where we can't directly set the column value
532
539
  /* istanbul ignore next */
@@ -535,8 +542,13 @@ return /******/ (function(modules) { // webpackBootstrap
535
542
  value: column,
536
543
  enumerable: true
537
544
  });
545
+ Object.defineProperty(this, 'endColumn', {
546
+ value: endColumn,
547
+ enumerable: true
548
+ });
538
549
  } else {
539
550
  this.column = column;
551
+ this.endColumn = endColumn;
540
552
  }
541
553
  }
542
554
  } catch (nop) {
@@ -826,12 +838,21 @@ return /******/ (function(modules) { // webpackBootstrap
826
838
 
827
839
  'use strict';
828
840
 
841
+ var _interopRequireDefault = __webpack_require__(1)['default'];
842
+
829
843
  exports.__esModule = true;
830
844
 
831
845
  var _utils = __webpack_require__(5);
832
846
 
847
+ var _exception = __webpack_require__(6);
848
+
849
+ var _exception2 = _interopRequireDefault(_exception);
850
+
833
851
  exports['default'] = function (instance) {
834
852
  instance.registerHelper('if', function (conditional, options) {
853
+ if (arguments.length != 2) {
854
+ throw new _exception2['default']('#if requires exactly one argument');
855
+ }
835
856
  if (_utils.isFunction(conditional)) {
836
857
  conditional = conditional.call(this);
837
858
  }
@@ -847,6 +868,9 @@ return /******/ (function(modules) { // webpackBootstrap
847
868
  });
848
869
 
849
870
  instance.registerHelper('unless', function (conditional, options) {
871
+ if (arguments.length != 2) {
872
+ throw new _exception2['default']('#unless requires exactly one argument');
873
+ }
850
874
  return instance.helpers['if'].call(this, conditional, { fn: options.inverse, inverse: options.fn, hash: options.hash });
851
875
  });
852
876
  };
@@ -911,12 +935,21 @@ return /******/ (function(modules) { // webpackBootstrap
911
935
 
912
936
  'use strict';
913
937
 
938
+ var _interopRequireDefault = __webpack_require__(1)['default'];
939
+
914
940
  exports.__esModule = true;
915
941
 
916
942
  var _utils = __webpack_require__(5);
917
943
 
944
+ var _exception = __webpack_require__(6);
945
+
946
+ var _exception2 = _interopRequireDefault(_exception);
947
+
918
948
  exports['default'] = function (instance) {
919
949
  instance.registerHelper('with', function (context, options) {
950
+ if (arguments.length != 2) {
951
+ throw new _exception2['default']('#with requires exactly one argument');
952
+ }
920
953
  if (_utils.isFunction(context)) {
921
954
  context = context.call(this);
922
955
  }
@@ -1170,9 +1203,9 @@ return /******/ (function(modules) { // webpackBootstrap
1170
1203
 
1171
1204
  // Just add water
1172
1205
  var container = {
1173
- strict: function strict(obj, name) {
1174
- if (!(name in obj)) {
1175
- throw new _exception2['default']('"' + name + '" not defined in ' + obj);
1206
+ strict: function strict(obj, name, loc) {
1207
+ if (!obj || !(name in obj)) {
1208
+ throw new _exception2['default']('"' + name + '" not defined in ' + obj, { loc: loc });
1176
1209
  }
1177
1210
  return obj[name];
1178
1211
  },
@@ -1619,6 +1652,7 @@ return /******/ (function(modules) { // webpackBootstrap
1619
1652
  var _interopRequireWildcard = __webpack_require__(3)['default'];
1620
1653
 
1621
1654
  exports.__esModule = true;
1655
+ exports.parseWithoutProcessing = parseWithoutProcessing;
1622
1656
  exports.parse = parse;
1623
1657
 
1624
1658
  var _parser = __webpack_require__(37);
@@ -1640,7 +1674,7 @@ return /******/ (function(modules) { // webpackBootstrap
1640
1674
  var yy = {};
1641
1675
  _utils.extend(yy, Helpers);
1642
1676
 
1643
- function parse(input, options) {
1677
+ function parseWithoutProcessing(input, options) {
1644
1678
  // Just return if an already-compiled AST was passed in.
1645
1679
  if (input.type === 'Program') {
1646
1680
  return input;
@@ -1653,8 +1687,16 @@ return /******/ (function(modules) { // webpackBootstrap
1653
1687
  return new yy.SourceLocation(options && options.srcName, locInfo);
1654
1688
  };
1655
1689
 
1690
+ var ast = _parser2['default'].parse(input);
1691
+
1692
+ return ast;
1693
+ }
1694
+
1695
+ function parse(input, options) {
1696
+ var ast = parseWithoutProcessing(input, options);
1656
1697
  var strip = new _whitespaceControl2['default'](options);
1657
- return strip.accept(_parser2['default'].parse(input));
1698
+
1699
+ return strip.accept(ast);
1658
1700
  }
1659
1701
 
1660
1702
  /***/ }),
@@ -4138,7 +4180,7 @@ return /******/ (function(modules) { // webpackBootstrap
4138
4180
  if (this.hash) {
4139
4181
  this.hashes.push(this.hash);
4140
4182
  }
4141
- this.hash = { values: [], types: [], contexts: [], ids: [] };
4183
+ this.hash = { values: {}, types: [], contexts: [], ids: [] };
4142
4184
  },
4143
4185
  popHash: function popHash() {
4144
4186
  var hash = this.hash;
@@ -4676,6 +4718,7 @@ return /******/ (function(modules) { // webpackBootstrap
4676
4718
 
4677
4719
  setupHelperArgs: function setupHelperArgs(helper, paramSize, params, useRegister) {
4678
4720
  var options = this.setupParams(helper, paramSize, params);
4721
+ options.loc = JSON.stringify(this.source.currentLocation);
4679
4722
  options = this.objectLiteral(options);
4680
4723
  if (useRegister) {
4681
4724
  this.useRegister('options');
@@ -4717,7 +4760,7 @@ return /******/ (function(modules) { // webpackBootstrap
4717
4760
  }
4718
4761
 
4719
4762
  if (requireTerminal) {
4720
- return [compiler.aliasable('container.strict'), '(', stack, ', ', compiler.quotedString(parts[i]), ')'];
4763
+ return [compiler.aliasable('container.strict'), '(', stack, ', ', compiler.quotedString(parts[i]), ', ', JSON.stringify(compiler.source.currentLocation), ' )'];
4721
4764
  } else {
4722
4765
  return stack;
4723
4766
  }
@@ -1,7 +1,7 @@
1
1
  /**!
2
2
 
3
3
  @license
4
- handlebars v4.4.5
4
+ handlebars v4.5.0
5
5
 
6
6
  Copyright (C) 2011-2017 by Yehuda Katz
7
7
 
@@ -207,7 +207,7 @@ return /******/ (function(modules) { // webpackBootstrap
207
207
 
208
208
  var _logger2 = _interopRequireDefault(_logger);
209
209
 
210
- var VERSION = '4.4.5';
210
+ var VERSION = '4.5.0';
211
211
  exports.VERSION = VERSION;
212
212
  var COMPILER_REVISION = 8;
213
213
  exports.COMPILER_REVISION = COMPILER_REVISION;
@@ -431,15 +431,20 @@ return /******/ (function(modules) { // webpackBootstrap
431
431
 
432
432
  exports.__esModule = true;
433
433
 
434
- var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];
434
+ var errorProps = ['description', 'fileName', 'lineNumber', 'endLineNumber', 'message', 'name', 'number', 'stack'];
435
435
 
436
436
  function Exception(message, node) {
437
437
  var loc = node && node.loc,
438
438
  line = undefined,
439
- column = undefined;
439
+ endLineNumber = undefined,
440
+ column = undefined,
441
+ endColumn = undefined;
442
+
440
443
  if (loc) {
441
444
  line = loc.start.line;
445
+ endLineNumber = loc.end.line;
442
446
  column = loc.start.column;
447
+ endColumn = loc.end.column;
443
448
 
444
449
  message += ' - ' + line + ':' + column;
445
450
  }
@@ -459,6 +464,7 @@ return /******/ (function(modules) { // webpackBootstrap
459
464
  try {
460
465
  if (loc) {
461
466
  this.lineNumber = line;
467
+ this.endLineNumber = endLineNumber;
462
468
 
463
469
  // Work around issue under safari where we can't directly set the column value
464
470
  /* istanbul ignore next */
@@ -467,8 +473,13 @@ return /******/ (function(modules) { // webpackBootstrap
467
473
  value: column,
468
474
  enumerable: true
469
475
  });
476
+ Object.defineProperty(this, 'endColumn', {
477
+ value: endColumn,
478
+ enumerable: true
479
+ });
470
480
  } else {
471
481
  this.column = column;
482
+ this.endColumn = endColumn;
472
483
  }
473
484
  }
474
485
  } catch (nop) {
@@ -758,12 +769,21 @@ return /******/ (function(modules) { // webpackBootstrap
758
769
 
759
770
  'use strict';
760
771
 
772
+ var _interopRequireDefault = __webpack_require__(2)['default'];
773
+
761
774
  exports.__esModule = true;
762
775
 
763
776
  var _utils = __webpack_require__(4);
764
777
 
778
+ var _exception = __webpack_require__(5);
779
+
780
+ var _exception2 = _interopRequireDefault(_exception);
781
+
765
782
  exports['default'] = function (instance) {
766
783
  instance.registerHelper('if', function (conditional, options) {
784
+ if (arguments.length != 2) {
785
+ throw new _exception2['default']('#if requires exactly one argument');
786
+ }
767
787
  if (_utils.isFunction(conditional)) {
768
788
  conditional = conditional.call(this);
769
789
  }
@@ -779,6 +799,9 @@ return /******/ (function(modules) { // webpackBootstrap
779
799
  });
780
800
 
781
801
  instance.registerHelper('unless', function (conditional, options) {
802
+ if (arguments.length != 2) {
803
+ throw new _exception2['default']('#unless requires exactly one argument');
804
+ }
782
805
  return instance.helpers['if'].call(this, conditional, { fn: options.inverse, inverse: options.fn, hash: options.hash });
783
806
  });
784
807
  };
@@ -843,12 +866,21 @@ return /******/ (function(modules) { // webpackBootstrap
843
866
 
844
867
  'use strict';
845
868
 
869
+ var _interopRequireDefault = __webpack_require__(2)['default'];
870
+
846
871
  exports.__esModule = true;
847
872
 
848
873
  var _utils = __webpack_require__(4);
849
874
 
875
+ var _exception = __webpack_require__(5);
876
+
877
+ var _exception2 = _interopRequireDefault(_exception);
878
+
850
879
  exports['default'] = function (instance) {
851
880
  instance.registerHelper('with', function (context, options) {
881
+ if (arguments.length != 2) {
882
+ throw new _exception2['default']('#with requires exactly one argument');
883
+ }
852
884
  if (_utils.isFunction(context)) {
853
885
  context = context.call(this);
854
886
  }
@@ -1102,9 +1134,9 @@ return /******/ (function(modules) { // webpackBootstrap
1102
1134
 
1103
1135
  // Just add water
1104
1136
  var container = {
1105
- strict: function strict(obj, name) {
1106
- if (!(name in obj)) {
1107
- throw new _exception2['default']('"' + name + '" not defined in ' + obj);
1137
+ strict: function strict(obj, name, loc) {
1138
+ if (!obj || !(name in obj)) {
1139
+ throw new _exception2['default']('"' + name + '" not defined in ' + obj, { loc: loc });
1108
1140
  }
1109
1141
  return obj[name];
1110
1142
  },
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: handlebars-source
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.4.5
4
+ version: 4.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yehuda Katz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-20 00:00:00.000000000 Z
11
+ date: 2019-10-28 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Handlebars.js source code wrapper for (pre)compilation gems.
14
14
  email: