Skip to content

Expando use-before-def error incorrectly appears cross-module #27197

@sandersn

Description

@sandersn
// File: mod1.js
const util = exports = module.exports = {}
util.existy = function () {}
// File: main.js
const util = require('./mod1')
function n() { util.existy }

Expected behavior:
No use-before-def error.

Actual behavior:
Use-before-def error on util.existy. But there isn't one when util.existy is used at the toplevel.

Metadata

Metadata

Assignees

Labels

DuplicateAn existing issue was already created

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions