mirror of
https://github.com/less/less.js.git
synced 2026-01-24 06:38:05 -05:00
alternative to throwing an object literal.
create a real exception and extend it with the custom properties that less needs to satisfy its error generator. An alternative to the solution proposed in cloudhead/less.js#963
This commit is contained in:
committed by
Luke Page
parent
68297d7e38
commit
fc8393d555
@@ -193,7 +193,10 @@ less.Parser = function Parser(env) {
|
||||
}
|
||||
|
||||
function error(msg, type) {
|
||||
throw { index: i, type: type || 'Syntax', message: msg };
|
||||
var e = new Error(msg)
|
||||
e.index = i
|
||||
e.type = type || 'Syntax'
|
||||
throw e
|
||||
}
|
||||
|
||||
// Same as $(), but don't change the state of the parser,
|
||||
|
||||
Reference in New Issue
Block a user