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

Context hashing loop inserted at incorrect offset #43

Open
Siorki opened this issue Feb 21, 2016 · 1 comment
Open

Context hashing loop inserted at incorrect offset #43

Siorki opened this issue Feb 21, 2016 · 1 comment
Assignees
Labels

Comments

@Siorki
Copy link
Owner

Siorki commented Feb 21, 2016

Observed :
g=a.cloneNode();ac=g.getContext("2d")for(i in ;ac[c.at](innerWidth/)c[i[2]+[i[7]]]=i2,0);ac[c.a](innerHeight/128,innerHeight/128);

Reason : there are several 2D contexts in the code, and some of them are used before the last one is declared. RegPack always insert the hashing loop at the declaration of the last context, yet replaces methods earlier in the code (which in turns changes the offset).

A strategy is needed for cases where a context's methods are called before all contexts are used, such as :

c = a.getContext("2d");
c.fillStyle = "#fff";
c.fillRect(0,0,innerWidth,innerHeight);
na = a.cloneNode();
nc = na.getContext("2d");

One cannot iterate on nc before it is defined. But at this point methods from c have already been used.

@Siorki
Copy link
Owner Author

Siorki commented Feb 21, 2016

Possible solutions :

  • keep the loop at the definition of the last context, and do not perform replacements earlier
  • have multiple loops if a context is used before all assignments are done
  • reorder context declaration (might need heavy syntax processing)

@Siorki Siorki added the bug label Feb 24, 2016
@Siorki Siorki self-assigned this Feb 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant