extend ufuzz generator (#1783)

- property access
- property assignment
- allow bare expression within try-block
- normalise `Error` in `console.log()`
- generate more unary expressions
- add parenthesis to enforce precedence
- adjust variable reuse/creation
- add parameters to function declaration & expression
- add return expression
- add trivial arguments to function call
This commit is contained in:
Alex Lam S.L
2017-04-07 18:47:30 +08:00
committed by GitHub
parent c2a1bceb77
commit a1532eb076
3 changed files with 198 additions and 133 deletions

View File

@@ -29,7 +29,7 @@ exports.run_code = function(code) {
console: {
log: function() {
return console.log.apply(console, [].map.call(arguments, function(arg) {
return typeof arg == "function" ? arg.toString() : arg;
return typeof arg == "function" || arg && /Error$/.test(arg.name) ? arg.toString() : arg;
}));
}
}