Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

Commit

Permalink
Bug 1089349 - Use selector name in resolver's error message. r=gandalf
Browse files Browse the repository at this point in the history
  • Loading branch information
stasm committed Oct 28, 2014
1 parent 370925c commit aa37c4d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/l20n/resolver.js
Expand Up @@ -162,9 +162,10 @@ function interpolate(ctxdata, env, arr) {
}

function resolveSelector(ctxdata, env, expr, index) {
var selector = resolveIdentifier(ctxdata, env, index[0].v);
var selectorName = index[0].v;
var selector = resolveIdentifier(ctxdata, env, selectorName);
if (selector === undefined) {
throw new L10nError('Unknown selector: ' + index[0].v);
throw new L10nError('Unknown selector: ' + selectorName);
}

if (typeof selector !== 'function') {
Expand All @@ -174,7 +175,7 @@ function resolveSelector(ctxdata, env, expr, index) {

var argLength = index.length - 1;
if (selector.length !== argLength) {
throw new L10nError('Macro ' + index[0] + ' expects ' +
throw new L10nError('Macro ' + selectorName + ' expects ' +
selector.length + ' argument(s), yet ' + argLength +
' given');
}
Expand Down

0 comments on commit aa37c4d

Please sign in to comment.