javascript extract method adds method inside a prototype definition?

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?


Comment actions Permalink

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.

Comment actions Permalink


I tried to look at the screencast, but it seems the link is broken...

thanks again

Comment actions Permalink

Link is working fine for me.


Please sign in to leave a comment.