Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ejs

Package Overview
Dependencies
Maintainers
0
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ejs - npm Package Compare versions

Comparing version 0.4.2 to 0.4.3

5

ejs.js

@@ -193,2 +193,7 @@

var js = str.substring(i, end);
var n = 0;
while ((n = js.indexOf("\n", n)) > -1) {
n++;
lineno++;
}
if (js[0] == ':') js = filtered(js);

@@ -195,0 +200,0 @@ buf.push(prefix, js, postfix);

0.4.3 / 2011-06-20
==================
* Fixed stacktraces line number when used multiline js expressions [Octave]
0.4.2 / 2011-05-11

@@ -3,0 +8,0 @@ ==================

11

lib/ejs.js

@@ -18,3 +18,3 @@

exports.version = '0.4.2';
exports.version = '0.4.3';

@@ -142,5 +142,8 @@ /**

var start = i;
var end = str.indexOf(close, i);
var js = str.substring(i, end);
var end = str.indexOf(close, i)
, js = str.substring(i, end)
, start = i
, n = 0;
while (~(n = js.indexOf("\n", n))) n++, lineno++;
if (js[0] == ':') js = filtered(js);

@@ -147,0 +150,0 @@ buf.push(prefix, js, postfix);

{
"name": "ejs",
"description": "Embedded JavaScript templates",
"version": "0.4.2",
"version": "0.4.3",
"author": "TJ Holowaychuk <tj@vision-media.ca>",

@@ -6,0 +6,0 @@ "keywords": ["template", "engine", "ejs"],

@@ -244,3 +244,26 @@

}
},
'test useful stack traces multiline': function(assert){
var str = [
"A little somethin'",
"somethin'",
"<% var some = 'pretty';",
" var multiline = 'javascript';",
"%>",
"<% if (name) { %>", // Failing line
" <p><%= name %></p>",
" <p><%= email %></p>",
"<% } %>"
].join("\n");
try {
ejs.render(str)
} catch( err ){
assert.includes(err.message,"name is not defined");
assert.eql(err.name,"ReferenceError");
var lineno = parseInt(err.toString().match(/ejs:(\d+)\n/)[1]);
assert.eql(lineno,6,"Error should been thrown on line 3, was thrown on line "+lineno);
}
}
};
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc