Closed Bug 877578 Opened 11 years ago Closed 11 years ago

apiUtils.validateOptions ignores default values once an error has been thrown

Categories

(Add-on SDK Graveyard :: General, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: robwu, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:21.0) Gecko/20100101 Firefox/21.0 (Beta/Release)
Build ID: 20130514193536

Steps to reproduce:

I defined a validator with at least two keys, and executed it on an empty object:

  let val = apiUtils.validateOptions({}, {
    bar: {
      map: function(v) { throw "bar" }
    },
    baz: {
      map: function(v) "foo"
    }
  });


Actual results:

The result was an empty object.


Expected results:

The result should consist of the key `baz` with value "foo".

Proposed a fix in https://github.com/mozilla/addon-sdk/pull/1006
Commit pushed to master at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/53c12b16b4cea1e535d1020d202d6c7875944905
Merge pull request #1006 from Rob--W/api-utils-validateOptions

Bug 877578 - Corrected implementation of validateOptions from api-utils r=erikvold
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Priority: -- → P2
Resolution: --- → FIXED
Commit pushed to integration at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/53c12b16b4cea1e535d1020d202d6c7875944905
Merge pull request #1006 from Rob--W/api-utils-validateOptions
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: