JintThisExpression.cs 595 B

12345678910111213141516171819202122
  1. using Jint.Native;
  2. namespace Jint.Runtime.Interpreter.Expressions;
  3. internal sealed class JintThisExpression : JintExpression
  4. {
  5. public JintThisExpression(ThisExpression expression) : base(expression)
  6. {
  7. }
  8. protected override object EvaluateInternal(EvaluationContext context)
  9. {
  10. return context.Engine.ResolveThisBinding();
  11. }
  12. public override JsValue GetValue(EvaluationContext context)
  13. {
  14. // need to notify correct node when taking shortcut
  15. context.LastSyntaxElement = _expression;
  16. return context.Engine.ResolveThisBinding();
  17. }
  18. }