Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.

Commit cfba105

Browse files
Axel Kittenbergerjsumners
Axel Kittenberger
authored andcommitted
cross-realm type checks in search
1 parent 78014a2 commit cfba105

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/server.test.js

+14
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
const net = require('net')
44
const tap = require('tap')
55
const vasync = require('vasync')
6+
const vm = require('node:vm')
67
const { getSock } = require('./utils')
78
const ldap = require('../lib')
89

@@ -434,3 +435,16 @@ tap.test('multithreading support via hook', function (t) {
434435
})
435436
})
436437
})
438+
439+
tap.test('cross-realm type checks', function (t) {
440+
const server = ldap.createServer()
441+
const ctx = vm.createContext({})
442+
vm.runInContext(
443+
'globalThis.search=function(){};\n' +
444+
'globalThis.searches=[function(){}];'
445+
, ctx)
446+
server.search('', ctx.search)
447+
server.search('', ctx.searches)
448+
t.ok(server)
449+
t.end()
450+
})

0 commit comments

Comments
 (0)