microsoft / microsoft/TypeScript

Javascript modules should be able to pass the exported value to child modules

Open
#22,433 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug checkJs Domain: JavaScript
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

TypeScript Version: 2.7.0-dev.201xxxxx

Search Terms:

Code

// @noEmit: true
// @allowJs: true
// @checkJs: true
// @Filename: bluebird.js
var bluebird = require('./promise')()
bluebird.promisify
bluebird.outer
module.exports = bluebird
// @Filename: promise.js
module.exports = function() {
    function Promise() {
    }
    Promise.outer = function () {
    }
    require('./promisify')(Promise)
    Promise.promisify
    Promise.outer
    return Promise
}
// @Filename: promisify.js
module.exports = function (Promise) {
    Promise.promisify = function () {
    }
}

Expected behavior:
Bluebird's assignments to Promise in both promise.js and promisify.js should be visible in both promise.js and bluebird.js

Actual behavior:
promisify is not recognised in promise.js or bluebird.js. This seems very difficult to track statically, especially in the binder.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the three-file reproduction in bluebird.js, promise.js, and promisify.js, then inspect the binder behavior involved in tracking assignments across required modules. Done means the promisify assignment is recognized in both promise.js and bluebird.js, alongside the existing Promise and bluebird properties.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.