mirror of
https://github.com/CryptKeeperZK/ejs.git
synced 2026-01-09 15:37:57 -05:00
Make Template.prototype declaration an object
That's what JSDoc supports.
This commit is contained in:
22
lib/ejs.js
22
lib/ejs.js
@@ -236,15 +236,15 @@ Template.modes = {
|
||||
, LITERAL: 'literal'
|
||||
};
|
||||
|
||||
Template.prototype = new function () {
|
||||
this.createRegex = function () {
|
||||
Template.prototype = {
|
||||
createRegex: function () {
|
||||
var str = _REGEX_STRING
|
||||
, delim = utils.escapeRegExpChars(this.opts.delimiter);
|
||||
str = str.replace(/%/g, delim);
|
||||
return new RegExp(str);
|
||||
};
|
||||
}
|
||||
|
||||
this.compile = function () {
|
||||
, compile: function () {
|
||||
var src
|
||||
, fn
|
||||
, opts = this.opts
|
||||
@@ -316,9 +316,9 @@ Template.prototype = new function () {
|
||||
return fn(data || {}, escape, include, rethrow);
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
this.generateSource = function () {
|
||||
, generateSource: function () {
|
||||
var self = this
|
||||
, matches = this.parseTemplateText()
|
||||
, d = this.opts.delimiter;
|
||||
@@ -353,9 +353,9 @@ Template.prototype = new function () {
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
this.parseTemplateText = function () {
|
||||
, parseTemplateText: function () {
|
||||
var str = this.templateText
|
||||
, pat = this.regex
|
||||
, result = pat.exec(str)
|
||||
@@ -382,9 +382,9 @@ Template.prototype = new function () {
|
||||
}
|
||||
|
||||
return arr;
|
||||
};
|
||||
}
|
||||
|
||||
this.scanLine = function (line) {
|
||||
, scanLine: function (line) {
|
||||
var self = this
|
||||
, d = this.opts.delimiter
|
||||
, newLineCount = 0;
|
||||
@@ -487,7 +487,7 @@ Template.prototype = new function () {
|
||||
this.currentLine += newLineCount;
|
||||
this.source += ';__line = ' + this.currentLine + ';';
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
// Express support
|
||||
|
||||
Reference in New Issue
Block a user