Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#51401 closed enhancement (fixed)

Docs: Fix bracket issue in autosave JS DocBlock

Reported by: dilipbheda's profile dilipbheda Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.6 Priority: normal
Severity: normal Version: 5.6
Component: Autosave Keywords: has-patch commit
Focuses: javascript, docs Cc:

Description

Fix inline documentation.

Attachments (2)

51401.patch (815 bytes) - added by dilipbheda 4 years ago.
51401.1.patch (893 bytes) - added by dilipbheda 4 years ago.
Updated patch

Download all attachments as: .zip

Change History (8)

@dilipbheda
4 years ago

#1 @mukesh27
4 years ago

  • Keywords needs-refresh added

Hi there!

The 51401.patch patch needs update because you have added an extra }.

<?php
/**
 * Auto saves the post.
 *
 * @since 3.9.0
 *
 * @return {Object} {
 *      {
 *      getPostData: getPostData,
 *      getCompareString: getCompareString,
 *      disableButtons: disableButtons,
 *      enableButtons: enableButtons,
 *      local: ({hasStorage, getSavedPostData, save, suspend, resume}|*),
 *      server: ({tempBlockSave, triggerSave, postChanged, suspend, resume}|*)
 *      }
 * } The object with all functions for autosave.
 */

@dilipbheda
4 years ago

Updated patch

#2 @dilipbheda
4 years ago

  • Keywords needs-refresh removed

#3 @dilipbheda
4 years ago

@mukesh27 I have removed extra }

Thank you

#4 @mukesh27
4 years ago

  • Keywords commit added
  • Type changed from defect (bug) to enhancement

51401.1.patch thanks for update.

Patch looks good. Marking for commit.

#5 @SergeyBiryukov
4 years ago

  • Milestone changed from Awaiting Review to 5.6
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

Thanks for the patch!

I haven't found any other instances in core where we document object properties like this, but the closest match appears to be the "Record Type" from Google JavaScript Style Guide:

{{myNum: number, myObject}}

So it looks like double brackets are OK, let's just correct the second bracket placement.

#6 @SergeyBiryukov
4 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 49065:

Docs: Correct formatting for the autosave() function return value in js/_enqueues/wp/autosave.js.

Props dilipbheda, mukesh27.
Fixes #51401.

Note: See TracTickets for help on using tickets.