-
Notifications
You must be signed in to change notification settings - Fork 469
Bindings where @scope
has same name as module can result in runtime errors
#7478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I think this is not a v12 issue per se, it's just that v12 doesn't escape If the module name is different, the same problem exists in v11: module URRL = {
@val @scope("URRL")
external revokeObjectURL: string => unit = "revokeObjectURL"
}
URRL.revokeObjectURL("some url") |
Ah I didn't read the breaking changes section of I'll update this issue title and description to not be v12 specific 👍 |
@scope
has same name as module@scope
has same name as module can result in runtime errors
This comment has been minimized.
This comment has been minimized.
I see. It should be something like: let URL$1 = {};
URL.revokeObjectURL("some url");
export {
URL$1 as URL,
} |
Workaround (IMO the correct resolution): module URL = {
@val @scope("globalThis.URL")
external revokeObjectURL: string => unit = "revokeObjectURL"
}
URL.revokeObjectURL("some url") |
Although this can be broken in basically the same way: module URL = {
@val @scope("globalThis.URL")
external revokeObjectURL: string => unit = "revokeObjectURL"
}
let globalThis = 0
URL.revokeObjectURL("some url") |
|
When a binding's
@scope
has the same name as a module, the binding's scope is shadowed by the module:The text was updated successfully, but these errors were encountered: