Skip to content

Implement the "this" keyword #264

Closed

Description

@Razican

The this keyword returns an expression dependent on the context where it's being used. This context is resolved by the ResolveThisBinding() abstract operation. This abstract operation will get the current environment record, and return the this binding, if any.

The MDN documentation also explains how this keyword will resolve to a different expression depending on how it's called.

To implement this, we require changes to the parser, where keywords are parsed (parser.rs#L112), which will probably require a new ExprDef. Executing that expression in the executor, it should return the object representing the this binding.

Activity

  1. added
    Help Wanted
    on Mar 4, 2020
  2. jasonwilliams commented on Mar 4, 2020

    @jasonwilliams
    Member

    Thanks for making this

  3. Razican commented on Mar 9, 2020

    @Razican
    MemberAuthor

    I just noticed that #185 exists.

  4. jasonwilliams commented on Mar 9, 2020

    @jasonwilliams
    Member

    it does but its quite an old pr now

  5. added
    A-Enhancement
    on Apr 3, 2020
  6. linked a pull request that will close this issueImplement this expression #185on May 7, 2020
  7. added this to the v0.8.0 milestone on May 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-EnhancementHelp Wanted

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions