Skip to content

Commit 4180abe

Browse files
authored
fix: Restore console methods after calling uninstall (#1221)
1 parent df8a9cd commit 4180abe

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

Gruntfile.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@ module.exports = function(grunt) {
8080
});
8181

8282
// Transpile all test scripts
83-
tests.forEach(function (test) {
83+
tests.forEach(function(test) {
8484
var config = {
8585
input: {
8686
input: test
8787
},
8888
output: {
8989
file: path.join('build', path.basename(test)),
90-
name: path.basename(test, '.js'),
90+
name: path.basename(test, '.js')
9191
}
9292
};
9393

@@ -288,18 +288,17 @@ module.exports = function(grunt) {
288288
// Build tasks
289289
grunt.registerTask('_prep', ['gitinfo', 'version']);
290290
grunt.registerTask('build.test', ['_prep', 'rollup:core', 'rollup:tests']);
291-
grunt.registerTask('build.core', ['_prep', 'rollup:core', 'sri:dist']);
291+
grunt.registerTask('build.core', ['_prep', 'rollup:core']);
292292
grunt.registerTask('build.plugins', [
293293
'_prep',
294294
'generate-plugin-combinations',
295295
'rollup:plugins',
296296
'rollup:pluginCombinations',
297-
'sri:dist',
298297
'sri:build'
299298
]);
300299
grunt.registerTask('build', ['build.core', 'build.plugins', 'uglify']);
301300

302-
grunt.registerTask('dist', ['clean', 'build', 'copy:dist']);
301+
grunt.registerTask('dist', ['clean', 'build', 'copy:dist', 'sri:dist']);
303302

304303
// Test tasks
305304
grunt.registerTask('test:ci', ['config:ci', 'build:test']);

src/raven.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ Raven.prototype = {
392392

393393
this._unpatchFunctionToString();
394394
this._restoreBuiltIns();
395+
this._restoreConsole();
395396

396397
Error.stackTraceLimit = this._originalErrorStackTraceLimit;
397398
this._isRavenInstalled = false;
@@ -1383,6 +1384,13 @@ Raven.prototype = {
13831384
}
13841385
},
13851386

1387+
_restoreConsole: function() {
1388+
// eslint-disable-next-line guard-for-in
1389+
for (var method in this._originalConsoleMethods) {
1390+
this._originalConsole[method] = this._originalConsoleMethods[method];
1391+
}
1392+
},
1393+
13861394
_drainPlugins: function() {
13871395
var self = this;
13881396

0 commit comments

Comments
 (0)