On Sun, Mar 11, 2012 at 11:39 AM, Jann Horn <[email protected]> wrote:
> Am Sonntag, den 11.03.2012, 11:10 -0500 schrieb Mark Volkmann:
>> util.isDate(obj)
>>
>> obj instanceof Date
>
>> new Date() instanceof Date
> true
>> require('vm').runInNewContext('new Date()') instanceof Date
> false
>> require('util').isDate(new Date())
> true
>> require('util').isDate(require('vm').runInNewContext('new Date()'))
> true

Thanks for that example! It does seem like an obscure case though
since the vm module isn't heavily used module. You could also put the
Date constructor into the context so instanceof would work.

-- 
R. Mark Volkmann
Object Computing, Inc.

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to