Skip to content
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

Error: get_uid() does not work in the Shared Worker #14

Closed
samchon opened this issue Oct 30, 2018 · 1 comment
Closed

Error: get_uid() does not work in the Shared Worker #14

samchon opened this issue Oct 30, 2018 · 1 comment
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@samchon
Copy link
Owner

samchon commented Oct 30, 2018

Summary

  • TSTL Version: 2.0.8
  • Environment: SharedWorker
  • Expected behavior: Works correctly
  • Actual behavior: Throws undefined property (window).

Code occuring the bug

export function _Get_root(): IGlobal
{
	if (__s_pRoot === null)
	{
		__s_pRoot = (is_node() ? global : window) as IGlobal;
		if (__s_pRoot.__s_iUID === undefined)
			__s_pRoot.__s_iUID = 0;
	}
	return __s_pRoot;
}
@samchon
Copy link
Owner Author

samchon commented Nov 5, 2018

Solution is to using self instead of the window.

The solution has been adopted until the v2.0.9 update

@samchon samchon added the bug Something isn't working label Nov 5, 2018
@samchon samchon closed this as completed Nov 5, 2018
@samchon samchon self-assigned this Nov 6, 2018
@samchon samchon added the fixed label Nov 6, 2018
@samchon samchon reopened this Nov 13, 2018
@samchon samchon added v2.1 and removed fixed labels Nov 13, 2018
@samchon samchon closed this as completed Nov 14, 2018
@samchon samchon added the enhancement New feature or request label Dec 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant