main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
858 bytes
|
Line | |
---|
1 | var a = require.resolve('buffer/').replace(process.cwd(), '$CWD');
|
---|
2 | var b;
|
---|
3 | var c;
|
---|
4 |
|
---|
5 | var test = function test() {
|
---|
6 | console.log(a, ': require.resolve, preserveSymlinks ' + (process.execArgv.indexOf('preserve-symlinks') > -1 ? 'true' : 'false'));
|
---|
7 | console.log(b, ': preserveSymlinks true');
|
---|
8 | console.log(c, ': preserveSymlinks false');
|
---|
9 |
|
---|
10 | if (a !== b && a !== c) {
|
---|
11 | throw 'async: no match';
|
---|
12 | }
|
---|
13 | console.log('async: success! a matched either b or c\n');
|
---|
14 | };
|
---|
15 |
|
---|
16 | require('resolve')('buffer/', { preserveSymlinks: true }, function (err, result) {
|
---|
17 | if (err) { throw err; }
|
---|
18 | b = result.replace(process.cwd(), '$CWD');
|
---|
19 | if (b && c) { test(); }
|
---|
20 | });
|
---|
21 | require('resolve')('buffer/', { preserveSymlinks: false }, function (err, result) {
|
---|
22 | if (err) { throw err; }
|
---|
23 | c = result.replace(process.cwd(), '$CWD');
|
---|
24 | if (b && c) { test(); }
|
---|
25 | });
|
---|
26 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.