mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 09:57:02 +01:00
Merge pull request #465 from MetaMask/i447
inpage - add try/catch to cleanContextForImports
This commit is contained in:
commit
a174ec7fc1
@ -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.')
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user