Index: mojo/public/js/bindings/connection.js |
diff --git a/mojo/public/js/bindings/connection.js b/mojo/public/js/bindings/connection.js |
index ebf60adb7f8de5a94014d762db9c1ecbc0d8c356..a92d05129e0962028b4b13faa99915f25d500681 100644 |
--- a/mojo/public/js/bindings/connection.js |
+++ b/mojo/public/js/bindings/connection.js |
@@ -6,11 +6,18 @@ define("mojo/public/js/bindings/connection", [ |
"mojo/public/js/bindings/router", |
], function(router) { |
+ function getValidators(factory) { |
+ var validators = factory.prototype.validators; |
+ return Array.isArray(validators) ? validators : []; |
+ } |
+ |
function Connection(handle, localFactory, remoteFactory) { |
this.router_ = new router.Router(handle); |
this.remote = new remoteFactory(this.router_); |
this.local = new localFactory(this.remote); |
this.router_.setIncomingReceiver(this.local); |
+ this.router_.setValidators( |
+ getValidators(localFactory).concat(getValidators(remoteFactory))); |
} |
Connection.prototype.close = function() { |