-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
- Rollup Version: 1.19.4
- Operating System (or Browser):
- Node Version:
How Do We Reproduce?
rollup options:
output.format = 'cjs'main.js:
import * as y from './mod.js';
export var x = 0;
export var __proto__ = y;
export var z = 2;mod.js:
export var a = 0;
export var __proto__ = 1;
export var b = 2;Expected Behavior
output[0].code:
var a = 0;
var __proto__ = 1;
var b = 2;
var y = {
a: a,
__proto__: null,// case 2
b: b
};
y.__proto__ = __proto__;
exports.x = 0;
exports.__proto__ = null;// case 1
exports.__proto__ = y;
exports.z = 2;Actual Behavior
output[0].code:
var a = 0;
var __proto__ = 1;
var b = 2;
var y = {
a: a,
__proto__: __proto__,
b: b
};
exports.x = 0;
exports.__proto__ = y;
exports.z = 2;case 1: Set property __proto__ to null before really set it would be safer.
case 2: Declare property __proto__ as null, and set it later.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels