mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
532 B
28 lines
532 B
7 years ago
|
'use strict';
|
||
|
|
||
|
const common = require('../common');
|
||
|
const assert = require('assert');
|
||
|
const os = require('os');
|
||
|
|
||
|
const eol = common.isWindows ? '\r\n' : '\n';
|
||
|
|
||
|
assert.strictEqual(os.EOL, eol);
|
||
|
|
||
|
common.expectsError(function() {
|
||
|
os.EOL = 123;
|
||
|
}, {
|
||
|
type: TypeError,
|
||
|
message: /^Cannot assign to read only property 'EOL' of object '#<Object>'$/
|
||
|
});
|
||
|
|
||
|
const foo = 'foo';
|
||
|
Object.defineProperties(os, {
|
||
|
EOL: {
|
||
|
configurable: true,
|
||
|
enumerable: true,
|
||
|
writable: false,
|
||
|
value: foo
|
||
|
}
|
||
|
});
|
||
|
assert.strictEqual(os.EOL, foo);
|