Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function object is different in the CLI and in imported script #8089

Closed
neumino opened this issue Aug 13, 2016 · 2 comments
Closed

Function object is different in the CLI and in imported script #8089

neumino opened this issue Aug 13, 2016 · 2 comments
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs. repl Issues and PRs related to the REPL subsystem.

Comments

@neumino
Copy link

neumino commented Aug 13, 2016

Apologies if this is working as intended, but while I have a few theories on what's going on, I didn't find a clear answer to explain this issue.

Version:

michel@h9:~$ node -v
v6.3.1

Platform:

michel@h9:~$ uname -a
Linux h9 4.6.4-1-ARCH #1 SMP PREEMPT Mon Jul 11 19:12:32 CEST 2016 x86_64 GNU/Linux

Test case:
File test.js

module.exports = function(x) {
  console.log(x instanceof Function)
}

Open the command line with node

michel@h9:~/$ node
> var test = require('./test.js')
undefined
> test(function() {})
false

Expected behavior would be:

michel@h9:~/$ node
> var test = require('./test.js')
undefined
> test(function() {})
true
@addaleax addaleax added duplicate Issues and PRs that are duplicates of other issues or PRs. repl Issues and PRs related to the REPL subsystem. labels Aug 13, 2016
@addaleax
Copy link
Member

See #7788, this will be fixed in the next v6.x release. I’m closing this as a duplicate, but feel free to ask follow-up questions!

@neumino
Copy link
Author

neumino commented Aug 13, 2016

Thanks @addaleax for the quick answer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs. repl Issues and PRs related to the REPL subsystem.
Projects
None yet
Development

No branches or pull requests

2 participants