Skip to content

add backtrace feature for splat matching#7

Open
dzyhenry wants to merge 1 commit intoMatt-Esch:masterfrom
dzyhenry:backtrace
Open

add backtrace feature for splat matching#7
dzyhenry wants to merge 1 commit intoMatt-Esch:masterfrom
dzyhenry:backtrace

Conversation

@dzyhenry
Copy link

Add backtrace feature for splat matching to support case like follows:

    // when route set like follows
    hash.set('/a/b/c', routeHandlerABC);
    hash.set('/a/b/*', routeHandlerABStar);
   
  // /a/b/c/d could match /a/b/*
   var res = hash.get('/a/b/c/d');
   assert.strictEqual(res.handler, routeHandlerABStar);

var pathSegments = pathname.split('/');

var hash = this._hash;
var parentNode = hash;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it is a rootNode, not a parentNode?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it is a rootNode, not a parentNode?

rootNode is also a parentNode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants