title: Joi validation library returns different result when run in REPL that when run in script
body: <p>Here is example validating basic javascript object using joi library (script and REPL):</p>
  
  <pre><code>/tmp/validate-test $ cat test.sh
  var Joi = require('joi');
  Joi.validate({ status: 'success' }, Joi.object().keys({ status: 'qwerty' }));
  /tmp/validate-test $ node test.sh
  /tmp/validate-test $ echo $?
  0
  /tmp/validate-test $ node
  &gt; var Joi = require('joi');
  undefined
  &gt; Joi.validate({ status: 'success' }, Joi.object().keys({ status: 'qwerty' }));
  { error:
     { ValidationError: child "status" fails because ["status" must be one of [qwerty]]
         at Object.exports.process (/private/tmp/validate-test/node_modules/joi/lib/errors.js:203:19)
         at internals.Object._validateWithOptions (/private/tmp/validate-test/node_modules/joi/lib/types/any/index.js:764:31)
         at module.exports.internals.Any.root.validate (/private/tmp/validate-test/node_modules/joi/lib/index.js:147:23)
         at repl:1:5
         at Script.runInThisContext (vm.js:96:20)
         at REPLServer.defaultEval (repl.js:329:29)
         at bound (domain.js:396:14)
         at REPLServer.runBound [as eval] (domain.js:409:12)
         at REPLServer.onLine (repl.js:627:10)
         at REPLServer.emit (events.js:187:15)
       isJoi: true,
       name: 'ValidationError',
       details: [ [Object] ],
       _object: { status: 'success' },
       annotate: [Function] },
    value: { status: 'success' },
    then: [Function: then],
    catch: [Function: catch] }
  </code></pre>
  
  <p>I was expecting both REPL code and script code to error.
  How can the same exact code do different things depending on how it is run (in script vs in REPL)?</p>
  
  <p>Update with latest commands...
  Changed file name:</p>
  
  <pre><code>/tmp/validate-test $ mv test.sh test.js
  /tmp/validate-test $ node test.js
  /private/tmp/validate-test/node_modules/joi/lib/index.js:185
                  throw error;
                  ^
  
  ValidationError: {
    "status" [1]: "success"
  }
  
  [1] "status" must be one of [qwerty]
      at Object.exports.process (/private/tmp/validate-test/node_modules/joi/lib/errors.js:203:19)
      at internals.Object._validateWithOptions (/private/tmp/validate-test/node_modules/joi/lib/types/any/index.js:764:31)
      at module.exports.internals.Any.root.validate (/private/tmp/validate-test/node_modules/joi/lib/index.js:147:23)
      at module.exports.internals.Any.root.attempt (/private/tmp/validate-test/node_modules/joi/lib/index.js:177:29)
      at module.exports.internals.Any.root.assert (/private/tmp/validate-test/node_modules/joi/lib/index.js:172:14)
      at Object.&lt;anonymous&gt; (/private/tmp/validate-test/test.js:2:5)
      at Module._compile (internal/modules/cjs/loader.js:689:30)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
      at Module.load (internal/modules/cjs/loader.js:599:32)
      at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
  </code></pre>
  
  <p>Then changed it back:</p>
  
  <pre><code>/tmp/validate-test $ mv test.js test.sh
  /tmp/validate-test $ node test.sh
  /private/tmp/validate-test/node_modules/joi/lib/index.js:185
                  throw error;
                  ^
  
  ValidationError: {
    "status" [1]: "success"
  }
  
  [1] "status" must be one of [qwerty]
      at Object.exports.process (/private/tmp/validate-test/node_modules/joi/lib/errors.js:203:19)
      at internals.Object._validateWithOptions (/private/tmp/validate-test/node_modules/joi/lib/types/any/index.js:764:31)
      at module.exports.internals.Any.root.validate (/private/tmp/validate-test/node_modules/joi/lib/index.js:147:23)
      at module.exports.internals.Any.root.attempt (/private/tmp/validate-test/node_modules/joi/lib/index.js:177:29)
      at module.exports.internals.Any.root.assert (/private/tmp/validate-test/node_modules/joi/lib/index.js:172:14)
      at Object.&lt;anonymous&gt; (/private/tmp/validate-test/test.sh:2:5)
      at Module._compile (internal/modules/cjs/loader.js:689:30)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
      at Module.load (internal/modules/cjs/loader.js:599:32)
      at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
  /tmp/validate-test $ cat test.sh
  var Joi = require('joi');
  Joi.assert({ status: 'success' }, Joi.object().keys({ status: 'qwerty' }));
  </code></pre>
  
  <p>Now the result is different to before, why?</p>