Hi,
The following code works as expected:
> var context = { Array: Array };
undefined
> vm.runInNewContext("var a = new Array();", context)
undefined
> context.a instanceof Array
true
>
However, when Array is replaced with an array literal the instanceof assertion fails:
> vm.runInNewContext("var a = [];", context)
undefined
> context.a instanceof Array
false
Due to dependent library reasons we are currently running node version 0.10.33.
Is this a bug or is there a way around this?
Thanks.
Edit:
The assertion Array.isArray(context.a); returns true for both cases, but I'd like to know why the instanceof is failing
Hi,
The following code works as expected:
However, when
Arrayis replaced with an array literal theinstanceofassertion fails:Due to dependent library reasons we are currently running node version 0.10.33.
Is this a bug or is there a way around this?
Thanks.
Edit:
The assertion
Array.isArray(context.a);returns true for both cases, but I'd like to know why theinstanceofis failing