diff --git a/docs/route.md b/docs/route.md index c8428b98..ddebe633 100644 --- a/docs/route.md +++ b/docs/route.md @@ -94,12 +94,12 @@ This method also allows you to asynchronously define what component will be rend `routeResolver.onmatch(resolve, args, requestedPath)` -Argument | Type | Description ---------------- | --------------------- | --- -`resolve` | `Function(Component)` | Call this function with a component as the first argument to use it as the route's component -`args` | `Object` | The [routing parameters](#routing-parameters) -`requestedPath` | `String` | The router path requested by the last routing action, including interpolated routing parameter values, but without the prefix. When `onmatch` is called, the resolution for this path is not complete and `m.route.get()` still returns the previous path. -**returns** | | Returns `undefined` +Argument | Type | Description +--------------- | ------------------------ | --- +`resolve` | `Component -> undefined` | Call this function with a component as the first argument to use it as the route's component +`args` | `Object` | The [routing parameters](#routing-parameters) +`requestedPath` | `String` | The router path requested by the last routing action, including interpolated routing parameter values, but without the prefix. When `onmatch` is called, the resolution for this path is not complete and `m.route.get()` still returns the previous path. +**returns** | | Returns `undefined` ##### routeResolver.render diff --git a/test-utils/domMock.js b/test-utils/domMock.js index ffbd2a0e..d82118da 100644 --- a/test-utils/domMock.js +++ b/test-utils/domMock.js @@ -86,26 +86,26 @@ module.exports = function() { * @return {string[]} */ function splitDeclList(declList) { - var indices = [], res = [], match + var indices = [], res = [], match - // remove comments, preserving comments in strings. - declList = declList.replace( - /("(?:\\.|[^"\n])*"|'(?:\\.|[^'\n])*')|\/\*[\s\S]*?\*\//g, - function(m, str){ - return str || '' - } - ) - /*eslint-disable no-cond-assign*/ - while (match = declListTokenizer.exec(declList)) { - if (match[0] === ";") indices.push(match.index) - } - /*eslint-enable no-cond-assign*/ - for (var i = indices.length; i--;){ - res.unshift(declList.slice(indices[i] + 1)) - declList = declList.slice(0, indices[i]) - } - res.unshift(declList) - return res + // remove comments, preserving comments in strings. + declList = declList.replace( + /("(?:\\.|[^"\n])*"|'(?:\\.|[^'\n])*')|\/\*[\s\S]*?\*\//g, + function(m, str){ + return str || '' + } + ) + /*eslint-disable no-cond-assign*/ + while (match = declListTokenizer.exec(declList)) { + if (match[0] === ";") indices.push(match.index) + } + /*eslint-enable no-cond-assign*/ + for (var i = indices.length; i--;){ + res.unshift(declList.slice(indices[i] + 1)) + declList = declList.slice(0, indices[i]) + } + res.unshift(declList) + return res } var activeElement