Fix T6779. It should be possible to apply this to ES5 functions without mutating ES2015 MethodDefinition's.