-
Notifications
You must be signed in to change notification settings - Fork 28.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: improve code in test-vm-preserves-property
* 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
Showing
1 changed file
with
11 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); |