Skip to content
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions test/parallel/test-vm-is-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ const vm = require('vm');

assert.throws(function() {
vm.isContext('string is not supported');
}, TypeError);
}, /^TypeError: sandbox must be an object$/);

assert.strictEqual(vm.isContext({}), false);
assert.strictEqual(vm.isContext([]), false);

assert.strictEqual(vm.isContext(vm.createContext()), true);
assert.strictEqual(vm.isContext(vm.createContext([])), true);

const sandbox = { foo: 'bar' };
vm.createContext(sandbox);
assert.strictEqual(vm.isContext(sandbox), true);
const sandbox = { foo: 'bar' };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jeyanthinath please revert also these white space changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops , I missed those , thanks !

vm.createContext(sandbox);
assert.strictEqual(vm.isContext(sandbox), true);