Removed eval

closes #491
This commit is contained in:
Jimmy Wärting
2018-11-14 12:34:32 +01:00
parent 72effade4d
commit be09a02e8c
6 changed files with 15 additions and 26 deletions
+5 -12
View File
@@ -11,18 +11,11 @@
// The one and only way of getting global scope in all environments
// https://stackoverflow.com/q/3277182/1008999
var _global = (function () {
// some use content security policy to disable eval
try {
return Function('return this')() || (42, eval)('this')
} catch (e) {
// every global should have circular reference
// used for checking if someone writes var window = {}; var self = {}
return typeof window === 'object' && window.window === window ? window
: typeof self === 'object' && self.self === self ? self
: typeof global === 'object' && global.global === global ? global : this
}
})()
var _global = typeof window === 'object' && window.window === window
? window : typeof self === 'object' && self.self === self
? self : typeof global === 'object' && global.global === global
? global
: this
function bom (blob, opts) {
if (typeof opts === 'undefined') opts = { autoBom: false }