(source, options)
| 12499 | var _astCache = {}; |
| 12500 | |
| 12501 | function getAstForSource(source, options) { |
| 12502 | if (_astCache[source] && !options.disableAstCache) { |
| 12503 | return _astCache[source]; |
| 12504 | } |
| 12505 | var ast = esprima.parse(source, { |
| 12506 | comment: true, |
| 12507 | loc: true, |
| 12508 | range: true, |
| 12509 | sourceType: options.sourceType |
| 12510 | }); |
| 12511 | if (!options.disableAstCache) { |
| 12512 | _astCache[source] = ast; |
| 12513 | } |
| 12514 | return ast; |
| 12515 | } |
| 12516 | |
| 12517 | /** |
| 12518 | * Applies all available transformations to the source |