Fixes the issue brought up in #2477 by adding default no-op implementations of all the functions present on the prototype of a stub instance object. This avoids issues that might arise if code traverses an object that already has been restored by having a default set of no-op function to fiddle with, instead of accidentally invoking stuff on the prototype which might or might not depend on the constructor being run to work correctly.
How to verify - mandatory
npm test and check against the example in #2477
Checklist for author
[x] npm run lint passes
[x] References to standard library functions are cached.
Purpose (TL;DR) - mandatory
Fixes the issue brought up in #2477 by adding default no-op implementations of all the functions present on the prototype of a stub instance object. This avoids issues that might arise if code traverses an object that already has been restored by having a default set of no-op function to fiddle with, instead of accidentally invoking stuff on the prototype which might or might not depend on the constructor being run to work correctly.
How to verify - mandatory
npm test
and check against the example in #2477Checklist for author
npm run lint
passes