Annotate the stdlib's runtime classes
Why
Untagged variants recognized stdlib classes only by type name, with no relation between them, so a Blob case declared before a File case also caught files (#8938).
Types whose values are instances of a global class now say so with @instanceOf instead of @notUndefined, Symbol.t with @typeOf("symbol"), and File.t is a private abbreviation of Blob.t. JsError.t, Symbol.t and the Intl classes can be untagged variant cases too. Fixes #8938.
modifiedJS Blob and File cases
@unboxedtype upload = Blob(Blob.t) | File(File.t) let kind = upload => switch upload { | Blob(_) => "blob" | File(_) => "file" }
js
Before
After
if (upload instanceof Blob) {if (upload instanceof Blob && !(upload instanceof File)) { return "blob"; return "blob";} else {} else { return "file"; return "file";}}