You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a silly thing but it's been bugging me. Mostly the spec uses the term report to refer to the larger thing (eg. that has a type) and body to refer to the the type-specific data structure. But then the exposed property name for the body is "report".
This leads to awkward observer code like report.report.
Can we just rename the property to body to match the spec terminology?
Alternately, since we likely want a WebIDL definition for each report type (at least those exposed via #29), we could recast the spec in terms of those types instead of a generic notion of "any objection which can be serialized to JSON" (which itself is problematic), and then the body could just be contained directly in the report via interface inheritance:
The text was updated successfully, but these errors were encountered:
RByers
changed the title
The report having a member report is potentially confusing
The report having a property named report is confusing
May 30, 2017
Renaming the property to body sounds perfectly fine to me. I think I like that clear separation between the generic reporting API stuff, and the stuff specific to a specific thing that's being reported. It also resolves the question that will inevitably crop up when a feature has a property that collides with a generic reporting API property (e.g. assume your example had deprecation "types").
RByers
added a commit
to RByers/reporting
that referenced
this issue
May 31, 2017
By the way, I think we might still want to define the reports in terms of WebIDL interfaces instead of just "JSON serializable ECMAScript objects", but we can discuss that separately as part of the spec work for #29.
Uh oh!
There was an error while loading. Please reload this page.
This is a silly thing but it's been bugging me. Mostly the spec uses the term report to refer to the larger thing (eg. that has a
type
) and body to refer to the the type-specific data structure. But then the exposed property name for the body is "report".This leads to awkward observer code like
report.report
.Can we just rename the property to
body
to match the spec terminology?Alternately, since we likely want a WebIDL definition for each report type (at least those exposed via #29), we could recast the spec in terms of those types instead of a generic notion of "any objection which can be serialized to JSON" (which itself is problematic), and then the body could just be contained directly in the report via interface inheritance:
@mikewest @juliatuttle
The text was updated successfully, but these errors were encountered: