镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

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

Description

@comods
  • 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?

Activity

  1. cjihrig commented on Jan 4, 2019

    @cjihrig
    Contributor

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

  2. comods commented on Jan 4, 2019

    @comods
    ContributorAuthor

    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.

  3. cjihrig commented on May 2, 2019

    @cjihrig
    Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions