Browse Source

test: improve code in test-vm-symbols

* use const instead of var
* use assert.strictEqual instead of assert.equal

PR-URL: https://github.com/nodejs/node/pull/10429
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
v4.x
Adrian Estrada 8 years ago
committed by Myles Borins
parent
commit
9840f505f0
No known key found for this signature in database GPG Key ID: 933B01F40B5CA946
  1. 12
      test/parallel/test-vm-symbols.js

12
test/parallel/test-vm-symbols.js

@ -1,11 +1,11 @@
'use strict';
require('../common');
var assert = require('assert');
const assert = require('assert');
var vm = require('vm');
const vm = require('vm');
var symbol = Symbol();
const symbol = Symbol();
function Document() {
this[symbol] = 'foo';
@ -15,11 +15,11 @@ Document.prototype.getSymbolValue = function() {
return this[symbol];
};
var context = new Document();
const context = new Document();
vm.createContext(context);
assert.equal(context.getSymbolValue(), 'foo',
assert.strictEqual(context.getSymbolValue(), 'foo',
'should return symbol-keyed value from the outside');
assert.equal(vm.runInContext('this.getSymbolValue()', context), 'foo',
assert.strictEqual(vm.runInContext('this.getSymbolValue()', context), 'foo',
'should return symbol-keyed value from the inside');

Loading…
Cancel
Save