Skip to content

Commit

Permalink
fix(trace): Fall back to console.log if .table is unavailable (IE)
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherthielen committed Sep 14, 2017
1 parent 87943c6 commit c8110fc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"devDependencies": {
"@types/jasmine": "^2.5.47",
"@types/jquery": "^1.10.31",
"@uirouter/publish-scripts": "^1.0.5",
"@uirouter/publish-scripts": "^1.0.7",
"awesome-typescript-loader": "3.0.0-beta.10",
"conventional-changelog": "^1.1.0",
"conventional-changelog-cli": "^1.1.1",
Expand Down
6 changes: 4 additions & 2 deletions src/common/trace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* @module trace
*/ /** for typedoc */
import {parse} from "../common/hof";
import {isNumber} from "../common/predicates";
import {isFunction, isNumber} from "../common/predicates";
import {Transition} from "../transition/transition";
import {ActiveUIView, ViewConfig, ViewContext} from "../view/interface";
import {stringify, functionToString, maxLength, padString} from "./strings";
Expand Down Expand Up @@ -64,6 +64,8 @@ function normalizedCat(input: Category|string): string {
return isNumber(input) ? Category[input] : Category[Category[input]];
}

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

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

console.table(mapping);
consoletable(mapping);
}

/** @internalapi called by ui-router code */
Expand Down
10 changes: 1 addition & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
version "1.10.33"
resolved "https://registry.yarnpkg.com/@types/jquery/-/jquery-1.10.33.tgz#6c4c279f8d06839b184950432e880e0a469a64a1"

"@uirouter/publish-scripts@^1.0.5":
"@uirouter/publish-scripts@^1.0.7":
version "1.0.7"
resolved "https://registry.yarnpkg.com/@uirouter/publish-scripts/-/publish-scripts-1.0.7.tgz#99ffd6aeced41e96b92ccb007342eee5d14b0a9a"
dependencies:
Expand Down Expand Up @@ -652,14 +652,6 @@ conventional-changelog-jshint@^0.1.0:
compare-func "^1.3.1"
q "^1.4.1"

conventional-changelog-ui-router-core@^1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/conventional-changelog-ui-router-core/-/conventional-changelog-ui-router-core-1.4.1.tgz#8ef76e7960458d9be2539fe673a4b6c853b9dbf3"
dependencies:
compare-func "^1.3.1"
github-url-from-git "^1.4.0"
q "^1.4.1"

conventional-changelog-ui-router-core@^1.4.2:
version "1.4.2"
resolved "https://registry.yarnpkg.com/conventional-changelog-ui-router-core/-/conventional-changelog-ui-router-core-1.4.2.tgz#56d5787163f883e25d3e1f573aef563f85411df7"
Expand Down

0 comments on commit c8110fc

Please sign in to comment.