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

'crypto' is broken with '--throw-deprecation' #25334

Closed
comods opened this issue Jan 4, 2019 · 3 comments
Closed

'crypto' is broken with '--throw-deprecation' #25334

comods opened this issue Jan 4, 2019 · 3 comments

Comments

@comods
Copy link
Contributor

comods commented Jan 4, 2019

  • Version: 11.6.0
  • Platform: Windows 7 64bit
  • Subsystem: crypto

module 'crypto' is broken as it doesn't work at all with '--throw-deprecation'.

C:\>node --experimental-modules --throw-deprecation test.mjs
//test.mjs
import 'crypto';

My understanding is that 'crypto' is not deprecated, only crypto.DEFAULT_ENCODING is. So crypto needs to still work with --throw-deprecation! If 'crypto' in its entirity is deprecated, then what is the migration path for crypto.randomBytes?

@cjihrig
Copy link
Contributor

cjihrig commented Jan 4, 2019

I believe this is fixed on master by #23222, and will be released in Node 12.0.0.

@comods
Copy link
Contributor Author

comods commented Jan 4, 2019

Could the following test be added to every internal module?

For each module, have a test that runs on 'node --throw-deprecation' and imports the module. If any part of the module is not deprecated, then just importing should never throw an error. Only accessing the deprecated parts of the module should.

If the entire module is deprecated, this unit test would be marked as failed until manually removed for just this module.

@cjihrig
Copy link
Contributor

cjihrig commented May 2, 2019

Closing as resolved. If you want to send a PR adding a test, feel free.

@cjihrig cjihrig closed this as completed May 2, 2019
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