| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 3a886ff commit f6caeb9
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -140,7 +140,6 @@ function networkInterfaces() { | |||
| 140 | 140 | module.exports = exports = { | |
| 141 | 141 | arch, | |
| 142 | 142 | cpus, | |
| 143 | - EOL: isWindows ? '\r\n' : '\n', | ||
| 144 | 143 | endianness, | |
| 145 | 144 | freemem: getFreeMem, | |
| 146 | 145 | homedir: getHomeDirectory, | |
@@ -162,8 +161,17 @@ module.exports = exports = { | |||
| 162 | 161 | tmpDir: deprecate(tmpdir, tmpDirDeprecationMsg, 'DEP0022') | |
| 163 | 162 | }; | |
| 164 | 163 | ||
| 165 | - Object.defineProperty(module.exports, 'constants', { | ||
| 166 | - configurable: false, | ||
| 167 | - enumerable: true, | ||
| 168 | - value: constants | ||
| 164 | + Object.defineProperties(module.exports, { | ||
| 165 | + constants: { | ||
| 166 | + configurable: false, | ||
| 167 | + enumerable: true, | ||
| 168 | + value: constants | ||
| 169 | + }, | ||
| 170 | + | ||
| 171 | + EOL: { | ||
| 172 | + configurable: true, | ||
| 173 | + enumerable: true, | ||
| 174 | + writable: false, | ||
| 175 | + value: isWindows ? '\r\n' : '\n' | ||
| 176 | + } | ||
| 169 | 177 | }); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,27 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + | ||
| 3 | + const common = require('../common'); | ||
| 4 | + const assert = require('assert'); | ||
| 5 | + const os = require('os'); | ||
| 6 | + | ||
| 7 | + const eol = common.isWindows ? '\r\n' : '\n'; | ||
| 8 | + | ||
| 9 | + assert.strictEqual(os.EOL, eol); | ||
| 10 | + | ||
| 11 | + common.expectsError(function() { | ||
| 12 | + os.EOL = 123; | ||
| 13 | + }, { | ||
| 14 | + type: TypeError, | ||
| 15 | + message: /^Cannot assign to read only property 'EOL' of object '#<Object>'$/ | ||
| 16 | + }); | ||
| 17 | + | ||
| 18 | + const foo = 'foo'; | ||
| 19 | + Object.defineProperties(os, { | ||
| 20 | + EOL: { | ||
| 21 | + configurable: true, | ||
| 22 | + enumerable: true, | ||
| 23 | + writable: false, | ||
| 24 | + value: foo | ||
| 25 | + } | ||
| 26 | + }); | ||
| 27 | + assert.strictEqual(os.EOL, foo); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments