Changes between Version 9 and Version 10 of WebInspectorCodingStyleGuide


Ignore:
Timestamp:
Feb 4, 2014 11:59:30 AM (10 years ago)
Author:
BJ Burg
Comment:

Tip about event naming convention

Legend:

Unmodified
Added
Removed
Modified
  • WebInspectorCodingStyleGuide

    v9 v10  
    2323* New class names should use the name of the base class as a suffix. (ex: `TimelinesContentView` < `ContentView`). Exceptions: classes extending `WebInspector.Object` (unless they are a represented object), and deep hierarchies such as `DebuggerSidebarPanel` < `NavigationSidebarPanel` < `SidebarPanel` < `Object`.
    2424* 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`.
     25* 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.
    2526
    2627== API preferences