Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure props.url is immutable #4352

Merged
merged 3 commits into from
May 12, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions lib/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,20 @@ const warnUrl = execOnce(() => {
})

export function createUrl (router) {
// This is to make sure we don't references the router object at call time
const {pathname, asPath, query} = router
return {
get query () {
warnUrl()
return router.query
return query
},
get pathname () {
warnUrl()
return router.pathname
return pathname
},
get asPath () {
warnUrl()
return router.asPath
return asPath
},
back: () => {
warnUrl()
Expand Down