|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
499 bytes
|
| Line | |
|---|
| 1 | var fs = require('fs');
|
|---|
| 2 | var Module = require('module');
|
|---|
| 3 |
|
|---|
| 4 | var file = require.resolve('esprima');
|
|---|
| 5 | var source = fs.readFileSync(file, 'utf-8');
|
|---|
| 6 |
|
|---|
| 7 | // inject '@' as a valid identifier!
|
|---|
| 8 | source = source.replace(/(function isIdentifierStart\(ch\) {\s+return)/m, '$1 (ch == 0x40) || ');
|
|---|
| 9 |
|
|---|
| 10 | //If run as script just output patched file
|
|---|
| 11 | if (require.main === module)
|
|---|
| 12 | console.log(source);
|
|---|
| 13 | else {
|
|---|
| 14 | var _module = new Module('aesprim');
|
|---|
| 15 | _module._compile(source, __filename);
|
|---|
| 16 |
|
|---|
| 17 | module.exports = _module.exports;
|
|---|
| 18 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.