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

Fix instanceof checks for a cross-realm scenario #312

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

shau-kote
Copy link

@shau-kote shau-kote commented Oct 3, 2019

Hi.

The current getRenderProperties() implementation is nice, but it fails when a JS-code calling JsBarcode() and a target DOM element belong to different realms (= windows).
Yep, it is the real case in our internal codebase. :)

I have improved the implementation slightly by using explicit references to the appropriate classes instead of implicit global references.

Links with info:

  1. Determining with absolute accuracy whether or not a JavaScript object is an array. (In case of the cross-realm instanceof problem is unclear to you.)
  2. MDN: Node.ownerDocument.
  3. MDN: Document.defaultView.
  4. SO: How can I get the window object that an HTML node belongs to using JavaScript?.

@shau-kote
Copy link
Author

shau-kote commented Oct 3, 2019

Can somebody help me with he failed checks?

I have looked in the Travis logs and there are plenty of C++ compilation errors in the logs. And frankly, I have no idea what to do with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant