From b5bd87cbdecc98c155d55405df6ed623c93f20f4 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Tue, 2 Jun 2020 00:42:46 +0200 Subject: [PATCH 1/4] 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. --- doc/api/util.md | 5 ++ lib/internal/util/inspect.js | 37 ++++++++++++-- test/parallel/test-util-inspect.js | 82 ++++++++++++++++++++++++++++++ 3 files changed, 121 insertions(+), 3 deletions(-) diff --git a/doc/api/util.md b/doc/api/util.md index 8cdb7b6d001000..9a0c8cb2f95ed7 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -398,6 +398,11 @@ stream.write('With ES6');