Match Node's weird error message

This commit is contained in:
Kai Tamkun
2025-05-14 14:37:26 -07:00
parent d6c1de3e13
commit b72cf78067

View File

@@ -67,7 +67,10 @@ function measureMemory() {
function validateContext(contextifiedObject) {
if (!isContext(contextifiedObject)) {
throw $ERR_INVALID_ARG_TYPE("contextifiedObject", "vm.Context", contextifiedObject);
const error = new Error('The "contextifiedObject" argument must be an vm.Context');
error.code = "ERR_INVALID_ARG_TYPE";
error.name = "TypeError";
throw error;
}
}