Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

runInNewContext does not pass properties that Enumerable= false #1402

Closed
shimondoodkin opened this issue Jul 26, 2011 · 3 comments
Closed

runInNewContext does not pass properties that Enumerable= false #1402

shimondoodkin opened this issue Jul 26, 2011 · 3 comments
Labels

Comments

@shimondoodkin
Copy link

example:

var vm= require('vm');
var ctx = {};
Object.defineProperty(ctx, 'myNonEnumerablePropery', { value: 1 }); 
vm.runInNewContext('var result=typeof myNonEnumerablePropery', ctx);
console.log(ctx.result);

var ctx = {};
Object.defineProperty(ctx, 'myNonEnumerablePropery', { value: 1 , enumerable:true }); 
vm.runInNewContext('var result=typeof myNonEnumerablePropery', ctx);
console.log(ctx.result);

test case:

function node_script_cc_runInNewContext_ignores_non_enumerable()
{
 var assert=require('assert');
 var vm= require('vm');
 var ctx = {};
 Object.defineProperty(ctx, 'myNonEnumeratiblePropery', { value: 1 }); 
 vm.runInNewContext('var result=typeof myNonEnumeratiblePropery', ctx);
 assert.equal(ctx.result,'number', "runInNewContext ignores non enumerable ");
}
node_script_cc_runInNewContext_ignores_non_enumerable()
@ELLIOTTCABLE
Copy link

I’m having issues with this as well.

+1

@ELLIOTTCABLE
Copy link

As documented in #1801, I believe I’ve closed this with elliottcable@cf21650. I’d appreciate if you’d clone and compile against that, and see if you can still reproduce this issue. (Many of these issues seem related.)

@shimondoodkin
Copy link
Author

works on v0.5.10-pre

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants