minor tweaks to fuzzer (#1751)
- remove `let` as variable name - employ `crypto.randomBytes()`
This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
var minify = require("..").minify;
|
var minify = require("..").minify;
|
||||||
|
var randomBytes = require("crypto").randomBytes;
|
||||||
var sandbox = require("./sandbox");
|
var sandbox = require("./sandbox");
|
||||||
|
|
||||||
var MAX_GENERATED_TOPLEVELS_PER_RUN = 3;
|
var MAX_GENERATED_TOPLEVELS_PER_RUN = 3;
|
||||||
@@ -252,8 +253,7 @@ var VAR_NAMES = [
|
|||||||
'decodeURIComponent',
|
'decodeURIComponent',
|
||||||
'encodeURI',
|
'encodeURI',
|
||||||
'encodeURIComponent',
|
'encodeURIComponent',
|
||||||
'Object',
|
'Object'];
|
||||||
'let' ]; // maybe omit this, it's more a parser problem than minifier
|
|
||||||
var INITIAL_NAMES_LEN = VAR_NAMES.length;
|
var INITIAL_NAMES_LEN = VAR_NAMES.length;
|
||||||
|
|
||||||
var TYPEOF_OUTCOMES = [
|
var TYPEOF_OUTCOMES = [
|
||||||
@@ -271,7 +271,8 @@ var loops = 0;
|
|||||||
var funcs = 0;
|
var funcs = 0;
|
||||||
|
|
||||||
function rng(max) {
|
function rng(max) {
|
||||||
return Math.floor(max * Math.random());
|
var r = parseInt(randomBytes(4).toString("hex"), 16) / 0xFFFFFFFF;
|
||||||
|
return Math.floor(max * r);
|
||||||
}
|
}
|
||||||
|
|
||||||
function createTopLevelCodes(n) {
|
function createTopLevelCodes(n) {
|
||||||
|
|||||||
Reference in New Issue
Block a user