We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8eba7d6 commit e9ed6a1Copy full SHA for e9ed6a1
core/lib/annotation_exporter.js
@@ -26,8 +26,12 @@ var annotations_exporter = function (pl) {
26
27
//parse as JSON by removing the old wrapping js syntax. comments and the trailing semi-colon
28
oldAnnotations = oldAnnotations.replace('var comments = ', '');
29
+ if (oldAnnotations.trim().substr(oldAnnotations.length - 1) === ';') {
30
+ oldAnnotations = oldAnnotations.trim().slice(0, -1);
31
+ }
32
+
33
try {
- var oldAnnotationsJSON = JSON5.parse(oldAnnotations.trim().slice(0, -1));
34
+ var oldAnnotationsJSON = JSON5.parse(oldAnnotations);
35
} catch (ex) {
36
console.log('There was an error parsing JSON for ' + paths.source.annotations + 'annotations.js');
37
console.log(ex);
0 commit comments