Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Code correctness - setters don't return a value #280

Closed
@Rycochet

Description

@Rycochet

I'm creating a TypeScript definition file (will push back into the project when done), and noticed that every setter is also returning the value set - this does nothing and is unused, so thereturn itself can be removed (it's just wasting space and potentially creating confusion):

IE.https://github.com/guyonroche/exceljs/blob/master/lib/doc/cell.js#L85

getnumFmt(){returnthis.style.numFmt;},setnumFmt(value){returnthis.style.numFmt=value;},

...should be...

getnumFmt(){returnthis.style.numFmt;},setnumFmt(value){this.style.numFmt=value;},

A cascading sum likea = b = c will call the getter onc, then the setter onb, then the getter onb, and finally the setter ona.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/set

(Although it's not directly clear from the docs, there is an explicitreturn in the getter, and none in the setter, in addition to all the examples.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp