Different results for same code
liamray opened this issue · comments
Liam commented
Hi, please consider the following code snippet :
/////////////////////////////////////////////////////////////////////////
const vm = require('vm');
const yaml = require('yamljs');
var context = {};
var abc = {fruits: ['Mango']};
vm.runInNewContext("var abc = {fruits: ['Mango']};", context);
console.log(yaml.stringify(abc));
console.log(yaml.stringify(context.abc));
/////////////////////////////////////////////////////////////////////////
I get different results for same object abc. Is there some reason for that ?
Thank you