c31808922d
Previously, this would assert: ```ts exports.undeclared.n = 1; ``` Because undeclared was never declared in any recognised way. Now it no longer asserts, but does not bind. That's because the full pattern starts with the line `exports = require('./x')` and assumes that x.js declares `undeclared`. I am not sure how to bind this. The new test contains this pattern in case I figure it out.
23 lines
445 B
TypeScript
23 lines
445 B
TypeScript
// @allowJs: true
|
|
// @checkJs: true
|
|
// @noEmit: true
|
|
|
|
// @Filename: mod.js
|
|
// Based on a pattern from adonis
|
|
exports.formatters = {}
|
|
// @Filename: first.js
|
|
exports = require('./mod')
|
|
exports.formatters.j = function (v) {
|
|
return v
|
|
}
|
|
// @Filename: second.js
|
|
exports = require('./mod')
|
|
exports.formatters.o = function (v) {
|
|
return v
|
|
}
|
|
|
|
// @Filename: use.js
|
|
import * as debug from './mod'
|
|
|
|
debug.formatters.j
|
|
var one = debug.formatters.o(1)
|