From 0646eda4fc0affb98e13c30acb522e63b7fd6dde Mon Sep 17 00:00:00 2001 From: Michaƫl Zasso Date: Fri, 22 Nov 2019 18:04:46 +0100 Subject: lib: flatten access to primordials Store all primordials as properties of the primordials object. Static functions are prefixed by the constructor's name and prototype methods are prefixed by the constructor's name followed by "Prototype". For example: primordials.Object.keys becomes primordials.ObjectKeys. PR-URL: https://github.com/nodejs/node/pull/30610 Refs: https://github.com/nodejs/node/issues/29766 Reviewed-By: Anna Henningsen Reviewed-By: Matteo Collina Reviewed-By: Colin Ihrig Reviewed-By: Trivikram Kamat --- lib/crypto.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/crypto.js') diff --git a/lib/crypto.js b/lib/crypto.js index 6bfa8319c1..e2d1875d8d 100644 --- a/lib/crypto.js +++ b/lib/crypto.js @@ -24,7 +24,9 @@ 'use strict'; -const { Object } = primordials; +const { + ObjectDefineProperties, +} = primordials; const { assertCrypto, @@ -220,7 +222,7 @@ function getFipsForced() { return 1; } -Object.defineProperties(module.exports, { +ObjectDefineProperties(module.exports, { createCipher: { enumerable: false, value: deprecate(createCipher, -- cgit v1.2.3