Do not redefine __asyncValues if it already exists (#20460)

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 #20408.
This commit is contained in:
Martin Hiller
2018-01-04 02:18:15 +01:00
committed by Mohamed Hegazy
parent 7de8c6bcaa
commit e3a20e7f0a
12 changed files with 29 additions and 29 deletions

View File

@@ -968,7 +968,7 @@ namespace ts {
name: "typescript:asyncValues",
scoped: false,
text: `
var __asyncValues = (this && this.__asyncIterator) || function (o) {
var __asyncValues = (this && this.__asyncValues) || function (o) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var m = o[Symbol.asyncIterator];
return m ? m.call(o) : typeof __values === "function" ? __values(o) : o[Symbol.iterator]();