Changes between Version 23 and Version 24 of WebInspectorCodingStyleGuide


Ignore:
Timestamp:
Dec 21, 2016, 10:22:00 AM (8 years ago)
Author:
BJ Burg
Comment:

Document naming of functions that get serialized and sent to another execution context

Legend:

Unmodified
Added
Removed
Modified
  • WebInspectorCodingStyleGuide

    v23 v24  
    2525* Spell out `identifier` instead of `id` if not doing so would result in a name ending with capitalized `Id`. For example, just `this.id` is fine, but `this.breakpointId` should be `this.breakpointIdentifier`.
    2626* An object's events live on the `Event` property of the constructor. Event names are properties on the `Event` object, and property values duplicate the event name, but are lowercased, hyphenated, and prefixed with the constructor name. See the skeleton example below.
     27* When serializing a function to be evaluated in a different execution context, such as from inspector to inspected page or layout test to inspector, make it obvious where the function is going to be evaluated. For example, if a function will be sent from Inspector context to inspected page context, the name `inspectedPage_node_getFlowInfo()` signifies that the function will be evaluated in the inspected page, with `this` bound to a node, and it performs the action `getFlowInfo`.
    2728
    2829== API preferences