Ben Newman
58bdfe024d
Shallow-clone inserted documents more reliably.
...
In a previous commit, I changed
doc = _.extend({}, doc);
to avoid using underscore, thus:
doc = { ...doc };
While this may seem harmless, it broke a few Mongo.Collection tests
because _.extend copies *all* properties, both own and inherited, whereas
object ...spread only copies own properties.
However, the correct way to fix this problem is *not* to revert to the old
behavior, since flattening the inherited properties of a document was
never actually what we wanted. The old behavior was subtly broken, too.
Instead, we need to create a new object with the same prototoype as the
provided document, then shallow-copy the own properties. Any properties or
methods inherited from the original prototype will then be available on
the new object, even though they didn't get copied over.
I've intentionally left some trivial formatting changes in this commit to
remind myself which broken tests were fixed by this change.
2017-12-07 19:20:22 -05:00
..
2017-09-29 17:14:38 -04:00
2017-06-30 10:54:53 +03:00
2017-04-19 11:17:53 -04:00
2017-04-19 11:17:53 -04:00
2017-04-19 11:17:53 -04:00
2017-04-19 11:17:53 -04:00
2016-11-08 15:42:56 -05:00
2017-07-20 10:21:55 -04:00
2017-04-19 11:17:53 -04:00
2016-08-30 15:40:14 -07:00
2017-03-14 10:53:26 +02:00
2017-04-19 11:17:53 -04:00
2017-09-14 15:36:13 +03:00
2016-12-21 13:17:03 -05:00
2016-08-30 15:40:14 -07:00
2016-08-30 15:40:14 -07:00
2016-12-21 13:17:03 -05:00
2017-09-07 17:17:27 -04:00
2016-11-15 19:59:10 -05:00
2016-10-25 10:20:21 -07:00
2016-10-25 10:20:21 -07:00
2017-09-05 14:17:16 +03:00
2017-09-05 14:17:16 +03:00
2017-02-02 15:54:30 -05:00
2016-10-25 10:20:21 -07:00
2017-02-02 15:54:30 -05:00
2017-02-02 15:54:30 -05:00
2016-11-08 15:42:56 -05:00
2016-10-25 10:20:21 -07:00
2017-03-09 19:39:52 +02:00
2017-08-08 18:01:30 -04:00
2017-07-18 13:53:49 -04:00
2017-09-14 23:42:02 +03:00
2017-09-20 14:49:34 -04:00
2017-07-12 16:07:33 -04:00
2017-05-24 10:27:06 -04:00
2017-09-18 14:22:16 -04:00
2017-08-24 07:19:29 -04:00
2016-08-30 15:40:14 -07:00
2016-10-25 10:20:21 -07:00
2016-08-30 15:40:14 -07:00
2017-09-18 12:36:00 -04:00
2017-09-26 11:46:09 -04:00
2017-06-07 20:45:36 -04:00
2017-07-13 17:46:48 -04:00
2017-05-30 14:18:48 -04:00
2017-09-05 14:17:16 +03:00
2017-06-02 18:07:51 +03:00
2016-10-25 10:20:21 -07:00
2017-02-10 18:45:22 -05:00
2017-06-30 10:54:50 +03:00
2016-10-25 10:20:21 -07:00
2017-09-13 11:38:18 -04:00
2017-09-13 11:38:18 -04:00
2016-10-25 10:20:21 -07:00
2017-02-10 18:45:22 -05:00
2017-02-10 18:45:22 -05:00
2017-02-10 18:45:22 -05:00
2017-04-25 16:05:10 -07:00
2016-08-30 15:40:14 -07:00
2017-03-14 10:53:26 +02:00
2016-10-25 10:20:21 -07:00
2016-08-30 15:40:14 -07:00
2016-10-25 10:20:21 -07:00
2017-06-21 14:07:52 -04:00
2016-10-25 10:20:21 -07:00
2017-07-18 13:53:49 -04:00
2017-02-08 15:55:28 -05:00
2016-08-30 15:40:14 -07:00
2017-07-13 09:28:59 -04:00
2017-07-18 13:53:49 -04:00
2016-10-25 10:20:21 -07:00
2017-04-07 18:50:17 +03:00
2017-02-10 18:45:22 -05:00
2017-05-02 10:56:09 +03:00
2017-09-18 14:22:16 -04:00
2017-05-30 14:18:48 -04:00
2017-02-10 18:45:22 -05:00
2017-02-10 18:45:22 -05:00
2017-11-08 22:22:39 +02:00
2016-08-30 15:40:14 -07:00
2017-02-08 15:46:27 -05:00
2017-09-25 18:18:40 -04:00
2017-09-26 10:50:57 -04:00
2017-09-25 18:18:40 -04:00
2017-07-18 13:53:49 -04:00
2017-09-05 14:17:16 +03:00
2017-09-18 11:39:45 -04:00
2017-12-07 19:20:22 -05:00
2017-09-05 14:17:16 +03:00
2016-10-25 10:20:21 -07:00
2016-08-30 15:40:14 -07:00
2017-09-18 17:19:53 -04:00
2017-06-16 19:48:54 +03:00
2017-07-21 13:43:12 +03:00
2017-07-18 13:53:49 -04:00
2016-10-25 10:20:21 -07:00
2016-10-25 10:20:21 -07:00
2016-10-25 10:20:21 -07:00
2017-03-14 10:53:26 +02:00
2016-10-25 10:20:21 -07:00
2016-08-30 15:40:14 -07:00
2017-08-08 18:01:30 -04:00
2017-09-05 14:17:16 +03:00
2016-08-30 15:40:14 -07:00
2017-04-07 13:55:36 +03:00
2017-05-30 15:27:50 -04:00
2016-10-25 10:20:21 -07:00
2016-12-21 13:17:03 -05:00
2017-02-10 18:45:22 -05:00
2016-10-25 10:20:21 -07:00
2016-12-21 13:17:03 -05:00
2017-07-12 16:07:33 -04:00
2016-10-25 10:20:21 -07:00
2016-10-25 10:20:21 -07:00
2016-10-25 10:20:21 -07:00
2017-07-12 16:07:33 -04:00
2016-08-30 15:40:14 -07:00
2016-10-25 10:20:21 -07:00
2017-09-18 16:25:18 -04:00
2017-09-25 18:18:40 -04:00
2017-04-07 18:50:17 +03:00
2017-02-08 15:38:28 -05:00
2016-10-25 10:20:21 -07:00
2017-09-05 14:17:16 +03:00
2017-03-06 20:48:55 -05:00
2016-10-25 10:20:21 -07:00
2016-10-25 10:20:21 -07:00
2016-08-30 15:40:14 -07:00
2017-05-02 10:56:09 +03:00
2017-02-10 18:45:22 -05:00
2017-02-10 18:45:22 -05:00
2016-10-25 10:20:21 -07:00
2016-08-30 15:40:14 -07:00
2017-02-10 18:45:22 -05:00
2017-09-13 11:37:27 -04:00
2016-08-30 15:40:14 -07:00
2017-02-10 18:45:22 -05:00
2017-02-10 18:45:22 -05:00
2016-10-25 10:20:21 -07:00
2016-09-26 15:32:08 +03:00