mirror of
https://github.com/encounter/phantomjs.git
synced 2026-03-30 11:35:11 -07:00
639e09bd3a
This is available via the new property called `release`. A very simple
example to demonstrate it:
var system = require('system');
console.log('Kernel release', system.os.release);
which will print (on OS X 10.7.5 Lion):
Kernel release 11.4.2
https://github.com/ariya/phantomjs/issues/12587
16 lines
500 B
JavaScript
16 lines
500 B
JavaScript
var assert = require('../../assert');
|
|
var system = require('system');
|
|
|
|
assert.isTrue(system.hasOwnProperty('os'));
|
|
assert.typeOf(system.os, 'object');
|
|
|
|
assert.typeOf(system.os.architecture, 'string');
|
|
assert.typeOf(system.os.name, 'string');
|
|
assert.typeOf(system.os.version, 'string');
|
|
|
|
if (system.os.name === 'mac') {
|
|
// release is x.y.z with x = 10 for Snow Leopard and 14 for Yosemite
|
|
assert.typeOf(system.os.release, 'string');
|
|
assert.isTrue(parseInt(system.os.release, 10) >= 10);
|
|
}
|