Shouldn't it be `oldFile.hasOwnProperty(key)`? The way you're invoking the function directly from the prototype doesn't seem valid.