Skip to content

Commit

Permalink
Do not validate options before passing it to initialize as we don't h…
Browse files Browse the repository at this point in the history
…ave validators on listeners (+ target will only register listener functions).
  • Loading branch information
Gozala committed Mar 12, 2012
1 parent 224d1bd commit ed6a72c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/addon-kit/lib/request.js
Expand Up @@ -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); },
Expand Down

0 comments on commit ed6a72c

Please sign in to comment.