- 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});classX{}exports.X=X;- test.js
constx=require('./values.js');console.log(x);console.log(Object.values(x));- test1.js
constx=require('./values.js');console.log(Object.values(x));Now node test prints:
Interestingly, node test1 prints:
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.
To reproduce the problem, create the following js files:
Now
node testprints:Interestingly,
node test1prints:Please note
Object.values(x)intest.jsreturns[]. I expect it to print:I tried Node 8.x, both
testandtest1work as expected.