Browse Source

Flesh out util_stub a little more

pr/1
Tony Garnock-Jones 1 year ago
parent
commit
212a92605e
  1. 2
      packages/core/src/skeleton.js
  2. 10
      packages/core/src/util_stub.js

2
packages/core/src/skeleton.js

@ -378,7 +378,7 @@ Index.prototype.sendMessage = function(v, leafCallback) {
Node.prototype._debugString = function (outerIndent) {
const pieces = [];
const inspect = require('util').inspect || JSON.stringify;
const inspect = require('util').inspect;
function line(indent, content) {
pieces.push(indent);
pieces.push(content);

10
packages/core/src/util_stub.js

@ -1,3 +1,11 @@
module.exports = {
inspect: void 0,
inspect: (item) => {
try {
return JSON.stringify(item);
} catch (_e) {
return '<uninspectable_value>';
}
},
};
module.exports.inspect.custom = Symbol('util_stub.inspect.custom');

Loading…
Cancel
Save