Do not instrument Identifier when preceded by typeof #33

merged 1 commit into from Jan 15, 2013


None yet
2 participants

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.


floriancargoet commented Jan 4, 2013

Any comment on that PR, @itay ?


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