Skip to content

JS: Fixed ReferenceError: window is not defined #9156

Merged
acozzette merged 1 commit intoprotocolbuffers:masterfrom
marnixbouhuis:fix/window-undefined
Oct 26, 2021
Merged

JS: Fixed ReferenceError: window is not defined #9156
acozzette merged 1 commit intoprotocolbuffers:masterfrom
marnixbouhuis:fix/window-undefined

Conversation

@marnixbouhuis
Copy link
Contributor

PR #8864 introduced a bug (#9152) in generated JS code where it would error getting the global object saying that window is undefined.

I've missed this scenario in my original PR so this PR is here to make the functionality more robust.
This PR fixes this issue by explicitly checking if window is defined.

@google-cla google-cla bot added the cla: yes label Oct 26, 2021
@marnixbouhuis marnixbouhuis changed the title Fixed ReferenceError: window is not defined for nodejs JS: Fixed ReferenceError: window is not defined Oct 26, 2021
@acozzette acozzette merged commit e350ef8 into protocolbuffers:master Oct 26, 2021
@acozzette
Copy link

@marnixbouhuis Thanks!

@marnixbouhuis marnixbouhuis deleted the fix/window-undefined branch October 27, 2021 07:34
acozzette pushed a commit to acozzette/protobuf that referenced this pull request Oct 28, 2021
@arrony6585
Copy link

MarnixBouhuis:fix/window-undefined

@arrony6585
Copy link

I'll

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants