Skip to content

Commit be09a02

Browse files
committed
Removed eval
closes #491
1 parent 72effad commit be09a02

File tree

6 files changed

+15
-26
lines changed

6 files changed

+15
-26
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [2.0.0] - 2018-10-17
8+
9+
- Removed eval to resolve CSP [#465]
10+
711
## [2.0.0-rc.4] - 2018-10-17
812

913
- Don’t throw on module.exports
1014

1115
## [2.0.0-rc.3] - 2018-09-27
1216

13-
- switch export method
17+
- Switch export method
1418

1519
## [2.0.0-rc.2] - 2018-09-26
1620

@@ -48,3 +52,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4852
[#465]: https://github.com/eligrey/FileSaver.js/issues/465
4953
[#469]: https://github.com/eligrey/FileSaver.js/issues/469
5054
[#470]: https://github.com/eligrey/FileSaver.js/issues/470
55+
[#491]: https://github.com/eligrey/FileSaver.js/issues/491

dist/FileSaver.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,7 @@
2424
*/
2525
// The one and only way of getting global scope in all environments
2626
// https://stackoverflow.com/q/3277182/1008999
27-
var _global = function () {
28-
// some use content security policy to disable eval
29-
try {
30-
return Function('return this')() || (42, eval)('this');
31-
} catch (e) {
32-
// every global should have circular reference
33-
// used for checking if someone writes var window = {}; var self = {}
34-
return typeof window === 'object' && window.window === window ? window : typeof self === 'object' && self.self === self ? self : typeof global === 'object' && global.global === global ? global : this;
35-
}
36-
}();
27+
var _global = typeof window === 'object' && window.window === window ? window : typeof self === 'object' && self.self === self ? self : typeof global === 'object' && global.global === global ? global : void 0;
3728

3829
function bom(blob, opts) {
3930
if (typeof opts === 'undefined') opts = {

dist/FileSaver.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)