async.js 858 B

1234567891011121314151617181920212223242526
  1. var a = require.resolve('buffer/').replace(process.cwd(), '$CWD');
  2. var b;
  3. var c;
  4. var test = function test() {
  5. console.log(a, ': require.resolve, preserveSymlinks ' + (process.execArgv.indexOf('preserve-symlinks') > -1 ? 'true' : 'false'));
  6. console.log(b, ': preserveSymlinks true');
  7. console.log(c, ': preserveSymlinks false');
  8. if (a !== b && a !== c) {
  9. throw 'async: no match';
  10. }
  11. console.log('async: success! a matched either b or c\n');
  12. };
  13. require('resolve')('buffer/', { preserveSymlinks: true }, function (err, result) {
  14. if (err) { throw err; }
  15. b = result.replace(process.cwd(), '$CWD');
  16. if (b && c) { test(); }
  17. });
  18. require('resolve')('buffer/', { preserveSymlinks: false }, function (err, result) {
  19. if (err) { throw err; }
  20. c = result.replace(process.cwd(), '$CWD');
  21. if (b && c) { test(); }
  22. });