Skip to content

Commit fdc6d23

Browse files
committed
Fixed issue with IE.
Updated vue to 2.5.13.
1 parent 5791e04 commit fdc6d23

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

Diff for: package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vuejs-logger",
33
"author": "Justin Kames",
4-
"version": "1.3.3",
4+
"version": "1.3.4",
55
"description": "Vuejs-logger, provides customizable logging functionality for Vue.js.",
66
"main": "dist/index.js",
77
"repository": {
@@ -11,8 +11,9 @@
1111
"scripts": {
1212
"test": "istanbul cover _mocha -- --compilers js:babel-core/register -R spec --debug",
1313
"upload-coverage": "codecov -t $CODECOV_TOKEN",
14-
"transpile": "node_modules/babel-cli/bin/babel.js src --out-dir dist && node_modules/uglify-js/bin/uglifyjs dist/logger.js -c -m -o dist/logger.js",
15-
"prepublish": "npm test && npm run transpile"
14+
"build-transpile-uglify": "node_modules/babel-cli/bin/babel.js src --out-dir dist && node_modules/uglify-js/bin/uglifyjs dist/logger.js -c -m -o dist/logger.js",
15+
"build-transpile": "node_modules/babel-cli/bin/babel.js src --out-dir dist && node_modules/uglify-js/bin/uglifyjs dist/logger.js -c -m -o dist/logger.js",
16+
"prepublish": "npm test && npm run build-transpile-uglify"
1617
},
1718
"license": "MIT",
1819
"babel": {
@@ -30,6 +31,6 @@
3031
"istanbul": "1.1.0-alpha.1",
3132
"mocha": "3.4.2",
3233
"uglify": "0.1.5",
33-
"vue": "2.4.1"
34+
"vue": "2.5.13"
3435
}
3536
}

Diff for: src/logger.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ export default (function () {
4040
}
4141

4242
function isValidOptions (options, logLevels) {
43-
4443
if (!(options.logLevel && typeof options.logLevel === 'string' && logLevels.indexOf(options.logLevel) > -1)) {
4544
return false
4645
}
@@ -60,7 +59,6 @@ export default (function () {
6059
}
6160

6261
function install (Vue, options) {
63-
// merge provided options with the default options
6462
options = Object.assign(defaultOptions, options)
6563

6664
if (isValidOptions(options, logLevels)) {
@@ -72,11 +70,13 @@ export default (function () {
7270
}
7371

7472
function getMethodName () {
75-
let stackTrace = Error().stack.split('\n')[3]
73+
let error = {}
74+
try { throw new Error('') } catch (e) { error = e }
75+
let stackTrace = error.stack.split('\n')[3]
7676
if (/ /.test(stackTrace)) {
7777
stackTrace = stackTrace.trim().split(' ')[1]
7878
}
79-
if (stackTrace.includes('.')) {
79+
if (stackTrace && stackTrace.includes('.')) {
8080
stackTrace = stackTrace.split('.')[1]
8181
}
8282
return stackTrace
@@ -89,5 +89,4 @@ export default (function () {
8989
initLoggerInstance,
9090
logLevels
9191
}
92-
})
93-
()
92+
})()

0 commit comments

Comments
 (0)