From 8d0c21fd24d9d931db7d738489e7dd8ff00a8112 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Tue, 2 Jun 2020 00:42:46 +0200 Subject: [PATCH] util: restrict custom inspect function + vm.Context interaction When `util.inspect()` is called on an object with a custom inspect function, and that object is from a different `vm.Context`, that function will not receive any arguments that access context-specific data anymore. PR-URL: https://github.com/nodejs/node/pull/33690 Reviewed-By: James M Snell Reviewed-By: Colin Ihrig --- doc/api/util.md | 5 ++ lib/internal/util/inspect.js | 39 ++++++++++++-- test/parallel/test-util-inspect.js | 83 ++++++++++++++++++++++++++++++ 3 files changed, 124 insertions(+), 3 deletions(-) diff --git a/doc/api/util.md b/doc/api/util.md index c5f33475c822c9..a5c405077e506a 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -414,6 +414,11 @@ stream.write('With ES6');