-
-
Notifications
You must be signed in to change notification settings - Fork 562
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
caller is undefined,but it's not undefined in broswer. #1971
Comments
Although this is not a standard definition feature. But I think Jint should be closer to the actual behavior of browsers while respecting the standard. |
Would you like to propose a PR to implement this? |
I don't mind propose an RP . But I'm probably not good at this,due to I'm usually too lazy to write unit tests. But as far as this function is concerned, there should be no side effects. Engine.cs >FunctionDeclarationInstantiation
|
Any updates? |
I only added one line of code, and the local compilation was fine. |
The compilation is fine, yes. The problems are tests. I know you said you give up, but the PR workflow failed because there are tests (https://github.com/tc39/test262) that check jint whether is actually spec compliant, meaning following the requirements of what is allowed and not allowed. For example, according to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/caller (note: MDN web docs is not the spec):
That means you at the minimum needs to check if the current context is in strict mode before returning any value, and there are tests in test262 that check this. You can not "fix" a behavior mismatch by creating another 100+ specification violations, that would only make the behavior of jint even further from browsers. Have a nice day. |
Version used
4.0.2
Describe the bug
caller is undefined,but it's not undefined in broswer.
To Reproduce
Expected behavior
caller should be not undefined,in up code,its should be "h()";
Additional context
im using AngleSharp.Js.
AngleSharp/AngleSharp.Js#98
The text was updated successfully, but these errors were encountered: