whatwg / fs

File System Standard
https://fs.spec.whatwg.org/
Other
238 stars 20 forks source link

resolve() needs real definition in the spec #43

Closed jesup closed 1 year ago

jesup commented 2 years ago

There's only a single line of normative definition for resolve() (which per other discussion here should be renamed). The non-normative language is fairly complete.

mkruisselbrink commented 2 years ago

While not perfect, https://fs.spec.whatwg.org/#entry-resolve (which the one line of definition you mention links to) does seem like a fairly complete definition? Of course I wouldn't expect any implementation to actually implement the algorithm as written (since that would probably be the least efficient way of implementing the operation), but I do believe the normative language does do a fairly complete job of describing the exact desired behavior.

jesup commented 2 years ago

Aha. What surprised me was that "resolving" (invoked by reference there) wasn't in the resolve() definition -- and "resolving" is only referenced from resolve() (and from itself). Perhaps it should just be moved to resolve()...

a-sully commented 1 year ago

It seems reasonable to move it within the resolve() method algorithm since it's only referenced there... though I expect we may need to re-using this definition in some upcoming work, in which case we'd have to move the definition back to where it is now. I personally don't think it's worth the effort, but if you put up a PR to move the definition I'm happy to approve it.