Skip to content

Commit

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

PR-URL: #10429
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 c074982 commit 6d51108
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/parallel/test-vm-symbols.js
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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');

0 comments on commit 6d51108

Please sign in to comment.