JintThisExpression.cs 662 B

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