Skip to content

Commit

Permalink
fixup: add common.mustCall
Browse files Browse the repository at this point in the history
  • Loading branch information
targos committed May 4, 2022
1 parent 7c5679f commit e54262e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/parallel/test-vm-global-setter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
require('../common');
const common = require('../common');
const assert = require('assert');
const vm = require('vm');

Expand All @@ -15,13 +15,15 @@ assert.strictEqual(descriptor.configurable, true);
// Regression test for GH-42962. This assignment should not throw.
window.globalProxy.onhashchange = () => {};

assert.strictEqual(window.globalProxy.onhashchange, 42);

function createWindow() {
const obj = {};
vm.createContext(obj);
Object.defineProperty(obj, 'onhashchange', {
// eslint-disable-next-line getter-return
get() {},
set() {},
get: common.mustCall(() => 42),
set: common.mustCall(),
configurable: true
});

Expand Down

0 comments on commit e54262e

Please sign in to comment.