-
Notifications
You must be signed in to change notification settings - Fork 12.8k
TypeScript 3.0 language service isn't working properly in IE 11 (in Monaco Editor) #26090
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Bisecting shows that this problem started to appear with commit 9044589 (#24508). When I revert this commit on top of the current The commit changed the usage of an array to a However, I have not yet investigated what difference betwen the |
It seems the code in
However, the shim map uses a regular
Is it expected that the map is modified while Thanks! |
…t values that are added while forEach is running. Fixes microsoft#26090
Hi, I have created a commit (kpreisser@aa34bbf) to fix this issue. My idea was to create a keys array on the map when the first iterator or This fixes the issue with IE 11. However, the fix has a drawback because the map contains references to all active iterators (to be able to adjust their indexes when keys are removed).
If it is expected that the code can create iterators multiple times and throw them away before they are finished, this could be solved e.g. by only allowing one iterator at a time to be active (so that previously created iterators will then throw when their An alternative fix for this issue might be to always use a native map in Edit: My preferred solution would be to simply not support What do you think? Do you have other ideas how to fix this issue? Thanks! |
…ing iterators to continue once an entry has been deleted from the map. Fixes microsoft#26090
…t values that are added while forEach is running. Fixes microsoft#26090
…ing iterators to continue once an entry has been deleted from the map. Fixes microsoft#26090
Should be fixed. Sorry about that! |
fixe |
can you give me a reference of how the issue is being fixed? The problem still occurs for me when using the current Note that this issue only occurs when running the TypeScript Services in IE 11, e.g. using the Monaco Editor. Thanks! |
Hi @DanielRosenwasser, Please note that this issue is not the same as #26068; this one is caused due to the Thank you! |
…t values that are added while forEach is running. Fixes microsoft#26090
…ing iterators to continue once an entry has been deleted from the map. Fixes microsoft#26090
…t values that are added while forEach is running. Fixes microsoft#26090
…ing iterators to continue once an entry has been deleted from the map. Fixes microsoft#26090
Hi @DanielRosenwasser, Thank you! |
@kpreisser you're saying it's still present on |
I tested this issue by compiling TypeScript from commit 799656a, then using the Monaco Editor (0.15.6) and replacing the I think #28921 is unrelated to this issue because this issue is about the You can check this by adding the following code at the end of let myMap = createMap<string>();
myMap.set("1", "Original Value");
myMap.forEach((value, key) => {
console.log(`myMap: ${key}->${value}`);
// Add a new value - the map should provide this one in the next iteration.
if (key == "1")
myMap.set("0", "New Value");
}); Then, if you compile it and run it in IE 11, the console will show:
However, running it in any other browser (that supports a native
Now, because commit 9044589 changed the use of an array to a The result is what you can see in the screenshot of my first comment - the unkonwn variables in the inner function are not shown as errors when running the Monaco Editor/Playground in IE 11. In PR #27292, I changed the implementation of Thanks! |
…ave the same as with native Maps. This includes: - Entries are visited in insertion order - New entries added during iteration will be visited - Entries that are removed during iteration (before being visited) will not be visited Fixes microsoft#26090
…t values that are added while forEach is running. Fixes microsoft#26090
…ing iterators to continue once an entry has been deleted from the map. Fixes microsoft#26090
…ave the same as with native Maps. This includes: - Entries are visited in insertion order - New entries added during iteration will be visited - Entries that are removed during iteration (before being visited) will not be visited Fixes microsoft#26090
…t values that are added while forEach is running. Fixes microsoft#26090
…ing iterators to continue once an entry has been deleted from the map. Fixes microsoft#26090
…ave the same as with native Maps. This includes: - Entries are visited in insertion order - New entries added during iteration will be visited - Entries that are removed during iteration (before being visited) will not be visited Fixes microsoft#26090
This bug is now fixed as #27292 has been merged. |
TypeScript Version: 3.0.1-insiders.20180726
Search Terms: IE11, language service, monaco editor
Code
Open the TypeScript Playground (Monaco Editor using the language service of current TypeScript version
3.0.1-insiders.20180726
) in IE 11 (on Windows 10, 8.1 or 7) and enter the following code:Expected behavior:

The unknown properties and variables should be shown as error (which works in other browsers like Edge, Firefox, Chrome):
Actual behavior:

For the inner function, unknown properties/variables are not shown as error in IE 11:
With the previous playground version (I think 2.9.x), this worked correctly. I don't know what could cause this behavior in IE 11, since the console also doesn't show any errors.
Additionally, if you enable
noUnusedLocals
in the Monaco Editor, the editor will sometimes show variables as unused even though they are used (I currently don't have a screenshot of that).Unfortunately, for a software product at work we still need to use IE 11 (as WebBrowser control in a .NET app), so it would be nice if TypeScript with Monaco Editor would still work properly on IE 11.
Playground Link: http://www.typescriptlang.org/play/#src=%2F%2F%20In%20IE%2011%2C%20this%20doesn't%20show%20an%20error%3A%0D%0Alet%20f%20%3D%20function%20()%20%7B%0D%0A%20%20%20%20let%20g%20%3D%20function()%20%7B%0D%0A%20%20%20%20%20%20%20%20Math.xxxxxxxyyyyzzzz(aaaaaa%2C%20bbbbbb%2C%20ccccc)%3B%0D%0A%20%20%20%20%7D%3B%0D%0A%7D%3B%0D%0A%0D%0A%2F%2F%20This%20correctly%20shows%20an%20error%3A%0D%0AMath.xxxxxxxyyyyzzzz(aaaaaa%2C%20bbbbbb%2C%20ccccc)%3B%0D%0A%0D%0A
Thank you!
The text was updated successfully, but these errors were encountered: