Closed Bug 1577060 Opened 6 years ago Closed 6 years ago

js-analyze.js doesn't handle ClassField AST nodes

Categories

(Webtools :: Searchfox, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: asuth, Assigned: asuth)

References

()

Details

Attachments

(1 file)

SpiderMonkey added support for JS class fields in bug 1499448 which is an implementation of https://github.com/tc39/proposal-class-fields. js-analyze.js just started exploding today on https://hg.mozilla.org/mozilla-central/file/tip/devtools/client/debugger/src/workers/parser/tests/fixtures/class.js#l10.

Fix coming. I modified some_javascript.js to have the following revised class at the top:

class Foo {
  static bar(baz) {
    return baz;
  }

  wacky_field = b => {
    return b * 2;
  };
}

I've attached the prettified JSON AST from the exception logged on wacky_field.

Summary: js-analyze.js doesn't expected ClassField AST nodes → js-analyze.js doesn't handle ClassField AST nodes

It turns out the static bar() {...} in the example above seemed to the break the parser/my expectations about the parser in some way that caused ClassField nodes to silently not be emitted at all, which made things confusing as I tried to figure out how to deal with the implications of private fields for searchfox symbol generation purposes.

I'll continue to try and pursue making the anlyzer understand fields and perhaps file spin-off JS engine bugs as appropriate, but in the meantime a quick mitigation fix is to add --disable-experimental-fields to our js invocation so we just don't get ClassField nodes.

A new release/master run successfully completed with the landed fix at 1:03am eastern.

Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: