]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
fix(view): correctly freez route, matched non enumerable
authorEduardo San Martin Morote <posva13@gmail.com>
Fri, 7 Jun 2019 08:55:54 +0000 (10:55 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Fri, 7 Jun 2019 08:55:54 +0000 (10:55 +0200)
src/router.ts

index a474513bd6b5bcf26ad4826470f9164db3e4859c..ed0d399427c0c9c8b995120f51a6eee4e493ccd2 100644 (file)
@@ -333,6 +333,9 @@ export class Router {
 
   private updateReactiveRoute() {
     if (!this.app) return
-    this.app._route = this.currentRoute
+    // TODO: matched should be non enumerable and the defineProperty here shouldn't be necessary
+    const route = { ...this.currentRoute }
+    Object.defineProperty(route, 'matched', { enumerable: false })
+    this.app._route = Object.freeze(route)
   }
 }