Permalink
Browse files

Do not validate options before passing it to initialize as we don't h…

…ave validators on listeners (+ target will only register listener functions).
  • Loading branch information...
Gozala committed Mar 12, 2012
1 parent 224d1bd commit ed6a72c80500c0cf04ccbf28febbccdd99ce7226
Showing with 2 additions and 4 deletions.
  1. +2 −4 packages/addon-kit/lib/request.js
@@ -94,15 +94,13 @@ function runRequest(mode, target) {
const Request = EventTarget.extend({
initialize: function initialize(options) {
- options = validateOptions(options);
-
// `EventTarget.initialize` will set event listeners that are named
// like `onEvent` in this case `onComplete` listener will be set to
// `complete` event.
EventTarget.initialize.call(this, options);
- // copy options.
- merge(request(this), options);
+ // Copy normalized options.
+ merge(request(this), validateOptions(options));
},
get url() { return request(this).url; },
set url(value) { request(this).url = validateSingleOption('url', value); },

0 comments on commit ed6a72c

Please sign in to comment.