| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 58d2dad commit e654c8b
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -279,12 +279,6 @@ Platform check for IBMi. | |||
| 279 | 279 | ||
| 280 | 280 | Platform check for Linux. | |
| 281 | 281 | ||
| 282 | - ### `isLinuxPPCBE` | ||
| 283 | - | ||
| 284 | - * [\<boolean>][<boolean>] | ||
| 285 | - | ||
| 286 | - Platform check for Linux on PowerPC. | ||
| 287 | - | ||
| 288 | 282 | ### `isMacOS` | |
| 289 | 283 | ||
| 290 | 284 | * [\<boolean>][<boolean>] | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1034,11 +1034,6 @@ const common = { | |||
| 1034 | 1034 | return require('os').type() === 'OS400'; | |
| 1035 | 1035 | }, | |
| 1036 | 1036 | ||
| 1037 | - get isLinuxPPCBE() { | ||
| 1038 | - return (process.platform === 'linux') && (process.arch === 'ppc64') && | ||
| 1039 | - (require('os').endianness() === 'BE'); | ||
| 1040 | - }, | ||
| 1041 | - | ||
| 1042 | 1037 | get localhostIPv4() { | |
| 1043 | 1038 | if (localhostIPv4 !== null) return localhostIPv4; | |
| 1044 | 1039 | ||
@@ -1067,13 +1062,6 @@ const common = { | |||
| 1067 | 1062 | return +process.env.NODE_COMMON_PORT || 12346; | |
| 1068 | 1063 | }, | |
| 1069 | 1064 | ||
| 1070 | - /** | ||
| 1071 | - * Returns the EOL character used by this Git checkout. | ||
| 1072 | - */ | ||
| 1073 | - get checkoutEOL() { | ||
| 1074 | - return fs.readFileSync(__filename).includes('\r\n') ? '\r\n' : '\n'; | ||
| 1075 | - }, | ||
| 1076 | - | ||
| 1077 | 1065 | get isInsideDirWithUnusualChars() { | |
| 1078 | 1066 | return __dirname.includes('%') || | |
| 1079 | 1067 | (!isWindows && __dirname.includes('\\')) || | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,7 +7,6 @@ const { | |||
| 7 | 7 | allowGlobals, | |
| 8 | 8 | buildType, | |
| 9 | 9 | canCreateSymLink, | |
| 10 | - checkoutEOL, | ||
| 11 | 10 | childShouldThrowAndAbort, | |
| 12 | 11 | createZeroFilledFile, | |
| 13 | 12 | enoughTestMem, | |
@@ -27,7 +26,6 @@ const { | |||
| 27 | 26 | isIBMi, | |
| 28 | 27 | isInsideDirWithUnusualChars, | |
| 29 | 28 | isLinux, | |
| 30 | - isLinuxPPCBE, | ||
| 31 | 29 | isMainThread, | |
| 32 | 30 | isOpenBSD, | |
| 33 | 31 | isMacOS, | |
@@ -59,7 +57,6 @@ export { | |||
| 59 | 57 | allowGlobals, | |
| 60 | 58 | buildType, | |
| 61 | 59 | canCreateSymLink, | |
| 62 | - checkoutEOL, | ||
| 63 | 60 | childShouldThrowAndAbort, | |
| 64 | 61 | createRequire, | |
| 65 | 62 | createZeroFilledFile, | |
@@ -81,7 +78,6 @@ export { | |||
| 81 | 78 | isIBMi, | |
| 82 | 79 | isInsideDirWithUnusualChars, | |
| 83 | 80 | isLinux, | |
| 84 | - isLinuxPPCBE, | ||
| 85 | 81 | isMainThread, | |
| 86 | 82 | isOpenBSD, | |
| 87 | 83 | isMacOS, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -242,6 +242,7 @@ function nextdir() { | |||
| 242 | 242 | ||
| 243 | 243 | // Persists line lengths for in-memory representation of source file. | |
| 244 | 244 | { | |
| 245 | + const checkoutEOL = fs.readFileSync(__filename).includes('\r\n') ? '\r\n' : '\n'; | ||
| 245 | 246 | const coverageDirectory = nextdir(); | |
| 246 | 247 | spawnSync(process.execPath, [ | |
| 247 | 248 | require.resolve('../fixtures/source-map/istanbul-throw.js'), | |
@@ -250,7 +251,7 @@ function nextdir() { | |||
| 250 | 251 | 'istanbul-throw.js', | |
| 251 | 252 | coverageDirectory | |
| 252 | 253 | ); | |
| 253 | - if (common.checkoutEOL === '\r\n') { | ||
| 254 | + if (checkoutEOL === '\r\n') { | ||
| 254 | 255 | assert.deepStrictEqual(sourceMap.lineLengths, [1086, 31, 185, 649, 0]); | |
| 255 | 256 | } else { | |
| 256 | 257 | assert.deepStrictEqual(sourceMap.lineLengths, [1085, 30, 184, 648, 0]); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,14 +5,21 @@ const { | |||
| 5 | 5 | isWindows, | |
| 6 | 6 | isSunOS, | |
| 7 | 7 | isAIX, | |
| 8 | - isLinuxPPCBE, | ||
| 9 | 8 | isFreeBSD, | |
| 10 | 9 | } = require('../common'); | |
| 11 | 10 | ||
| 11 | + const { endianness } = require('os'); | ||
| 12 | + | ||
| 13 | + function isLinuxPPCBE() { | ||
| 14 | + return (process.platform === 'linux') && | ||
| 15 | + (process.arch === 'ppc64') && | ||
| 16 | + (endianness() === 'BE'); | ||
| 17 | + } | ||
| 18 | + | ||
| 12 | 19 | module.exports = { | |
| 13 | 20 | isCPPSymbolsNotMapped: isWindows || | |
| 14 | 21 | isSunOS || | |
| 15 | 22 | isAIX || | |
| 16 | - isLinuxPPCBE || | ||
| 23 | + isLinuxPPCBE() || | ||
| 17 | 24 | isFreeBSD, | |
| 18 | 25 | }; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,14 +1,19 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | - const common = require('../common'); | ||
| 3 | - const { checkoutEOL } = common; | ||
| 2 | + require('../common'); | ||
| 3 | + const { readFileSync } = require('fs'); | ||
| 4 | 4 | const { testWasiPreview1 } = require('../common/wasi'); | |
| 5 | 5 | ||
| 6 | + const checkoutEOL = readFileSync(__filename).includes('\r\n') ? '\r\n' : '\n'; | ||
| 7 | + | ||
| 8 | + // TODO(@jasnell): It's not entirely clear what this test is asserting. | ||
| 9 | + // More comments would be helpful. | ||
| 10 | + | ||
| 6 | 11 | testWasiPreview1(['freopen'], {}, { stdout: `hello from input2.txt${checkoutEOL}` }); | |
| 7 | 12 | testWasiPreview1(['read_file'], {}, { stdout: `hello from input.txt${checkoutEOL}` }); | |
| 8 | 13 | testWasiPreview1(['read_file_twice'], {}, { | |
| 9 | 14 | stdout: `hello from input.txt${checkoutEOL}hello from input.txt${checkoutEOL}`, | |
| 10 | 15 | }); | |
| 11 | 16 | // Tests that are currently unsupported on Windows. | |
| 12 | - if (!common.isWindows) { | ||
| 17 | + if (process.platform !== 'win32') { | ||
| 13 | 18 | testWasiPreview1(['stdin'], { input: 'hello world' }, { stdout: 'hello world' }); | |
| 14 | 19 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments