Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

default handler does not support returning true #3

Closed
rikkertkoppes opened this Issue · 2 comments

2 participants

@rikkertkoppes

current code:

Parser.prototype.defaultHandler = function defaultHandler(h) {
    assert.equal(typeof h, 'function', "a handler should be a function");
    function DEFAULT(token, type, next) {
        next(DEFAULT);
        h.apply(this, arguments);
    }
    this._queue.push(DEFAULT);
    this._haveDefault = true;
};

should be

Parser.prototype.defaultHandler = function defaultHandler(h) {
    assert.equal(typeof h, 'function', "a handler should be a function");
    function DEFAULT(token, type, next) {
        next(DEFAULT);
        return h.apply(this, arguments);
    }
    this._queue.push(DEFAULT);
    this._haveDefault = true;
};

to be able to consume the token again after the default handler

@Floby
Owner

that makes sense. i'll do it right away

@Floby Floby referenced this issue from a commit
@Floby Return expand value from default handler
as shown by @rikkertkoppes in issue #3
close issue #3
bbfb780
@Floby
Owner

fixed in bbfb780

@Floby Floby closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.