Skip to content

Promises polyfill does not support chaining then and catch #57722

@blutorange

Description

@blutorange
  • VSCode Version: 1.28.0
  • OS Version: Debian GNU/Linux buster/sid , Linux 4.16.0-2-amd64 1 SMP Debian 4.16.16-2 (2018-06-22) x86_64 GNU/Linux

Steps to Reproduce:

There is a Promise polyfill (class PolyfillPromise) defined in vscode/src/vs/base/common/winjs.polyfill.promise.ts. The comments say A polyfill for the native promises, but the then and catch methods do not support chaining, eg.

PolyfillPromise.resolve(1).then(function(x){return x+1}).then(function(x){console.log("Result is " + x)})

will print Result is undefined (it should print Result is 2).

Chaining is a very common operation with Promises. IE11 does not have native promises, so it uses the polyfill. This results in the ESM build of https://github.com/Microsoft/monaco-editor not working in IE11, as webpack uses Promises for dynamic imports.

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugverifiedVerification succeeded

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions