From f0a3d206422af3177e0f36ed22802c1ccc6f7654 Mon Sep 17 00:00:00 2001 From: Kenta Moriuchi Date: Fri, 6 Sep 2024 19:52:59 +0900 Subject: fix(runtime): use more null proto objects again (#25040) proceed with #23921 This PR is a preparation for https://github.com/denoland/deno_lint/pull/1307 --------- Signed-off-by: Kenta Moriuchi Co-authored-by: Luca Casonato --- ext/console/01_console.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ext/console') diff --git a/ext/console/01_console.js b/ext/console/01_console.js index 017e6cb77..15c5c837b 100644 --- a/ext/console/01_console.js +++ b/ext/console/01_console.js @@ -260,6 +260,7 @@ const colors = { function defineColorAlias(target, alias) { ObjectDefineProperty(colors, alias, { + __proto__: null, get() { return this[target]; }, @@ -3447,7 +3448,10 @@ function inspect( function createFilteredInspectProxy({ object, keys, evaluate }) { const obj = class {}; if (object.constructor?.name) { - ObjectDefineProperty(obj, "name", { value: object.constructor.name }); + ObjectDefineProperty(obj, "name", { + __proto__: null, + value: object.constructor.name, + }); } return new Proxy(new obj(), { -- cgit v1.2.3