TypeScript/tests/cases/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.ts
Wesley Wigham 69b1cb5bac
Add new special assignment kinds for recognizing Object.defineProperty calls (#27208)
* Add new special assignment kinds for recognizing Object.defineProperty calls

* Add support for prototype assignments, fix nits

* Fix code review comments

* Add test documenting behavior in a few more odd scenarios
2018-10-19 14:31:55 -07:00

18 lines
462 B
TypeScript

// @allowJs: true
// @noEmit: true
// @checkJs: true
// @filename: namespacey.js
const A = {}
A.bar = class Q {}
module.exports = A;
// @filename: namespacer.js
const B = {}
B.NS = require("./namespacey");
Object.defineProperty(B, "NS", { value: "why though", writable: true });
module.exports = B;
// @filename: index.js
const _item = require("./namespacer");
module.exports = 12;
Object.defineProperty(module, "exports", { value: "oh no" });