From c5ccffd387324596b3b06cf6f84c7423a46180aa Mon Sep 17 00:00:00 2001 From: Adrian Estrada Date: Fri, 23 Dec 2016 13:44:10 -0500 Subject: [PATCH] test: improve code in test-vm-preserves-property * use const instead of var * use assert.strictEqual instead assert.equal PR-URL https://github.com/nodejs/node/pull/10428 Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Luigi Pinca --- test/parallel/test-vm-preserves-property.js | 22 ++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/test/parallel/test-vm-preserves-property.js b/test/parallel/test-vm-preserves-property.js index 9786ee54a7cffd..0ddc7b260a1393 100644 --- a/test/parallel/test-vm-preserves-property.js +++ b/test/parallel/test-vm-preserves-property.js @@ -1,25 +1,25 @@ 'use strict'; require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var vm = require('vm'); +const vm = require('vm'); -var x = {}; +const x = {}; Object.defineProperty(x, 'prop', { configurable: false, enumerable: false, writable: false, value: 'val' }); -var o = vm.createContext(x); +const o = vm.createContext(x); -var code = 'Object.getOwnPropertyDescriptor(this, "prop")'; -var res = vm.runInContext(code, o, 'test'); +const code = 'Object.getOwnPropertyDescriptor(this, "prop")'; +const res = vm.runInContext(code, o, 'test'); assert(res); -assert.equal(typeof res, 'object'); -assert.equal(res.value, 'val'); -assert.equal(res.configurable, false, 'should not be configurable'); -assert.equal(res.enumerable, false, 'should not be enumerable'); -assert.equal(res.writable, false, 'should not be writable'); +assert.strictEqual(typeof res, 'object'); +assert.strictEqual(res.value, 'val'); +assert.strictEqual(res.configurable, false, 'should not be configurable'); +assert.strictEqual(res.enumerable, false, 'should not be enumerable'); +assert.strictEqual(res.writable, false, 'should not be writable');