summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2013-10-09 03:21:21 -0700
committerkpdecker <kpdecker@gmail.com>2013-10-09 03:21:21 -0700
commit4d7124f6bfcc3b316c33558840c9e952cca1ce8c (patch)
tree17e6ad1010efec7938dfca56212426ac445e0294 /lib
parentb6c9f85d227aad8ed2db9c04f0eed5a7c7131879 (diff)
downloadhandlebars.js-4d7124f6bfcc3b316c33558840c9e952cca1ce8c.zip
handlebars.js-4d7124f6bfcc3b316c33558840c9e952cca1ce8c.tar.gz
handlebars.js-4d7124f6bfcc3b316c33558840c9e952cca1ce8c.tar.bz2
Remove global Handlebars references
Diffstat (limited to 'lib')
-rw-r--r--lib/handlebars/base.js9
-rw-r--r--lib/handlebars/compiler/ast.js2
2 files changed, 6 insertions, 5 deletions
diff --git a/lib/handlebars/base.js b/lib/handlebars/base.js
index c83144a..a4acef9 100644
--- a/lib/handlebars/base.js
+++ b/lib/handlebars/base.js
@@ -3,8 +3,6 @@
import { extend, isEmpty } from "./utils";
import Exception from "./exception";
-var K = function() { return this; };
-
export var VERSION = "1.0.0";
export var COMPILER_REVISION = 4;
@@ -44,6 +42,9 @@ export function HandlebarsEnvironment(helpers, partials) {
HandlebarsEnvironment.prototype = {
constructor: HandlebarsEnvironment,
+ logger: logger,
+ log: log,
+
registerHelper: function(name, fn, inverse) {
if (toString.call(name) === objectType) {
if (inverse || fn) { throw new Exception('Arg not supported with multiple helpers'); }
@@ -148,7 +149,7 @@ function registerDefaultHelpers(instance) {
instance.registerHelper('log', function(context, options) {
var level = options.data && options.data.level != null ? parseInt(options.data.level, 10) : 1;
- Handlebars.log(level, context);
+ instance.log(level, context);
});
}
@@ -174,6 +175,6 @@ export function log(level, obj) { logger.log(level, obj); }
export var createFrame = function(object) {
var obj = {};
- Handlebars.Utils.extend(obj, object);
+ extend(obj, object);
return obj;
};
diff --git a/lib/handlebars/compiler/ast.js b/lib/handlebars/compiler/ast.js
index e4e8049..336492d 100644
--- a/lib/handlebars/compiler/ast.js
+++ b/lib/handlebars/compiler/ast.js
@@ -71,7 +71,7 @@ export function IdNode(parts) {
original += (parts[i].separator || '') + part;
if (part === ".." || part === "." || part === "this") {
- if (dig.length > 0) { throw new Handlebars.Exception("Invalid path: " + original); }
+ if (dig.length > 0) { throw new Exception("Invalid path: " + original); }
else if (part === "..") { depth++; }
else { this.isScoped = true; }
}