handlebars-source 3.0.3 → 3.0.4

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 +3222 -3195
  3. data/handlebars.runtime.js +177 -149
  4. metadata +5 -5
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
 
3
- handlebars v3.0.3
3
+ handlebars v3.0.4
4
4
 
5
5
  Copyright (C) 2011-2014 by Yehuda Katz
6
6
 
@@ -28,7 +28,7 @@ THE SOFTWARE.
28
28
  if(typeof exports === 'object' && typeof module === 'object')
29
29
  module.exports = factory();
30
30
  else if(typeof define === 'function' && define.amd)
31
- define(factory);
31
+ define([], factory);
32
32
  else if(typeof exports === 'object')
33
33
  exports["Handlebars"] = factory();
34
34
  else
@@ -78,48 +78,50 @@ return /******/ (function(modules) { // webpackBootstrap
78
78
  /************************************************************************/
79
79
  /******/ ([
80
80
  /* 0 */
81
- /***/ function(module, exports, __webpack_require__) {
81
+ /***/ (function(module, exports, __webpack_require__) {
82
82
 
83
83
  'use strict';
84
84
 
85
- var _interopRequireWildcard = __webpack_require__(7)['default'];
85
+ var _interopRequireWildcard = __webpack_require__(1)['default'];
86
+
87
+ var _interopRequireDefault = __webpack_require__(2)['default'];
86
88
 
87
89
  exports.__esModule = true;
88
90
 
89
- var _import = __webpack_require__(1);
91
+ var _handlebarsBase = __webpack_require__(3);
90
92
 
91
- var base = _interopRequireWildcard(_import);
93
+ var base = _interopRequireWildcard(_handlebarsBase);
92
94
 
93
95
  // Each of these augment the Handlebars object. No need to setup here.
94
96
  // (This is done to easily share code between commonjs and browse envs)
95
97
 
96
- var _SafeString = __webpack_require__(2);
98
+ var _handlebarsSafeString = __webpack_require__(6);
97
99
 
98
- var _SafeString2 = _interopRequireWildcard(_SafeString);
100
+ var _handlebarsSafeString2 = _interopRequireDefault(_handlebarsSafeString);
99
101
 
100
- var _Exception = __webpack_require__(3);
102
+ var _handlebarsException = __webpack_require__(5);
101
103
 
102
- var _Exception2 = _interopRequireWildcard(_Exception);
104
+ var _handlebarsException2 = _interopRequireDefault(_handlebarsException);
103
105
 
104
- var _import2 = __webpack_require__(4);
106
+ var _handlebarsUtils = __webpack_require__(4);
105
107
 
106
- var Utils = _interopRequireWildcard(_import2);
108
+ var Utils = _interopRequireWildcard(_handlebarsUtils);
107
109
 
108
- var _import3 = __webpack_require__(5);
110
+ var _handlebarsRuntime = __webpack_require__(7);
109
111
 
110
- var runtime = _interopRequireWildcard(_import3);
112
+ var runtime = _interopRequireWildcard(_handlebarsRuntime);
111
113
 
112
- var _noConflict = __webpack_require__(6);
114
+ var _handlebarsNoConflict = __webpack_require__(8);
113
115
 
114
- var _noConflict2 = _interopRequireWildcard(_noConflict);
116
+ var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict);
115
117
 
116
118
  // For compatibility and usage outside of module systems, make the Handlebars object a namespace
117
119
  function create() {
118
120
  var hb = new base.HandlebarsEnvironment();
119
121
 
120
122
  Utils.extend(hb, base);
121
- hb.SafeString = _SafeString2['default'];
122
- hb.Exception = _Exception2['default'];
123
+ hb.SafeString = _handlebarsSafeString2['default'];
124
+ hb.Exception = _handlebarsException2['default'];
123
125
  hb.Utils = Utils;
124
126
  hb.escapeExpression = Utils.escapeExpression;
125
127
 
@@ -134,32 +136,73 @@ return /******/ (function(modules) { // webpackBootstrap
134
136
  var inst = create();
135
137
  inst.create = create;
136
138
 
137
- _noConflict2['default'](inst);
139
+ _handlebarsNoConflict2['default'](inst);
138
140
 
139
141
  inst['default'] = inst;
140
142
 
141
143
  exports['default'] = inst;
142
144
  module.exports = exports['default'];
143
145
 
144
- /***/ },
146
+ /***/ }),
145
147
  /* 1 */
146
- /***/ function(module, exports, __webpack_require__) {
148
+ /***/ (function(module, exports) {
149
+
150
+ "use strict";
151
+
152
+ exports["default"] = function (obj) {
153
+ if (obj && obj.__esModule) {
154
+ return obj;
155
+ } else {
156
+ var newObj = {};
157
+
158
+ if (obj != null) {
159
+ for (var key in obj) {
160
+ if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
161
+ }
162
+ }
163
+
164
+ newObj["default"] = obj;
165
+ return newObj;
166
+ }
167
+ };
168
+
169
+ exports.__esModule = true;
170
+
171
+ /***/ }),
172
+ /* 2 */
173
+ /***/ (function(module, exports) {
174
+
175
+ "use strict";
176
+
177
+ exports["default"] = function (obj) {
178
+ return obj && obj.__esModule ? obj : {
179
+ "default": obj
180
+ };
181
+ };
182
+
183
+ exports.__esModule = true;
184
+
185
+ /***/ }),
186
+ /* 3 */
187
+ /***/ (function(module, exports, __webpack_require__) {
147
188
 
148
189
  'use strict';
149
190
 
150
- var _interopRequireWildcard = __webpack_require__(7)['default'];
191
+ var _interopRequireWildcard = __webpack_require__(1)['default'];
192
+
193
+ var _interopRequireDefault = __webpack_require__(2)['default'];
151
194
 
152
195
  exports.__esModule = true;
153
196
  exports.HandlebarsEnvironment = HandlebarsEnvironment;
154
197
  exports.createFrame = createFrame;
155
198
 
156
- var _import = __webpack_require__(4);
199
+ var _utils = __webpack_require__(4);
157
200
 
158
- var Utils = _interopRequireWildcard(_import);
201
+ var Utils = _interopRequireWildcard(_utils);
159
202
 
160
- var _Exception = __webpack_require__(3);
203
+ var _exception = __webpack_require__(5);
161
204
 
162
- var _Exception2 = _interopRequireWildcard(_Exception);
205
+ var _exception2 = _interopRequireDefault(_exception);
163
206
 
164
207
  var VERSION = '3.0.1';
165
208
  exports.VERSION = VERSION;
@@ -197,7 +240,7 @@ return /******/ (function(modules) { // webpackBootstrap
197
240
  registerHelper: function registerHelper(name, fn) {
198
241
  if (toString.call(name) === objectType) {
199
242
  if (fn) {
200
- throw new _Exception2['default']('Arg not supported with multiple helpers');
243
+ throw new _exception2['default']('Arg not supported with multiple helpers');
201
244
  }
202
245
  Utils.extend(this.helpers, name);
203
246
  } else {
@@ -213,7 +256,7 @@ return /******/ (function(modules) { // webpackBootstrap
213
256
  Utils.extend(this.partials, name);
214
257
  } else {
215
258
  if (typeof partial === 'undefined') {
216
- throw new _Exception2['default']('Attempting to register a partial as undefined');
259
+ throw new _exception2['default']('Attempting to register a partial as undefined');
217
260
  }
218
261
  this.partials[name] = partial;
219
262
  }
@@ -224,13 +267,13 @@ return /******/ (function(modules) { // webpackBootstrap
224
267
  };
225
268
 
226
269
  function registerDefaultHelpers(instance) {
227
- instance.registerHelper('helperMissing', function () {
270
+ instance.registerHelper('helperMissing', function () /* [args, ]options */{
228
271
  if (arguments.length === 1) {
229
272
  // A missing field in a {{foo}} constuct.
230
273
  return undefined;
231
274
  } else {
232
275
  // Someone is actually trying to call something, blow up.
233
- throw new _Exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"');
276
+ throw new _exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"');
234
277
  }
235
278
  });
236
279
 
@@ -265,7 +308,7 @@ return /******/ (function(modules) { // webpackBootstrap
265
308
 
266
309
  instance.registerHelper('each', function (context, options) {
267
310
  if (!options) {
268
- throw new _Exception2['default']('Must pass iterator to #each');
311
+ throw new _exception2['default']('Must pass iterator to #each');
269
312
  }
270
313
 
271
314
  var fn = options.fn,
@@ -417,80 +460,14 @@ return /******/ (function(modules) { // webpackBootstrap
417
460
  return frame;
418
461
  }
419
462
 
420
- /* [args, ]options */
421
-
422
- /***/ },
423
- /* 2 */
424
- /***/ function(module, exports, __webpack_require__) {
425
-
426
- 'use strict';
427
-
428
- exports.__esModule = true;
429
- // Build out our basic SafeString type
430
- function SafeString(string) {
431
- this.string = string;
432
- }
433
-
434
- SafeString.prototype.toString = SafeString.prototype.toHTML = function () {
435
- return '' + this.string;
436
- };
437
-
438
- exports['default'] = SafeString;
439
- module.exports = exports['default'];
440
-
441
- /***/ },
442
- /* 3 */
443
- /***/ function(module, exports, __webpack_require__) {
444
-
445
- 'use strict';
446
-
447
- exports.__esModule = true;
448
-
449
- var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];
450
-
451
- function Exception(message, node) {
452
- var loc = node && node.loc,
453
- line = undefined,
454
- column = undefined;
455
- if (loc) {
456
- line = loc.start.line;
457
- column = loc.start.column;
458
-
459
- message += ' - ' + line + ':' + column;
460
- }
461
-
462
- var tmp = Error.prototype.constructor.call(this, message);
463
-
464
- // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
465
- for (var idx = 0; idx < errorProps.length; idx++) {
466
- this[errorProps[idx]] = tmp[errorProps[idx]];
467
- }
468
-
469
- if (Error.captureStackTrace) {
470
- Error.captureStackTrace(this, Exception);
471
- }
472
-
473
- if (loc) {
474
- this.lineNumber = line;
475
- this.column = column;
476
- }
477
- }
478
-
479
- Exception.prototype = new Error();
480
-
481
- exports['default'] = Exception;
482
- module.exports = exports['default'];
483
-
484
- /***/ },
463
+ /***/ }),
485
464
  /* 4 */
486
- /***/ function(module, exports, __webpack_require__) {
465
+ /***/ (function(module, exports) {
487
466
 
488
467
  'use strict';
489
468
 
490
469
  exports.__esModule = true;
491
470
  exports.extend = extend;
492
-
493
- // Older IE versions do not directly support indexOf so we must implement our own, sadly.
494
471
  exports.indexOf = indexOf;
495
472
  exports.escapeExpression = escapeExpression;
496
473
  exports.isEmpty = isEmpty;
@@ -501,12 +478,13 @@ return /******/ (function(modules) { // webpackBootstrap
501
478
  '<': '&lt;',
502
479
  '>': '&gt;',
503
480
  '"': '&quot;',
504
- '\'': '&#x27;',
505
- '`': '&#x60;'
481
+ "'": '&#x27;',
482
+ '`': '&#x60;',
483
+ '=': '&#x3D;'
506
484
  };
507
485
 
508
- var badChars = /[&<>"'`]/g,
509
- possible = /[&<>"'`]/;
486
+ var badChars = /[&<>"'`=]/g,
487
+ possible = /[&<>"'`=]/;
510
488
 
511
489
  function escapeChar(chr) {
512
490
  return escape[chr];
@@ -547,7 +525,10 @@ return /******/ (function(modules) { // webpackBootstrap
547
525
  /* istanbul ignore next */
548
526
  var isArray = Array.isArray || function (value) {
549
527
  return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false;
550
- };exports.isArray = isArray;
528
+ };
529
+
530
+ exports.isArray = isArray;
531
+ // Older IE versions do not directly support indexOf so we must implement our own, sadly.
551
532
 
552
533
  function indexOf(array, value) {
553
534
  for (var i = 0, len = array.length; i < len; i++) {
@@ -600,47 +581,108 @@ return /******/ (function(modules) { // webpackBootstrap
600
581
  return (contextPath ? contextPath + '.' : '') + id;
601
582
  }
602
583
 
603
- /***/ },
584
+ /***/ }),
604
585
  /* 5 */
605
- /***/ function(module, exports, __webpack_require__) {
586
+ /***/ (function(module, exports) {
606
587
 
607
588
  'use strict';
608
589
 
609
- var _interopRequireWildcard = __webpack_require__(7)['default'];
590
+ exports.__esModule = true;
591
+
592
+ var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];
593
+
594
+ function Exception(message, node) {
595
+ var loc = node && node.loc,
596
+ line = undefined,
597
+ column = undefined;
598
+ if (loc) {
599
+ line = loc.start.line;
600
+ column = loc.start.column;
601
+
602
+ message += ' - ' + line + ':' + column;
603
+ }
604
+
605
+ var tmp = Error.prototype.constructor.call(this, message);
606
+
607
+ // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
608
+ for (var idx = 0; idx < errorProps.length; idx++) {
609
+ this[errorProps[idx]] = tmp[errorProps[idx]];
610
+ }
611
+
612
+ if (Error.captureStackTrace) {
613
+ Error.captureStackTrace(this, Exception);
614
+ }
615
+
616
+ if (loc) {
617
+ this.lineNumber = line;
618
+ this.column = column;
619
+ }
620
+ }
621
+
622
+ Exception.prototype = new Error();
623
+
624
+ exports['default'] = Exception;
625
+ module.exports = exports['default'];
626
+
627
+ /***/ }),
628
+ /* 6 */
629
+ /***/ (function(module, exports) {
630
+
631
+ // Build out our basic SafeString type
632
+ 'use strict';
610
633
 
611
634
  exports.__esModule = true;
612
- exports.checkRevision = checkRevision;
635
+ function SafeString(string) {
636
+ this.string = string;
637
+ }
638
+
639
+ SafeString.prototype.toString = SafeString.prototype.toHTML = function () {
640
+ return '' + this.string;
641
+ };
613
642
 
614
- // TODO: Remove this line and break up compilePartial
643
+ exports['default'] = SafeString;
644
+ module.exports = exports['default'];
645
+
646
+ /***/ }),
647
+ /* 7 */
648
+ /***/ (function(module, exports, __webpack_require__) {
615
649
 
650
+ 'use strict';
651
+
652
+ var _interopRequireWildcard = __webpack_require__(1)['default'];
653
+
654
+ var _interopRequireDefault = __webpack_require__(2)['default'];
655
+
656
+ exports.__esModule = true;
657
+ exports.checkRevision = checkRevision;
616
658
  exports.template = template;
617
659
  exports.wrapProgram = wrapProgram;
618
660
  exports.resolvePartial = resolvePartial;
619
661
  exports.invokePartial = invokePartial;
620
662
  exports.noop = noop;
621
663
 
622
- var _import = __webpack_require__(4);
664
+ var _utils = __webpack_require__(4);
623
665
 
624
- var Utils = _interopRequireWildcard(_import);
666
+ var Utils = _interopRequireWildcard(_utils);
625
667
 
626
- var _Exception = __webpack_require__(3);
668
+ var _exception = __webpack_require__(5);
627
669
 
628
- var _Exception2 = _interopRequireWildcard(_Exception);
670
+ var _exception2 = _interopRequireDefault(_exception);
629
671
 
630
- var _COMPILER_REVISION$REVISION_CHANGES$createFrame = __webpack_require__(1);
672
+ var _base = __webpack_require__(3);
631
673
 
632
674
  function checkRevision(compilerInfo) {
633
675
  var compilerRevision = compilerInfo && compilerInfo[0] || 1,
634
- currentRevision = _COMPILER_REVISION$REVISION_CHANGES$createFrame.COMPILER_REVISION;
676
+ currentRevision = _base.COMPILER_REVISION;
635
677
 
636
678
  if (compilerRevision !== currentRevision) {
637
679
  if (compilerRevision < currentRevision) {
638
- var runtimeVersions = _COMPILER_REVISION$REVISION_CHANGES$createFrame.REVISION_CHANGES[currentRevision],
639
- compilerVersions = _COMPILER_REVISION$REVISION_CHANGES$createFrame.REVISION_CHANGES[compilerRevision];
640
- 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 + ').');
680
+ var runtimeVersions = _base.REVISION_CHANGES[currentRevision],
681
+ compilerVersions = _base.REVISION_CHANGES[compilerRevision];
682
+ 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 + ').');
641
683
  } else {
642
684
  // Use the embedded version info since the runtime doesn't know about this revision yet
643
- 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] + ').');
685
+ 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] + ').');
644
686
  }
645
687
  }
646
688
  }
@@ -648,10 +690,10 @@ return /******/ (function(modules) { // webpackBootstrap
648
690
  function template(templateSpec, env) {
649
691
  /* istanbul ignore next */
650
692
  if (!env) {
651
- throw new _Exception2['default']('No environment passed to template');
693
+ throw new _exception2['default']('No environment passed to template');
652
694
  }
653
695
  if (!templateSpec || !templateSpec.main) {
654
- throw new _Exception2['default']('Unknown template object: ' + typeof templateSpec);
696
+ throw new _exception2['default']('Unknown template object: ' + typeof templateSpec);
655
697
  }
656
698
 
657
699
  // Note: Using env.VM references rather than local var references throughout this section to allow
@@ -684,7 +726,7 @@ return /******/ (function(modules) { // webpackBootstrap
684
726
  }
685
727
  return result;
686
728
  } else {
687
- throw new _Exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode');
729
+ throw new _exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode');
688
730
  }
689
731
  }
690
732
 
@@ -692,7 +734,7 @@ return /******/ (function(modules) { // webpackBootstrap
692
734
  var container = {
693
735
  strict: function strict(obj, name) {
694
736
  if (!(name in obj)) {
695
- throw new _Exception2['default']('"' + name + '" not defined in ' + obj);
737
+ throw new _exception2['default']('"' + name + '" not defined in ' + obj);
696
738
  }
697
739
  return obj[name];
698
740
  },
@@ -748,7 +790,7 @@ return /******/ (function(modules) { // webpackBootstrap
748
790
  };
749
791
 
750
792
  function ret(context) {
751
- var options = arguments[1] === undefined ? {} : arguments[1];
793
+ var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
752
794
 
753
795
  var data = options.data;
754
796
 
@@ -781,10 +823,10 @@ return /******/ (function(modules) { // webpackBootstrap
781
823
 
782
824
  ret._child = function (i, data, blockParams, depths) {
783
825
  if (templateSpec.useBlockParams && !blockParams) {
784
- throw new _Exception2['default']('must pass block params');
826
+ throw new _exception2['default']('must pass block params');
785
827
  }
786
828
  if (templateSpec.useDepths && !depths) {
787
- throw new _Exception2['default']('must pass parent depths');
829
+ throw new _exception2['default']('must pass parent depths');
788
830
  }
789
831
 
790
832
  return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths);
@@ -794,7 +836,7 @@ return /******/ (function(modules) { // webpackBootstrap
794
836
 
795
837
  function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) {
796
838
  function prog(context) {
797
- var options = arguments[1] === undefined ? {} : arguments[1];
839
+ var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
798
840
 
799
841
  return fn.call(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), depths && [context].concat(depths));
800
842
  }
@@ -819,7 +861,7 @@ return /******/ (function(modules) { // webpackBootstrap
819
861
  options.partial = true;
820
862
 
821
863
  if (partial === undefined) {
822
- throw new _Exception2['default']('The partial ' + options.name + ' could not be found');
864
+ throw new _exception2['default']('The partial ' + options.name + ' could not be found');
823
865
  } else if (partial instanceof Function) {
824
866
  return partial(context, options);
825
867
  }
@@ -831,20 +873,20 @@ return /******/ (function(modules) { // webpackBootstrap
831
873
 
832
874
  function initData(context, data) {
833
875
  if (!data || !('root' in data)) {
834
- data = data ? _COMPILER_REVISION$REVISION_CHANGES$createFrame.createFrame(data) : {};
876
+ data = data ? _base.createFrame(data) : {};
835
877
  data.root = context;
836
878
  }
837
879
  return data;
838
880
  }
839
881
 
840
- /***/ },
841
- /* 6 */
842
- /***/ function(module, exports, __webpack_require__) {
882
+ /***/ }),
883
+ /* 8 */
884
+ /***/ (function(module, exports) {
843
885
 
844
- /* WEBPACK VAR INJECTION */(function(global) {'use strict';
886
+ /* WEBPACK VAR INJECTION */(function(global) {/*global window */
887
+ 'use strict';
845
888
 
846
889
  exports.__esModule = true;
847
- /*global window */
848
890
 
849
891
  exports['default'] = function (Handlebars) {
850
892
  /* istanbul ignore next */
@@ -861,21 +903,7 @@ return /******/ (function(modules) { // webpackBootstrap
861
903
  module.exports = exports['default'];
862
904
  /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
863
905
 
864
- /***/ },
865
- /* 7 */
866
- /***/ function(module, exports, __webpack_require__) {
867
-
868
- "use strict";
869
-
870
- exports["default"] = function (obj) {
871
- return obj && obj.__esModule ? obj : {
872
- "default": obj
873
- };
874
- };
875
-
876
- exports.__esModule = true;
877
-
878
- /***/ }
906
+ /***/ })
879
907
  /******/ ])
880
908
  });
881
909
  ;