From: Eduardo San Martin Morote Date: Thu, 11 Mar 2021 15:27:03 +0000 (+0100) Subject: refactor(guards): remove bind usage X-Git-Tag: v4.0.5~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a6770dd58ae775b5faf4b76bd5a06ce4262617cf;p=thirdparty%2Fvuejs%2Frouter.git refactor(guards): remove bind usage Sorry Ben... 😅 --- diff --git a/src/router.ts b/src/router.ts index d2c421a7..14158f6d 100644 --- a/src/router.ts +++ b/src/router.ts @@ -1167,14 +1167,14 @@ function extractChangingRecords( for (let i = 0; i < len; i++) { const recordFrom = from.matched[i] if (recordFrom) { - if (to.matched.find(isSameRouteRecord.bind(null, recordFrom))) + if (to.matched.find(record => isSameRouteRecord(record, recordFrom))) updatingRecords.push(recordFrom) else leavingRecords.push(recordFrom) } const recordTo = to.matched[i] if (recordTo) { // the type doesn't matter because we are comparing per reference - if (!from.matched.find(isSameRouteRecord.bind(null, recordTo))) { + if (!from.matched.find(record => isSameRouteRecord(record, recordTo))) { enteringRecords.push(recordTo) } }