Skip to content

Do not redefine __asyncValues if it already exists#20460

Merged
mhegazy merged 1 commit intomicrosoft:masterfrom
martinhiller:issue20408
Jan 4, 2018
Merged

Do not redefine __asyncValues if it already exists#20460
mhegazy merged 1 commit intomicrosoft:masterfrom
martinhiller:issue20408

Conversation

@martinhiller
Copy link
Copy Markdown
Contributor

The emitted declaration for the __asyncValues variable checked for the global property __asyncIterable instead of its actual declared name __asyncValues.

Now the __asyncValues variable is not redefined if it is already present as global variable.

Fixes #20408.

@msftclas
Copy link
Copy Markdown

msftclas commented Dec 4, 2017

CLA assistant check
All CLA requirements met.

var asyncValues = {
name: "typescript:asyncValues",
scoped: false,
text: "\n var __asyncValues = (this && this.__asyncIterator) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator];\n return m ? m.call(o) : typeof __values === \"function\" ? __values(o) : o[Symbol.iterator]();\n };\n "
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not change files in lib\* these are generated as part of the build. please remove these from the PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed all changes to the generated files in lib\*. Thanks for the hint.

The emitted declaration for the __asyncValues variable checked for the
global property __asyncIterable instead of its actual declared name
__asyncValues.

Now the __asyncValues variable is not redefined if it is already
present as global variable.

This commit fixes issue microsoft#20408.
@mhegazy mhegazy closed this Jan 4, 2018
@mhegazy mhegazy reopened this Jan 4, 2018
@mhegazy mhegazy merged commit e3a20e7 into microsoft:master Jan 4, 2018
@mhegazy
Copy link
Copy Markdown
Contributor

mhegazy commented Jan 4, 2018

thanks @martinhiller ! and sorry for the delay.

@microsoft microsoft locked and limited conversation to collaborators Jul 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants