Skip to content

Commit

Permalink
Simplify JSON parsing (#733)
Browse files Browse the repository at this point in the history
  • Loading branch information
basil authored Aug 16, 2024
1 parent decbd41 commit e8f3b66
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ Behaviour.specify(".directive-generator-button-reference-holder", 'prototype', 0
});
function handlePrototype(url,id) {
buildFormTree(document.forms.config);
// TODO JSON.stringify fails in some circumstances: https://gist.github.com/jglick/70ec4b15c1f628fdf2e9 due to Array.prototype.toJSON
// TODO simplify when Prototype.js is removed
var json = Object.toJSON ? Object.toJSON(JSON.parse(document.forms.config.elements.json.value).prototype) : JSON.stringify(JSON.parse(document.forms.config.elements.json.value).prototype);
var json = JSON.stringify(JSON.parse(document.forms.config.elements.json.value).prototype);
if (!json) {
return; // just a separator
}
Expand Down

0 comments on commit e8f3b66

Please sign in to comment.