cross-realm type checks in search
This commit is contained in:
parent
78014a2ea3
commit
cfba105ecd
|
@ -3,6 +3,7 @@
|
|||
const net = require('net')
|
||||
const tap = require('tap')
|
||||
const vasync = require('vasync')
|
||||
const vm = require('node:vm')
|
||||
const { getSock } = require('./utils')
|
||||
const ldap = require('../lib')
|
||||
|
||||
|
@ -434,3 +435,16 @@ tap.test('multithreading support via hook', function (t) {
|
|||
})
|
||||
})
|
||||
})
|
||||
|
||||
tap.test('cross-realm type checks', function (t) {
|
||||
const server = ldap.createServer()
|
||||
const ctx = vm.createContext({})
|
||||
vm.runInContext(
|
||||
'globalThis.search=function(){};\n' +
|
||||
'globalThis.searches=[function(){}];'
|
||||
, ctx)
|
||||
server.search('', ctx.search)
|
||||
server.search('', ctx.searches)
|
||||
t.ok(server)
|
||||
t.end()
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue