8000 Update ejs.js by RohitPaul0007 · Pull Request #263 · tj/ejs · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000

Update ejs.js #263

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

8000
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions lib/ejs.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Module dependencies.
*/

var utils = require('./utils')
let utils = require('./utils')
, path = require('path')
, dirname = path.dirname
, extname = path.extname
Expand All @@ -22,15 +22,15 @@ var utils = require('./utils')
* @type Object
*/

var filters = exports.filters = require('./filters');
let filters = exports.filters = require('./filters');

/**
* Intermediate js cache.
*
* @type Object
*/

var cache = {};
let cache = {};

/**
* Clear intermediate js cache.
Expand All @@ -52,7 +52,7 @@ exports.clearCache = function(){

function filtered(js) {
return js.substr(1).split('|').reduce(function(js, filter){
var parts = filter.split(':')
let parts = filter.split(':')
, name = parts.shift()
, args = parts.join(':') || '';
if (args) args = ', ' + args;
Expand All @@ -72,13 +72,13 @@ function filtered(js) {
*/

function rethrow(err, str, filename, lineno){
var lines = str.split('\n')
let lines = str.split('\n')
, start = Math.max(lineno - 3, 0)
, end = Math.min(lines.length, lineno + 3);

// Error context
var context = lines.slice(start, end).map(function(line, i){
var curr = i + start + 1;
let context = lines.slice(start, end).map(function(line, i){
let curr = i + start + 1;
return (curr == lineno ? ' >> ' : ' ')
+ curr
+ '| '
Expand All @@ -103,8 +103,8 @@ function rethrow(err, str, filename, lineno){
* @api public
*/

var parse = exports.parse = function(str, options){
var options = options || {}
let parse = exports.parse = function(str, options){
let options = options || {}
, open = options.open || exports.open || '<%'
, close = options.close || exports.close || '%>'
, filename = options.filename
Expand All @@ -115,9 +115,9 @@ var parse = exports.parse = function(str, options){
if (false !== options._with) buf += '\nwith (locals || {}) { (function(){ ';
buf += '\n buf.push(\'';

var lineno = 1;
let lineno = 1;

var consumeEOL = false;
let consumeEOL = false;
for (var i = 0, len = str.length; i < len; ++i) {
var stri = str[i];
if (str.slice(i, open.length + i) == open) {
Expand Down
0