From 174856cace9b0368cc1d65243aec8c28eda44058 Mon Sep 17 00:00:00 2001 From: LiviaMedeiros Date: Sun, 12 Jun 2022 17:17:21 +0800 Subject: [PATCH] squash: adjust test --- test/parallel/test-internal-util-objects.js | 34 ++++++++++++++------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/test/parallel/test-internal-util-objects.js b/test/parallel/test-internal-util-objects.js index 801f560653ceff..74068e4c577bd6 100644 --- a/test/parallel/test-internal-util-objects.js +++ b/test/parallel/test-internal-util-objects.js @@ -29,23 +29,35 @@ Object.prototype.blep = 'blop'; Object.getOwnPropertyNames(kEnumerableProperty), [ 'enumerable' ] ); - assert.strictEqual( - Object.isExtensible(kEnumerableProperty), - false - ); - assert.strictEqual( - Object.isSealed(kEnumerableProperty), - true + + assert.throws( + () => Object.setPrototypeOf(kEnumerableProperty, { value: undefined }), + TypeError ); - assert.strictEqual( - Object.isFrozen(kEnumerableProperty), - true + assert.throws( + () => delete kEnumerableProperty.enumerable, + TypeError ); - assert.throws( () => kEnumerableProperty.enumerable = false, TypeError ); + assert.throws( + () => Object.assign(kEnumerableProperty, { enumerable: false }), + TypeError + ); + assert.throws( + () => kEnumerableProperty.value = undefined, + TypeError + ); + assert.throws( + () => Object.assign(kEnumerableProperty, { value: undefined }), + TypeError + ); + assert.throws( + () => Object.defineProperty(kEnumerableProperty, 'value', {}), + TypeError + ); } {