Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

REPL auto require built-in libs when their name is typed #2415

Closed
wants to merge 3 commits into from
Closed

REPL auto require built-in libs when their name is typed #2415

wants to merge 3 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Dec 25, 2011

Simple but useful. Typing 'fs' roughly translates into "global.fs = require('fs')" and checks that it's not overwriting some existing different value with the same name.

@bnoordhuis
Copy link
Member

Brandon, the test is failing for me:

$ out/Release/node test/simple/test-repl-autolibs.js

node.js:199
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
AssertionError: "{ Stats: [Function],\n  exists: [Function],\n  existsSync: [Function],\n  readFile: [Function],\n  readFileSync: [Function],\n  == "{ Stats: \u001b[36m[Function]\u001b[39m,\n  exists: \u001b[36m[Function]\u001b[39m,\n  existsSync: \u001b[36m[Function]\u001b[3
    at ArrayStream.write (/home/bnoordhuis/src/nodejs/master/test/simple/test-repl-autolibs.js:50:11)
    at Interface.<anonymous> (repl.js:184:27)
    at Interface.emit (events.js:67:17)
    at Interface._onLine (readline.js:160:10)
    at Interface._normalWrite (readline.js:228:10)
    at ArrayStream.<anonymous> (readline.js:75:12)
    at ArrayStream.emit (events.js:67:17)
    at /home/bnoordhuis/src/nodejs/master/test/simple/test-repl-autolibs.js:31:12
    at Array.forEach (native)
    at ArrayStream.run (/home/bnoordhuis/src/nodejs/master/test/simple/test-repl-autolibs.js:30:10)

@ghost
Copy link
Author

ghost commented Feb 18, 2012

Fixed. Looks like something changed to cause the tests to be run with colors disabled for the REPL tests at some point between 2 months ago and now.

@bnoordhuis
Copy link
Member

Thanks Brandon, merged in b722771.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant