src: wrap source before doing syntax check
authorEvan Lucas <evanlucas@me.com>
Thu, 29 Oct 2015 16:22:00 +0000 (11:22 -0500)
committerJames M Snell <jasnell@gmail.com>
Thu, 29 Oct 2015 19:40:23 +0000 (12:40 -0700)
commit5d1f1c5fa8848e406f3bc1d66a79fd9f1e819bba
treed8b8d2a1a4e4446dd4e3bf1cc0a52cd79b9912ea
parenta2786dd4087dc0de6d2b88c8be54a4665dc28be0
src: wrap source before doing syntax check

This is to ensure that it is evaluated the same way it would be if it
were to be run by node or required.

Before, the following would pass if run by node, but fail if run via
the syntax check flag:

    if (true) {
      return;
    }

Now, this will pass the syntax check

PR-URL: https://github.com/nodejs/node/pull/3587
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
src/node.js
test/fixtures/syntax/illegal_if_not_wrapped.js [new file with mode: 0644]
test/parallel/test-cli-syntax.js