Skip to content

Commit 68ece58

Browse files
committed
Fixing non-strict-mode compliant sigma plugin with illegal 'delete' usage.
1 parent 17988ea commit 68ece58

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

plugins/sigma.exporters.svg/sigma.exporters.svg.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
;(function(undefined) {
2+
'use strict';
23

34
/**
45
* Sigma SVG Exporter
@@ -30,17 +31,18 @@
3031
[data],
3132
{type: 'image/svg+xml;charset=utf-8'}
3233
);
33-
};
34+
}
3435

3536
function download(string, filename) {
3637

3738
// Creating blob href
3839
var blob = createBlob(string);
3940

4041
// Anchor
41-
var anchor = document.createElement('a');
42-
anchor.setAttribute('href', URL.createObjectURL(blob));
43-
anchor.setAttribute('download', filename);
42+
var o = {};
43+
o.anchor = document.createElement('a');
44+
o.anchor.setAttribute('href', URL.createObjectURL(blob));
45+
o.anchor.setAttribute('download', filename);
4446

4547
// Click event
4648
var event = document.createEvent('MouseEvent');
@@ -49,8 +51,8 @@
4951

5052
URL.revokeObjectURL(blob);
5153

52-
anchor.dispatchEvent(event);
53-
delete anchor;
54+
o.anchor.dispatchEvent(event);
55+
delete o.anchor;
5456
}
5557

5658

0 commit comments

Comments
 (0)