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

Commit

Permalink
cross-realm type checks in search
Browse files Browse the repository at this point in the history
  • Loading branch information
Axel Kittenberger authored and jsumners committed Mar 28, 2023
1 parent 78014a2 commit cfba105
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/server.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down Expand Up @@ -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()
})

0 comments on commit cfba105

Please sign in to comment.