handlebars-source 1.2.1 → 1.3.0
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.
Potentially problematic release.
This version of handlebars-source might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/handlebars.js +1292 -1157
- data/handlebars.runtime.js +20 -8
- metadata +2 -2
data/handlebars.runtime.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/*!
|
2
2
|
|
3
|
-
handlebars v1.
|
3
|
+
handlebars v1.3.0
|
4
4
|
|
5
5
|
Copyright (C) 2011 by Yehuda Katz
|
6
6
|
|
@@ -132,13 +132,25 @@ var __module4__ = (function() {
|
|
132
132
|
|
133
133
|
var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];
|
134
134
|
|
135
|
-
function Exception(
|
136
|
-
var
|
135
|
+
function Exception(message, node) {
|
136
|
+
var line;
|
137
|
+
if (node && node.firstLine) {
|
138
|
+
line = node.firstLine;
|
139
|
+
|
140
|
+
message += ' - ' + line + ':' + node.firstColumn;
|
141
|
+
}
|
142
|
+
|
143
|
+
var tmp = Error.prototype.constructor.call(this, message);
|
137
144
|
|
138
145
|
// Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
|
139
146
|
for (var idx = 0; idx < errorProps.length; idx++) {
|
140
147
|
this[errorProps[idx]] = tmp[errorProps[idx]];
|
141
148
|
}
|
149
|
+
|
150
|
+
if (line) {
|
151
|
+
this.lineNumber = line;
|
152
|
+
this.column = node.firstColumn;
|
153
|
+
}
|
142
154
|
}
|
143
155
|
|
144
156
|
Exception.prototype = new Error();
|
@@ -154,7 +166,7 @@ var __module1__ = (function(__dependency1__, __dependency2__) {
|
|
154
166
|
var Utils = __dependency1__;
|
155
167
|
var Exception = __dependency2__;
|
156
168
|
|
157
|
-
var VERSION = "1.
|
169
|
+
var VERSION = "1.3.0";
|
158
170
|
__exports__.VERSION = VERSION;var COMPILER_REVISION = 4;
|
159
171
|
__exports__.COMPILER_REVISION = COMPILER_REVISION;
|
160
172
|
var REVISION_CHANGES = {
|
@@ -206,7 +218,7 @@ var __module1__ = (function(__dependency1__, __dependency2__) {
|
|
206
218
|
if(arguments.length === 2) {
|
207
219
|
return undefined;
|
208
220
|
} else {
|
209
|
-
throw new
|
221
|
+
throw new Exception("Missing helper: '" + arg + "'");
|
210
222
|
}
|
211
223
|
});
|
212
224
|
|
@@ -350,11 +362,11 @@ var __module5__ = (function(__dependency1__, __dependency2__, __dependency3__) {
|
|
350
362
|
if (compilerRevision < currentRevision) {
|
351
363
|
var runtimeVersions = REVISION_CHANGES[currentRevision],
|
352
364
|
compilerVersions = REVISION_CHANGES[compilerRevision];
|
353
|
-
throw new
|
365
|
+
throw new Exception("Template was precompiled with an older version of Handlebars than the current runtime. "+
|
354
366
|
"Please update your precompiler to a newer version ("+runtimeVersions+") or downgrade your runtime to an older version ("+compilerVersions+").");
|
355
367
|
} else {
|
356
368
|
// Use the embedded version info since the runtime doesn't know about this revision yet
|
357
|
-
throw new
|
369
|
+
throw new Exception("Template was precompiled with a newer version of Handlebars than the current runtime. "+
|
358
370
|
"Please update your runtime to a newer version ("+compilerInfo[1]+").");
|
359
371
|
}
|
360
372
|
}
|
@@ -364,7 +376,7 @@ var __module5__ = (function(__dependency1__, __dependency2__, __dependency3__) {
|
|
364
376
|
|
365
377
|
function template(templateSpec, env) {
|
366
378
|
if (!env) {
|
367
|
-
throw new
|
379
|
+
throw new Exception("No environment passed to template");
|
368
380
|
}
|
369
381
|
|
370
382
|
// Note: Using env.VM references rather than local var references throughout this section to allow
|
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: 1.
|
4
|
+
version: 1.3.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:
|
11
|
+
date: 2014-01-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Handlebars.js source code wrapper for (pre)compilation gems.
|
14
14
|
email:
|