From eda20338fd063238db6d7964320b0ebd5209fe57 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Mon, 23 Jan 2023 17:16:09 +0100 Subject: [PATCH] vm: expose cachedDataRejected for vm.compileFunction Having this information available is useful for functions just as it is for scripts. Therefore, expose it in the same way that other information related to code caching is reported. As part of this, de-duplify the code for setting the properties on the C++ side and add proper exception handling to it. --- doc/api/vm.md | 6 ++ lib/internal/vm.js | 4 ++ src/node_contextify.cc | 125 ++++++++++++++++++++------------- src/node_contextify.h | 8 +++ test/parallel/test-vm-basic.js | 26 +++++-- 5 files changed, 114 insertions(+), 55 deletions(-) diff --git a/doc/api/vm.md b/doc/api/vm.md index b45588b557d9ac..ad243faaaf5e85 100644 --- a/doc/api/vm.md +++ b/doc/api/vm.md @@ -964,6 +964,12 @@ const vm = require('node:vm');