From 9101812552f89439addfa4fbd783ec4bf6b47e0e Mon Sep 17 00:00:00 2001 From: kumavis Date: Mon, 18 Jul 2016 17:57:23 -0700 Subject: [PATCH 1/2] inpage - add try/catch to cleanContextForImports --- app/scripts/inpage.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/scripts/inpage.js b/app/scripts/inpage.js index f5e54cd7b..c2b445bd1 100644 --- a/app/scripts/inpage.js +++ b/app/scripts/inpage.js @@ -53,9 +53,17 @@ var __define function cleanContextForImports () { __define = global.define - delete global.define + try { + delete global.define + } catch (_) { + console.warn('MetaMask - global.define could not be deleted.') + } } function restoreContextAfterImports () { - global.define = __define + try { + global.define = __define + } catch { + console.warn('MetaMask - global.define could not be overwritten.') + } } From b2afa16925227fbb39e30fce8f9f4bca09dec20e Mon Sep 17 00:00:00 2001 From: kumavis Date: Mon, 18 Jul 2016 18:08:29 -0700 Subject: [PATCH 2/2] typo fix --- app/scripts/inpage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/scripts/inpage.js b/app/scripts/inpage.js index c2b445bd1..055235671 100644 --- a/app/scripts/inpage.js +++ b/app/scripts/inpage.js @@ -63,7 +63,7 @@ function cleanContextForImports () { function restoreContextAfterImports () { try { global.define = __define - } catch { + } catch (_) { console.warn('MetaMask - global.define could not be overwritten.') } }