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

Unsure about the setter offset #104

Open
aswad546 opened this issue Jun 17, 2024 · 3 comments
Open

Unsure about the setter offset #104

aswad546 opened this issue Jun 17, 2024 · 3 comments

Comments

@aswad546
Copy link

aswad546 commented Jun 17, 2024

Hello,

I had a query about the offsets that visible v8 provides for specific APIs. Especially the offsets for setters (prefixed by s).

As an example I have the following code:

let attr1 = _MouseEvent.screenX_
let HTMLInputElement.value = attr1  // setter for API HTML Input Element.value
let a = HTMLInputElement.value  //getter example

The offset provided for the API HTMLInputElement.value will be a bit ahead in this case starting from the = sign instead of starting from v in HTMLInputElement.value. However in the case of getters (as in line 3) the offset correctly starts from v instead of someplace else.

I am wondering if you meant to show the offset of the value being set (hence the offset is at the equal to sign) and not the exact API itself?

Looking forward to your response!
Thanks,
Aswad

@sohomdatta1
Copy link
Collaborator

I think this is a quirk of V8, the getter and setter offsets are pulled from the stack trace API inside V8.

The most probable cause for the discrepancy you are seeing is that our functions are hooking into V8 at a point where the runtime has only ingested till the = token in the setter's case whereas, for the getter's case, the runtime must ingest almost the whole line to predict what kind of operation is being performed.

@aswad546
Copy link
Author

Okay, thanks for your quick response, I guess I can fix this in the post-processor.

@sohomdatta1
Copy link
Collaborator

Feel free to send us a patch if you figure out a reliable way to do this :)

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

No branches or pull requests

3 participants