You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Dojo 2, we provide a shim for Symbol. One of the things we have decided to do as a matter of principal is not modify the global namespace with any of our shims, but provide them as modules where the consumer has to make an explicit dependency on that shim. At runtime, we offload to the native API if present, otherwise we provide replicate functionality.
This pattern works effectively, even when targeting ES6, except for Symbol because of the TypeScript's compiler's insistence that we reference the native one.
Is there a good reason why TypeScript disallows this when targeting ES6? If so, is there any way to provide a transparent shim without modifying the global namespace anyone can think of?
Expected behavior:
No errors when targeting es6.
Actual behavior:
When target is es6 we get the following error:
'Symbol' reference does not refer to the global Symbol constructor object.
The text was updated successfully, but these errors were encountered:
TypeScript Version:
1.8.10
Code
In Dojo 2, we provide a shim for
Symbol
. One of the things we have decided to do as a matter of principal is not modify the global namespace with any of our shims, but provide them as modules where the consumer has to make an explicit dependency on that shim. At runtime, we offload to the native API if present, otherwise we provide replicate functionality.This pattern works effectively, even when targeting ES6, except for
Symbol
because of the TypeScript's compiler's insistence that we reference the native one.Is there a good reason why TypeScript disallows this when targeting ES6? If so, is there any way to provide a transparent shim without modifying the global namespace anyone can think of?
Expected behavior:
No errors when targeting
es6
.Actual behavior:
When target is
es6
we get the following error:The text was updated successfully, but these errors were encountered: