Do not instrument Identifier when preceded by typeof #33

Merged
merged 1 commit into from Jan 15, 2013

Conversation

Projects
None yet
2 participants
Contributor

floriancargoet commented Dec 14, 2012

When an identifier isn't declared, it's valid to use it in one specific expression:

 typeof foo; // 'undefined'

Since it's instrumented by node-cover, it fails.

cover run test.js
ReferenceError: foo is not defined

This pull request remove the instrumentation of identifiers when their parent node is a typeof operator.

Contributor

floriancargoet commented Jan 4, 2013

Any comment on that PR, @itay ?

Owner

itay commented Jan 15, 2013

Looks great, sorry for delay!

itay added a commit that referenced this pull request Jan 15, 2013

Merge pull request #33 from floriancargoet/safe-typeof
Do not instrument Identifier when preceded by typeof

@itay itay merged commit e746849 into itay:master Jan 15, 2013

@floriancargoet floriancargoet deleted the floriancargoet:safe-typeof branch Jan 16, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment