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

REPLServer seems to override the built-in Object #39843

Closed
ranjan-purbey opened this issue Aug 22, 2021 · 1 comment
Closed

REPLServer seems to override the built-in Object #39843

ranjan-purbey opened this issue Aug 22, 2021 · 1 comment
Labels
repl Issues and PRs related to the REPL subsystem.

Comments

@ranjan-purbey
Copy link
Contributor

ranjan-purbey commented Aug 22, 2021

Version

v16.7.0, v14.15.1, v12.16.1

Platform

Linux 5.11.0-31-generic # 33-Ubuntu SMP Wed Aug 11 13:19:04 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

  1. Create isObject.js
module.exports = (x) => x instanceof Object;
  1. Create repl.js
require("repl").start();
  1. Run repl.js
$ node repl.js
> const obj = {};
> obj instanceof Object; // -> true
> require("./isObject")(obj); // -> false

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior?

The Object instance created inside repl should return true for isObject

What do you see instead?

The Object instance returns false for isObject

Additional information

No response

@gireeshpunathil gireeshpunathil added the repl Issues and PRs related to the REPL subsystem. label Aug 23, 2021
@BridgeAR
Copy link
Member

This is a fundamental issue in the REPL design. It is very difficult to fix this. It might be possible to use a child process to improve the situation but such implementation is not trivial.

Former similar issues: #27859

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
repl Issues and PRs related to the REPL subsystem.
Projects
None yet
Development

No branches or pull requests

3 participants