mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Our version of underscore doesn't have 'partial' anymore since we
downgraded. Missed one instance of this because I missed arrays in the EJSON support in mongo testing.
This commit is contained in:
committed by
Nick Martin
parent
9b74af5b2a
commit
bc2be8bb58
@@ -15,7 +15,7 @@ var Future = Npm.require(path.join('fibers', 'future'));
|
||||
var replaceNames = function (filter, thing) {
|
||||
if (typeof thing === "object") {
|
||||
if (_.isArray(thing)) {
|
||||
return _.map(thing, _.partial(replaceNames, filter));
|
||||
return _.map(thing, _.bind(replaceNames, null, filter));
|
||||
}
|
||||
var ret = {};
|
||||
_.each(thing, function (value, key) {
|
||||
|
||||
@@ -27,22 +27,24 @@ Meteor._FailureTestCollection =
|
||||
new Meteor.Collection("___meteor_failure_test_collection");
|
||||
|
||||
// For test "document with a custom type"
|
||||
var Dog = function (name, color) {
|
||||
var Dog = function (name, color, actions) {
|
||||
var self = this;
|
||||
self.color = color;
|
||||
self.name = name;
|
||||
self.actions = actions || [{name: "wag"}, {name: "swim"}];
|
||||
};
|
||||
_.extend(Dog.prototype, {
|
||||
getName: function () { return this.name;},
|
||||
getColor: function () { return this.name;},
|
||||
equals: function (other) { return other.name === this.name &&
|
||||
other.color === this.color; },
|
||||
toJSONValue: function () { return {color: this.color, name: this.name};},
|
||||
other.color === this.color &&
|
||||
EJSON.equals(other.actions, this.actions);},
|
||||
toJSONValue: function () { return {color: this.color, name: this.name, actions: this.actions};},
|
||||
typeName: function () { return "dog"; },
|
||||
clone: function () { return new Dog(this.name, this.color); },
|
||||
speak: function () { return "woof"; }
|
||||
});
|
||||
EJSON.addType("dog", function (o) { return new Dog(o.name, o.color);});
|
||||
EJSON.addType("dog", function (o) { return new Dog(o.name, o.color, o.actions);});
|
||||
|
||||
|
||||
// Parameterize tests.
|
||||
|
||||
Reference in New Issue
Block a user