Repository navigation
Function redefinition in vm.runInContext #548
Description
Activity
Confirmed result difference, 0 in iojs and 1 in node (all current versions (0.10.33 & 0.11.15)
It seems that a
Contextis a proxy object in node.js, but a plain object in io.jsWhat version of node? Likely this is due to the switch to contextify internally.
This does seem bad, as the intention here is similar to
<script> function test() { return 0; } </script> <script> function test() { return 1; } </script> <script> alert(test()); </script>
(which alerts 1).
I wonder if it is due to 3c5ea41
@domenic not directly / not alone, that commit exists in 0.11.15, which also appears to have the bug.
- addedvmIssues and PRs related to the vm subsystem.Issues and PRs related to the vm subsystem.
on Jan 23, 2015 @Fishrock123 right, I am wondering what the behavior was before that commit but after the contextify switch.
Possibly related: nodejs/node-v0.x-archive#9084
- changed the title
[-]Function redefination in vm.runInContext[/-][+]Function redefinition in vm.runInContext[/+]on Feb 5, 2015 Still returning 0 on v2.1.0.
Could be interesting to test on next branch, maybe with #1773 ?@domenic is this fixed in next?
Haven't been able to test this with the new patches, but I didn't see any reason why the new patches would necessarily fix it. I still have a list of vm bugs to work on :)
Behavior still occurs in 3.0, marking as a bug!
- addedconfirmed-bugIssues and PRs for confirmed bugs.Issues and PRs for confirmed bugs.
on Aug 14, 2015 Still returns 0 in v4.2.0.
72 remaining items
- added 3 commits that reference this issue
on Jan 26, 2017 - added 2 commits that reference this issue
on Feb 14, 2017 - added a commit that references this issue
on Jul 27, 2026
Possible bug of iojs or perhaps v8?
Tested under win7 x64 and linux.