Skip to content

Commit

Permalink
Inspect method should be readonly
Browse files Browse the repository at this point in the history
  • Loading branch information
XmiliaH committed May 13, 2023
1 parent d88105f commit 5206ba2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/vm.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ const {
const {
VMScript
} = require('./script');
const {
inspect
} = require('util');

const objectDefineProperties = Object.defineProperties;

Expand Down Expand Up @@ -365,6 +368,8 @@ class VM extends EventEmitter {
_allowAsync: {__proto__: null, value: allowAsync}
});

this.readonly(inspect);

// prepare global sandbox
if (sandbox) {
this.setGlobals(sandbox);
Expand Down

0 comments on commit 5206ba2

Please sign in to comment.