From 87d26c0a71b58a53189088b3dd3ff6150aa445ab Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Sat, 24 Jan 2015 19:04:28 -0800 Subject: [PATCH] Make Template.prototype declaration an object That's what JSDoc supports. --- lib/ejs.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/ejs.js b/lib/ejs.js index d0c4203e..97cbcff1 100644 --- a/lib/ejs.js +++ b/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