Initial work on ES6 modules

This commit is contained in:
Yehuda Katz
2013-07-01 13:59:58 -07:00
parent 8e2416dabb
commit 88ee4757e7
15 changed files with 453 additions and 400 deletions
+6 -18
View File
@@ -1,18 +1,12 @@
var compilerbase = require("./base");
import { COMPILER_REVISION, REVISION_CHANGES } from "handlebars/base";
exports.attach = function(Handlebars) {
compilerbase.attach(Handlebars);
// BEGIN(BROWSER)
/*jshint eqnull:true*/
var Literal = function(value) {
function Literal(value) {
this.value = value;
};
var JavaScriptCompiler = Handlebars.JavaScriptCompiler = function() {};
function JavaScriptCompiler() {};
export default JavaScriptCompiler;
JavaScriptCompiler.prototype = {
// PUBLIC API: You can override these methods in a subclass to provide
@@ -162,8 +156,8 @@ JavaScriptCompiler.prototype = {
var source = this.mergeSource();
if (!this.isChild) {
var revision = Handlebars.COMPILER_REVISION,
versions = Handlebars.REVISION_CHANGES[revision];
var revision = COMPILER_REVISION,
versions = REVISION_CHANGES[revision];
source = "this.compilerInfo = ["+revision+",'"+versions+"'];\n"+source;
}
@@ -848,9 +842,3 @@ JavaScriptCompiler.isValidJavaScriptVariableName = function(name) {
}
return false;
};
// END(BROWSER)
return Handlebars;
};