in website/_webpack/js/tryFlow.js [436:487]
function onFlowErrors(errors) {
if (errorsNode) {
if (errors.length) {
removeChildren(errorsNode);
errorsNode.appendChild(printErrors(errors, editor));
} else {
errorsNode.innerText = 'No errors!';
}
}
if (jsonNode) {
removeChildren(jsonNode);
jsonNode.appendChild(
document.createTextNode(JSON.stringify(errors, null, 2))
);
}
if (astNode) {
state.flow
.then((flowProxy) => {
flowProxy.supportsParse()
.then(supportsParse => {
if (supportsParse) {
const options = {
esproposal_class_instance_fields: true,
esproposal_class_static_fields: true,
esproposal_decorators: true,
esproposal_export_star_as: true,
esproposal_optional_chaining: true,
esproposal_nullish_coalescing: true,
types: true,
};
flowProxy.parse(editor.getValue(), options).then(ast => {
removeChildren(astNode);
astNode.appendChild(
document.createTextNode(JSON.stringify(ast, null, 2))
);
astNode.dataset.disabled = "false";
});
} else if (astNode.dataset.disabled !== "true") {
astNode.dataset.disabled = "true";
removeChildren(astNode);
astNode.appendChild(
document.createTextNode(
"AST output is not supported in this version of Flow."
)
);
}
})
});
}
}