Skip to content

Commit 1b71231

Browse files
Myles Borinsevanlucas
Myles Borins
authored andcommitted
test: fix test-vm-cached-data to work with old v8
While `let` no longer needs to run in `strict mode` in v8 5.x it throws in v8 4. This modification will make the test-vm-cached-data work in older version of node. Refs: #6280 PR-URL: #6317 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Fedor Indutny <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
1 parent 0eb25cb commit 1b71231

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/parallel/test-vm-cached-data.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ function produce(source, count) {
1414
count = 1;
1515

1616
const out = spawnSync(process.execPath, [ '-e', `
17+
'use strict';
1718
var assert = require('assert');
1819
var vm = require('vm');
1920
20-
let data;
21+
var data;
2122
for (var i = 0; i < ${count}; i++) {
2223
var script = new vm.Script(process.argv[1], {
2324
produceCachedData: true

0 commit comments

Comments
 (0)