Skip to content

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

@moll

Description

@moll

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.

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