Closed Bug 855030 Opened 11 years ago Closed 11 years ago

Parser.jsm should support fat arrow functions

Categories

(DevTools :: Debugger, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 22

People

(Reporter: vporof, Assigned: vporof)

Details

Attachments

(2 files)

      No description provided.
Assignee: nobody → vporof
Status: NEW → ASSIGNED
Attached patch v1Splinter Review
Attachment #729741 - Flags: review?(past)
Comment on attachment 729741 [details] [diff] [review]
v1

Review of attachment 729741 [details] [diff] [review]:
-----------------------------------------------------------------

That was fast!

::: browser/devtools/shared/Parser.jsm
@@ +1559,5 @@
>    /**
> +   * An arrow expression.
> +   *
> +   * interface FunctionExpression <: Function, Expression {
> +   *   type: "FunctionExpression";

ArrowExpression in both places.

@@ +1568,5 @@
> +   *   generator: boolean;
> +   *   expression: boolean;
> +   * }
> +   */
> +  ArrowExpression: function STV_ArrowExpression(aNode, aParent, aCallbacks) {

You could make FunctionExpression call this one to cut down on code size, but I think the whole file could use a similar refactoring, so we could do it in a followup.
Attachment #729741 - Flags: review?(past) → review+
(In reply to Panos Astithas [:past] from comment #3)
> 
> You could make FunctionExpression call this one to cut down on code size,
> but I think the whole file could use a similar refactoring, so we could do
> it in a followup.

Theoretically yes, I could even reduce both ArrowExpression and FunctionExpression to call FunctionDeclaration, as long as I don't always assume that they have a non-null identifier, but you never know how these language features may evolve, so I think the DRY approach is less pertinent here. Let's see what happens wrt thin arrow functions (if that ever becomes a reality), how the spec evolves etc.
Attached patch v1.1Splinter Review
s/Function/Arrow/
Attachment #730203 - Flags: review+
Whiteboard: [land-in-fx-team]
Priority: -- → P3
https://hg.mozilla.org/integration/fx-team/rev/d68b52ce9322
Whiteboard: [land-in-fx-team] → [fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/d68b52ce9322
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 22
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: