Skip to content

[Bug]: Wrong export value of __proto__ in CommonJS #16014

Description

@magic-akari

💻

  • Would you like to work on a fix?

How are you using Babel?

Programmatic API (babel.transform, babel.parse)

Input code

export const __proto__ = null;

import { __proto__ as p } from "./index.js";

console.log(p);

Playground

Configuration file name

No response

Configuration

No response

Current and expected behavior

run node index.js

Expected behavior:
null should be printed.
Actual behavior:
undefined is printed.

Environment

latest version

Possible solution

Use [[Define]] semantic for __proto__ export name.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    i: needs triageoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issue

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions