Files: cfc8d49135488f7554210234b3a503c2dbd6c6a5 / 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