FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

FileSystemAccess.prototype.readText has an async interface, but is synchronous · Issue #537 · NativeScript/NativeScript · GitHub

FileSystemAccess.prototype.readText has an async interface, but is synchronous #537

Description

Hey,

I was going through the source code and stumbled upon something pretty weird.

new FileSystemAccess().readText(name, onSuccess, onError)

That's an async interface, but according to https://github.com/NativeScript/NativeScript/blob/5e5d75c09d8a3a49bbf6de5bfa53bc1736e99de4/apps/tests/file-system-access-tests/file-system-access-tests.ts and its use in builder.ts, it works synchronously. That's zalgo right there. A sync interface is handy, but the weird interface is, well, weird. It should return the content of the file on success and throw on error.

Cheers.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL