Skip to content

Commit 2647066

Browse files
committed
fixed(common): Ensure debug dump logger works correctly with ES2017 target
Signed-off-by: Tim Deubler <tim.deubler@here.com>
1 parent 00bbb7b commit 2647066

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

packages/common/src/JSUtils.ts

+4-7
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,14 @@ const JSUtils = {
8484

8585
loglevel: 'debug',
8686

87-
dump: (msg: string, loglevel?: string) => {
87+
dump: function(msg: string, loglevel?: string) {
8888
const debug = !!JSUtils.loglevel;
89-
// @ts-ignore
90-
const args = Array.prototype.slice.call(arguments);
91-
let level = args[args.length - 1];
92-
const console = window.console;
93-
89+
const {console} = window;
9490
if (debug && !!console) {
91+
const args = Array.prototype.slice.call(arguments);
92+
let level = args[args.length - 1];
9593
if (level in console) args.pop();
9694
else level = 'log';
97-
9895
// workaround for IE9, in which console.log is not an instance of Function
9996
if (debug === true || debug === level) {
10097
if (Function.prototype.bind && typeof console.log == 'object') {

0 commit comments

Comments
 (0)