Closed
Description
- Version: v10.0.0
- Platform: Darwin Kernel Version 17.5.0: Mon Mar 5 22:24:32 PST 2018; root:xnu-4570.51.1~1/RELEASE_X86_64 x86_64
To reproduce the problem, create the following js files:
- values.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class X {
}
exports.X = X;
- test.js
const x = require('./values.js');
console.log(x);
console.log(Object.values(x));
- test1.js
const x = require('./values.js');
console.log(Object.values(x));
Now node test
prints:
{ X: [Function: X] }
[]
Interestingly, node test1
prints:
[ [Function: X] ]
Please note Object.values(x)
in test.js
returns []
. I expect it to print:
{ X: [Function: X] }
[ [Function: X] ]
I tried Node 8.x, both test
and test1
work as expected.