jeremyfa / yaml.js

Standalone JavaScript YAML 1.2 Parser & Encoder. Works under node.js and all major browsers. Also brings command line YAML/JSON conversion tools.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Different results for same code

liamray opened this issue · comments

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