visionmedia / page.js

Micro client-side router inspired by the Express router
http://visionmedia.github.com/page.js
7.67k stars 687 forks source link

Fix _page typo in Route constructor #560

Closed nathancahill closed 4 years ago

nathancahill commented 4 years ago

var _page can be page (passed in as an argument) or globalPage. The opts are pulled from the first one instead of either one, this PR corrects that.

coveralls commented 4 years ago

Coverage Status

Coverage increased (+0.4%) to 92.975% when pulling d46ea60e335aa5cab76e9c9883ce102b75ee6d15 on nathancahill:master into 94138d1f3105f9fdb3424f9c0870c1fb90adcd1a on visionmedia:master.

matthewp commented 4 years ago

What was broken before this fix?

nathancahill commented 4 years ago

Calling new page.Route without the 3rd parameter is broken. It should default to globalPage

matthewp commented 4 years ago

Can you add a test?

nathancahill commented 4 years ago

Added a test. Before this PR, it fails:

  1) Route Can create Route:
     TypeError: Cannot read property '_strict' of undefined
      at new Route (index.js:754:39)
      at Context.<anonymous> (test/tests.js:801:15)
      at processImmediate (internal/timers.js:439:21)
matthewp commented 4 years ago

Thanks!