fix & improve coverage of `estree` (#1935)
authorAlex Lam S.L <alexlamsl@gmail.com>
Sun, 14 May 2017 18:37:53 +0000 (02:37 +0800)
committerGitHub <noreply@github.com>
Sun, 14 May 2017 18:37:53 +0000 (02:37 +0800)
commite005099fb1b9a1b87ac50ba8223255e52cec452d
tree5edef6298d3c79fc5352476c2fbfc236b626a9ee
parent504a436e9daac89f5226280e01ae2818fe4e8436
fix & improve coverage of `estree` (#1935)

- fix `estree` conversion of getter/setter
- fix non-directive literal in `to_mozilla_ast()`
- revamp `test/mozilla-ast.js`
  - reuse `test/ufuzz.js` for code generation
  - use `acorn.parse()` for creating `estree`
- extend `test/ufuzz.js` for `acorn` workaround
  - catch variable redefinition
  - non-trivial literal as directive
  - adjust options for tolerance

Miscellaneous
- optional semi-colon when parsing directives

fixes #1914
closes #1915
lib/mozilla-ast.js
lib/parse.js
package.json
test/mocha/directives.js
test/mozilla-ast.js
test/run-tests.js
test/ufuzz.js