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 31, 2017
1 parent 709b9b4 commit f1075a1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 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',
'should return symbol-keyed value from the outside');
assert.strictEqual(context.getSymbolValue(), 'foo',
'should return symbol-keyed value from the outside');

assert.equal(vm.runInContext('this.getSymbolValue()', context), 'foo',
'should return symbol-keyed value from the inside');
assert.strictEqual(vm.runInContext('this.getSymbolValue()', context), 'foo',
'should return symbol-keyed value from the inside');

0 comments on commit f1075a1

Please sign in to comment.