1'use strict'; 2 3const common = require('../common'); 4const assert = require('assert'); 5const os = require('os'); 6 7const eol = common.isWindows ? '\r\n' : '\n'; 8 9assert.strictEqual(os.EOL, eol); 10 11// Test that the `Error` is a `TypeError` but do not check the message as it 12// varies between different JavaScript engines. 13assert.throws(function() { os.EOL = 123; }, TypeError); 14 15const foo = 'foo'; 16Object.defineProperties(os, { 17 EOL: { 18 configurable: true, 19 enumerable: true, 20 writable: false, 21 value: foo 22 } 23}); 24assert.strictEqual(os.EOL, foo); 25