knockout.mapping icon indicating copy to clipboard operation
knockout.mapping copied to clipboard

objectLookup() + "watch" + Firefox = hilarity

Open opfertunes opened this issue 9 years ago • 0 comments

First of all this plugin completely rocks... thank you.

I have a complex JSON array that contains the sub-object pasted below, note that it has a value of "watch" for the key "caption".

{"imageId": 558230, "videoId": null, "title": "Shinola", "caption": "watch", "size": [1416, 2048]}

In FireFox (47.0.1), calling ko.mapping.fromJS(), fails at objectLookup() because there is a built-in watch() function on Object.prototype:

var bucket = buckets[bucketKey];

If bucketKey == 'watch', you get back the watch() function (!)

Working on a fix (I posted one earlier that stupidly replaced the Object.prototype... not good if the key is, say "is".... )

opfertunes avatar Jul 16 '16 02:07 opfertunes