Closed Bug 653464 Opened 10 years ago Closed 10 years ago

Cortext throw exception on properties without setter

Categories

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

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ochameau, Assigned: irakli)

Details

Attachments

(1 file)

If we are using ES5 defineProperties on an object and we do not provide a setter, if we give such object to Cortex, we got this exception:
Trace:
    this._public = Cortex(this);
  File "resource://addon-kit-api-utils-lib/cortex.js", line 134, in Cortex
    Object.getOwnPropertyNames(object).forEach(function (name) {
  File "resource://addon-kit-api-utils-lib/cortex.js", line 136, in
    defineAlias(object, cortex, name);
  File "resource://addon-kit-api-utils-lib/cortex.js", line 104, in defineAlias
    createAliasProperty(source, name));
  File "resource://addon-kit-api-utils-lib/cortex.js", line 75, in createAliasPr
operty
    descriptor.set = property.set.bind(object);
TypeError: property.set is undefined


I faced this bug when I was working on bug 630962, I used a workaround this exception that will need to be removed. (widget.js:Model.setAttributes)
Priority: -- → P2
Target Milestone: --- → 1.0
(automatic reprioritization of 1.0 bugs)
Priority: P2 → P1
Target Milestone: 1.0 → 1.1
Assignee: nobody → rFobic
Comment on attachment 542790 [details]
Pointer to Github pull request: https://github.com/mozilla/addon-sdk/pull/199

Dietrich can you take a look at this ?
Attachment #542790 - Flags: review?(dietrich)
Attachment #542790 - Flags: review?(dietrich) → review+
Thanks Dietrich!

https://github.com/mozilla/addon-sdk/commit/2522f642a8144a7a809581f1d3515474918c0d0c
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.