Skip to content
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

Usage of import as method names #380

Closed
martines3000 opened this issue Mar 24, 2024 · 3 comments
Closed

Usage of import as method names #380

martines3000 opened this issue Mar 24, 2024 · 3 comments

Comments

@martines3000
Copy link

Hi. We are developing a project that is running inside a hardened JavaScript environment called SES (Secure EcmaScript) and this library is one of our sub-dependencies. SES doesn't allow overriding “reserved” keywords like import and this causes many issues for us.

My question is if it would be possible to maybe rename methods like this:

import(stream) {

from import(stream) to something like _import(stream). This would solve our problems.

Thank you for the help.

@RubenVerborgh
Copy link
Member

Hi @martines3000, we can't because this method name is prescribed by http://rdf.js.org/stream-spec/

Perhaps monkey patching (there exist npm tools for this) might help you out.

@martines3000
Copy link
Author

martines3000 commented Mar 24, 2024

@RubenVerborgh
Hi, thanks for the quick reply.

I am already doing that, but it is quite tedious as I need to patch multiple libraries and rebuild a some of them.

Is there maybe a way to raise the issue to the specification writers, as I think it is also not a good practice to use “reserved” keywords like that as method names?

@RubenVerborgh
Copy link
Member

Indeed; the spec repository is part of this GitHub organization, would be good to raise it there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants