Closed Bug 1209470 Opened 9 years ago Closed 9 years ago

Remove use of expression closure from Add-on SDK.

Categories

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

defect
Not set
normal

Tracking

(firefox44 fixed)

RESOLVED FIXED
mozilla44
Tracking Status
firefox44 --- fixed

People

(Reporter: arai, Assigned: arai)

References

Details

Attachments

(1 file)

Need to replace non-standard expression closure with one of:
  * function declaration
  * function expression
  * arrow function
before fixing bug 1083458.

converting rules are following:
  * function declaration
    add `return` and braces
  * standalone named function expression
    add `return` and braces
  * function expression, contains `arguments`
    add `return` and braces
  * standalone anonymous function expression contans and receives `this` (Array.filter, bind, etc)
    convert to arrow function, and remove code passing |this|
  * standalone anonymous function expression contans no `this`
    convert to arrow function
  * property with anonymous function expression, contains `this`
    add `return` and braces
  * property with anonymous function expression, contains no `this`, short body
    convert to arrow function
  * property with anonymous function expression, contains no `this`, long body
    add `return` and braces
  * property with named function expression
    add `return` and braces
  * getter property
    add `return` and braces
  * setter property
    add braces

I have draft patches, will post them after test.
Assignee: nobody → arai.unmht
Attachment #8667297 - Flags: review?(rFobic)
Attachment #8667297 - Flags: review?(rFobic) → review?(dtownsend)
oh, there's already conflict, let me fix it shortly.
that was a conflict with "let to var" patch.
updated :)
Comment on attachment 8667297 [details] [review]
Remove use of expression closure from Add-on SDK.

(In reply to Tooru Fujisawa [:arai] from comment #0)
> converting rules are following:
>   * function declaration
>     add `return` and braces
>   * standalone named function expression
>     add `return` and braces
>   * function expression, contains `arguments`
>     add `return` and braces
>   * standalone anonymous function expression contans and receives `this`
> (Array.filter, bind, etc)
>     convert to arrow function, and remove code passing |this|
>   * standalone anonymous function expression contans no `this`
>     convert to arrow function
>   * property with anonymous function expression, contains `this`
>     add `return` and braces
>   * property with anonymous function expression, contains no `this`, short
> body
>     convert to arrow function
>   * property with anonymous function expression, contains no `this`, long
> body
>     add `return` and braces
>   * property with named function expression
>     add `return` and braces
>   * getter property
>     add `return` and braces
>   * setter property
>     add braces

This looks like the right set of rules and skimming over the patch looks like everything is ok. I'm assuming everything passes on try with this applied in which case please land this in the addon-sdk tree in mercurial.
Attachment #8667297 - Flags: review?(dtownsend) → review+
https://hg.mozilla.org/mozilla-central/rev/6b3cd4c97272
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: