hasExportDeclaration: a statement that exports by name or by assignment (`export {…}`, `export =`, `export default x`), not by declaring.
(block: Node)
| 1220 | /// hasExportDeclaration: a statement that exports by name or by assignment |
| 1221 | /// (`export {…}`, `export =`, `export default x`), not by declaring. |
| 1222 | fn has_export_declaration(block: Node) -> bool { |
| 1223 | for i in 0..block.named_child_count() { |
| 1224 | if let Some(statement) = block.named_child(i) { |
| 1225 | if statement.kind() == "export_statement" && statement.child_by_field_name("declaration").is_none() { |
| 1226 | return true; |
| 1227 | } |
| 1228 | } |
| 1229 | } |
| 1230 | false |
| 1231 | } |
| 1232 | |
| 1233 | fn opt_str(arena: &mut Arena, s: Option<&str>) -> StrRef { |
| 1234 | match s { |