improve parser under "use strict" (#1836)
authorAlex Lam S.L <alexlamsl@gmail.com>
Sun, 23 Apr 2017 12:05:22 +0000 (20:05 +0800)
committerGitHub <noreply@github.com>
Sun, 23 Apr 2017 12:05:22 +0000 (20:05 +0800)
commit9bf72cf75822044ae314b4646db9aefb1bd38284
treebf149011065d6c801217585f4d6bc813343fe0c7
parent64d74432f6e475df921d0ec49c4d15e5d2ae891d
improve parser under "use strict" (#1836)

- `const` without value
- `delete` of expression
- redefining `arguments` or `eval`

extend `test/ufuzz.js`
- optionally generate "use strict"
- improve handling of test cases with syntax errors
- group IIFE generation
- generate bare anonymous functions
- workaround `console.log()` for `new function()`
- generate expressions with `this`

fixes #1810
lib/parse.js
test/input/invalid/const.js [new file with mode: 0644]
test/input/invalid/delete.js [new file with mode: 0644]
test/input/invalid/function_1.js [new file with mode: 0644]
test/input/invalid/function_2.js [new file with mode: 0644]
test/input/invalid/function_3.js [new file with mode: 0644]
test/input/invalid/try.js [new file with mode: 0644]
test/input/invalid/var.js [new file with mode: 0644]
test/mocha/cli.js
test/sandbox.js
test/ufuzz.js