1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 18:00:18 +01:00

inpage - add try/catch to cleanContextForImports

This commit is contained in:
kumavis 2016-07-18 17:57:23 -07:00
parent 5b895c2a22
commit 9101812552

View File

@ -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.')
}
}