domenic / promises-unwrapping

The ES6 promises spec, as per September 2013 TC39 meeting
1.23k stars 94 forks source link

Stop using function-call notation #34

Closed domenic closed 10 years ago

domenic commented 10 years ago

The ES spec, unfortunately, prefers verbose things like

Return the result of calling the [[X]] internal method of y passing z and w as the arguments.

Whereas I have written things as

Return y.[[X]](z, w).

domenic commented 10 years ago

@allenwb, looking at the draft, I am confused about best practice for abstract operations that are not internal methods of objects. It seems clear that for internal methods, you use the "return the result of ..." quoted above. But for general abstract operations, I see any of:

Let replStr be the result of the abstract operation GetReplaceSubstitution(matched, string, pos, captures).

Let rx be the result of the abstract operation RegExpCreate (21.2.3.3) with arguments regexp and undefined.

Let next be the result of IteratorStep(iterator).

Let nextValue be IteratorValue(next).

Obviously I'm a fan of the last one. Which should it be? And any thoughts on the internal methods case?

domenic commented 10 years ago

I have settled on

Let next be the result of calling AbstractOperation(arg1, arg2).

This is largely done except inside operations which I still anticipate other revisions for.

allenwb commented 10 years ago

any of these are fine. Depending upon the phase of the moon I might change such things. But probably not.

domenic commented 10 years ago

Fixed by tonight/this morning's commits.