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: https://github.com/nodejs/node/pull/6280 PR-URL: https://github.com/nodejs/node/pull/6317 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
This commit is contained in:
parent
41a063f067
commit
9460b2038c
@ -14,10 +14,11 @@ function produce(source, count) {
|
|||||||
count = 1;
|
count = 1;
|
||||||
|
|
||||||
const out = spawnSync(process.execPath, [ '-e', `
|
const out = spawnSync(process.execPath, [ '-e', `
|
||||||
|
'use strict';
|
||||||
var assert = require('assert');
|
var assert = require('assert');
|
||||||
var vm = require('vm');
|
var vm = require('vm');
|
||||||
|
|
||||||
let data;
|
var data;
|
||||||
for (var i = 0; i < ${count}; i++) {
|
for (var i = 0; i < ${count}; i++) {
|
||||||
var script = new vm.Script(process.argv[1], {
|
var script = new vm.Script(process.argv[1], {
|
||||||
produceCachedData: true
|
produceCachedData: true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user