Skip to content

Commit 85ec713

Browse files
committed
[js] Add a placeholder nqp::uname in the browser
1 parent 34bfa2c commit 85ec713

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/vm/js/nqp-runtime/browser.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ const NQPObject = require('./nqp-object.js');
88

99
const NQPException = require('./nqp-exception.js');
1010

11+
const BOOT = require('./BOOT.js');
12+
1113
exports.op = op;
1214

1315
// allows running code bundles as for browser use outside of the browser
@@ -182,3 +184,13 @@ op.exit = function(code) {
182184
op.gethostname = function() {
183185
return 'unknown';
184186
};
187+
188+
op.uname = function() {
189+
let sysname = 'unknown';
190+
let release = 'unknown';
191+
let version = 'unknown';
192+
let machine = 'unknown';
193+
194+
const stable = BOOT.StrArray.$$STable;
195+
return stable.REPR.allocateFromArray(stable, [sysname, release, version, machine]);
196+
};

0 commit comments

Comments
 (0)