javascript extract method adds method inside a prototype definition? Follow
i was trying to extract a method from a constructor and add it as a function to my objecst prototype but all I managed was to create a function inside my constructor function. is there any way to do this automatically?
also, i find that even if the code is exactly the same extract method doesn't find the duplication and offers to call the extracted method in those places as well, is that possible?
thanks
x
Please sign in to leave a comment.
Hi Alexandre,
Didn't scope selector appears for you when you are trying to extract method? I've created a screencast which shows how it should work.
Automatic duplicates search and adding "prototype" prefix are not possible.
Hi,
I tried to look at the screencast, but it seems the link is broken...
thanks again
Link is working fine for me.