-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
Describe the bug
A property definition of the form
__proto__
: value or "__proto__
": value does not create a property with the name__proto__
. Instead, if the provided value is an object or null, it points the [[Prototype]] of the created object to that value. (If the value is not an object or null, the object is not changed.)
Input code
export const __proto__ = 1;
export const another = 2;
Config
{
"jsc": {
"parser": {
"syntax": "ecmascript",
},
"target": "es2024"
},
"module": {
"type": "commonjs"
},
"isModule": true
}
Link to the code that reproduces this issue
SWC Info output
No response
Expected behavior
The __proto__
name should be exported as a named binding.
Actual behavior
_export(exports, {
__proto__: function() {
return __proto__;
},
another: function() {
return another;
}
});
__proto__
is recognized as the prototype setter and is not exported.
Version
1.11.24
Additional context
No response