bterlson/test262-harness

Environment variable NODE_MODULE_CONTEXTS affects run

smikes opened this issue · 1 comments

This behavior is consistent for me across node versions 0.10, 0.11, 0.12, and iojs 1.2:

Directories test262 and test262-harness are siblings, up to date with github master.

Test command is:
../test262-harness/bin/run.js test/annexB/B.2.1.propertyCheck.js -r console --consoleCommand 'NODE_MODULE_CONTEXTS=x node'

When NODE_MODULE_CONTEXTS=0, I get a test failure:

FAIL test/annexB/B.2.1.propertyCheck.js
     Checking properties of this object (escape)
     Exp: no error
     Got: Error: #2: typeof this["escape"] !== "undefined"

When NODE_MODULE_CONTEXTS=1, I get a success:

Now using io.js v1.2.0
Ran 1 tests
1 passed
0 failed
Took 0.13 seconds

I'm not sure what's the correct behavior here. I guess I would expect that the test runner would produce a test that works in node without having to set an environment variable.

In REPL, required modules have different Object than command-line: nodejs/node-v0.x-archive#1482