ast-types icon indicating copy to clipboard operation
ast-types copied to clipboard

Scope constructor `instanceof` check

Open pieterv opened this issue 8 years ago • 2 comments

When writing Jest unit tests for a jscodeshift codemod (https://github.com/cpojer/js-codemod/pull/2) the Scope constructor instanceof check fails, I haven't fully tracked down whats causing it (maybe related to running in a child process) but i can see the transform is working fine locally via jscodeshift or via http://astexplorer.net/#/LDGg3pg5ne

What is the purpose of this check? Im wondering if it can be achieved another way? i'm happy to do a PR if you're cool with changing it.

cc @cpojer @benjamn

pieterv avatar Mar 14 '16 22:03 pieterv

@cpojer figured out my specific case :) but it would be great to check this in a less error prone way. Feel free to close if you dont think its worth it.

pieterv avatar Mar 14 '16 23:03 pieterv

There we go: https://github.com/reactjs/react-codemod/commit/c95c1eaf825c621a5101dd37d8134f9e6be6468c

cpojer avatar Mar 14 '16 23:03 cpojer