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

Reserved keys global, self in appx of alipay #2070

Closed
doxiaodong opened this issue Aug 8, 2019 · 2 comments · Fixed by #2071
Closed

Reserved keys global, self in appx of alipay #2070

doxiaodong opened this issue Aug 8, 2019 · 2 comments · Fixed by #2071
Labels

Comments

@doxiaodong
Copy link
Contributor

doxiaodong commented Aug 8, 2019

When I run mobx in appx of alipay,it's thow error caused by self in

function self() {

and global in
export function getGlobal() {

in Alipay appx, the global , self cannot be used and defined.
image

It can be fixed simply by

function _self() {
  return this;
}

and

const mockGlobal = {};
function getGlobal() {
  if (ypeof window !== "undefined") {
    return window;
  }
  if (typeof global !== "undefined") {
    return global;
  }
  return mockGlobal;
}

finally, it's better to update both v4 and v5

@doxiaodong doxiaodong changed the title Reserved key global, self in appx of alipay Reserved keys global, self in appx of alipay Aug 8, 2019
@danielkcz
Copy link
Contributor

That's some really awkward platform having a problem with something like that :) I suppose it cannot hurt anything, so if you are willing to provide PR for both versions, it will likely be merged.

@lock
Copy link

lock bot commented Oct 8, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or questions.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants