GithubHelp home page GithubHelp logo

Comments (9)

bakkot avatar bakkot commented on July 3, 2024 1

The question mark should attach to the AO call, not the field value.

... Why? That's not the obvious-to-me parse of that expression. (Compare e.g. ! a().b in JS.)

from ecmarkup.

bakkot avatar bakkot commented on July 3, 2024 1

I think I can fix this easily enough, but to be honest the extra binding seems like a good thing from a readability point of view, so I'm probably not going to prioritize it right away.

from ecmarkup.

ljharb avatar ljharb commented on July 3, 2024

Why are the parens needed at all in the first case? The question mark should attach to the AO call, not the field value.

from ecmarkup.

jmdyck avatar jmdyck commented on July 3, 2024

There are two examples in the spec where the operand of ? is a field-extraction, both in InnerModuleEvaluation:

  • return ? _module_.[[EvaluationError]]
  • return ? _requiredModule_.[[EvaluationError]]

In each case, the intended parse is
return ? (_foo_.[[EvaluationError]])
not
return (? _foo_).[[EvaluationError]]

from ecmarkup.

ljharb avatar ljharb commented on July 3, 2024

@bakkot because i don’t expect completion records to be stored in record fields, but i do expect them to be the result of an AO call. I don’t think JS has a comparison because completion records are so weird a concept.

from ecmarkup.

bakkot avatar bakkot commented on July 3, 2024

Completion records can be stored in record fields. They're just a value like any other.

from ecmarkup.

ljharb avatar ljharb commented on July 3, 2024

Sure, that's just not something we ever do, afaik, hence my expectation.

from ecmarkup.

jmdyck avatar jmdyck commented on July 3, 2024

I already gave an example where we do that: the [[EvaluationError]] field of a Cyclic Module Record is a throw completion or ~empty~.

from ecmarkup.

ljharb avatar ljharb commented on July 3, 2024

Ah, fair enough. My expectation still holds, and using parens should ofc work, and i agree the separate alias is cleaner.

from ecmarkup.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.