Files: 65191f9a9664f013ebe726bb95a1a54b086e1bd5 / test / test-50-ast-parsing / test-x-index.js
503 bytesRaw
1 | ; |
2 | |
3 | const fs = require('fs'); |
4 | const detector = require('../../lib-es5/detector.js'); |
5 | const body = fs.readFileSync('./test-y-data.txt', 'utf8'); |
6 | |
7 | detector.detect( |
8 | body, |
9 | function (node, trying) { |
10 | let p; |
11 | p = detector.visitor_SUCCESSFUL(node, true); |
12 | if (p) { |
13 | if (trying) { |
14 | console.log('try { ' + p + '; } catch (_) {}'); |
15 | } else { |
16 | console.log(p + ';'); |
17 | } |
18 | return false; |
19 | } |
20 | // TODO maybe NONLITERAL and USESCWD? |
21 | return true; |
22 | } |
23 | ); |
24 |
Built with git-ssb-web