Skip to content

Commit

Permalink
[js] make nqp::getmessage return nqp::null_s when there is no message
Browse files Browse the repository at this point in the history
  • Loading branch information
pmurias committed Sep 21, 2017
1 parent a5f92f2 commit 085912e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/vm/js/nqp-runtime/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ var constants = require('./constants.js');
var containerSpecs = require('./container-specs.js');

var Null = require('./null.js');
const null_s = require('./null_s.js');

var BOOT = require('./BOOT.js');

Expand Down Expand Up @@ -686,7 +687,7 @@ op.getpid = function() {
};

op.getmessage = function(exception) {
return exception.$$message;
return (exception.$$message === undefined ? null_s : exception.$$message);
};

op.setmessage = function(exception, message) {
Expand Down

0 comments on commit 085912e

Please sign in to comment.