Skip to content

Commit

Permalink
test: improve code in test-vm-preserves-property
Browse files Browse the repository at this point in the history
* use const instead of var
* use assert.strictEqual instead assert.equal

PR-URL #10428
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
edsadr authored and MylesBorins committed Jan 23, 2017
1 parent fd2005c commit 6a6dda7
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions test/parallel/test-vm-preserves-property.js
Original file line number Diff line number Diff line change
@@ -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');

0 comments on commit 6a6dda7

Please sign in to comment.