Skip to content

Commit c8110fc

Browse files
fix(trace): Fall back to console.log if .table is unavailable (IE)
Closes ui-router/angular#154
1 parent 87943c6 commit c8110fc

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"devDependencies": {
6464
"@types/jasmine": "^2.5.47",
6565
"@types/jquery": "^1.10.31",
66-
"@uirouter/publish-scripts": "^1.0.5",
66+
"@uirouter/publish-scripts": "^1.0.7",
6767
"awesome-typescript-loader": "3.0.0-beta.10",
6868
"conventional-changelog": "^1.1.0",
6969
"conventional-changelog-cli": "^1.1.1",

src/common/trace.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
* @module trace
3535
*/ /** for typedoc */
3636
import {parse} from "../common/hof";
37-
import {isNumber} from "../common/predicates";
37+
import {isFunction, isNumber} from "../common/predicates";
3838
import {Transition} from "../transition/transition";
3939
import {ActiveUIView, ViewConfig, ViewContext} from "../view/interface";
4040
import {stringify, functionToString, maxLength, padString} from "./strings";
@@ -64,6 +64,8 @@ function normalizedCat(input: Category|string): string {
6464
return isNumber(input) ? Category[input] : Category[Category[input]];
6565
}
6666

67+
/** @hidden */
68+
const consoletable = isFunction(console.table) ? console.table.bind(console) : console.log.bind(console);
6769

6870
/**
6971
* Trace categories Enum
@@ -229,7 +231,7 @@ export class Trace {
229231
return { 'ui-view fqn': uiView, 'state: view name': view };
230232
}).sort((a, b) => a['ui-view fqn'].localeCompare(b['ui-view fqn']));
231233

232-
console.table(mapping);
234+
consoletable(mapping);
233235
}
234236

235237
/** @internalapi called by ui-router code */

yarn.lock

+1-9
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
version "1.10.33"
1111
resolved "https://registry.yarnpkg.com/@types/jquery/-/jquery-1.10.33.tgz#6c4c279f8d06839b184950432e880e0a469a64a1"
1212

13-
"@uirouter/publish-scripts@^1.0.5":
13+
"@uirouter/publish-scripts@^1.0.7":
1414
version "1.0.7"
1515
resolved "https://registry.yarnpkg.com/@uirouter/publish-scripts/-/publish-scripts-1.0.7.tgz#99ffd6aeced41e96b92ccb007342eee5d14b0a9a"
1616
dependencies:
@@ -652,14 +652,6 @@ conventional-changelog-jshint@^0.1.0:
652652
compare-func "^1.3.1"
653653
q "^1.4.1"
654654

655-
conventional-changelog-ui-router-core@^1.4.1:
656-
version "1.4.1"
657-
resolved "https://registry.yarnpkg.com/conventional-changelog-ui-router-core/-/conventional-changelog-ui-router-core-1.4.1.tgz#8ef76e7960458d9be2539fe673a4b6c853b9dbf3"
658-
dependencies:
659-
compare-func "^1.3.1"
660-
github-url-from-git "^1.4.0"
661-
q "^1.4.1"
662-
663655
conventional-changelog-ui-router-core@^1.4.2:
664656
version "1.4.2"
665657
resolved "https://registry.yarnpkg.com/conventional-changelog-ui-router-core/-/conventional-changelog-ui-router-core-1.4.2.tgz#56d5787163f883e25d3e1f573aef563f85411df7"

0 commit comments

Comments
 (0)