Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -45337,7 +45337,7 @@ <h1>
1. If IsSharedArrayBuffer(_arrayBuffer_) is *true*, then
1. Let _execution_ be _AR_.[[CandidateExecution]].
1. Let _eventsRecord_ be the Agent Events Record of _execution_.[[EventsRecords]] whose [[AgentSignifier]] is AgentSignifier().
1. If _isTypedArray_ is *true* and IsNoTearConfiguration(_type_, _order_) is *true*, let _noTear_ be *true*; else let _noTear_ be *false*.
1. If _isTypedArray_ is *true*, let _noTear_ be IsNoTearConfiguration(_type_, _order_); else let _noTear_ be *false*.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how is this simplified? it's just moving where the "let" happens, and making only one of the possible values be hardcoded, which seems at best the same, and at worst more complex

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @ljharb: the new version is shorter, but the older one is simpler to read.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we wrote this line out as code, it would look like

let noTear = isTypedArray && IsNoTearConfiguration(ty, order) ? true : false;

which would be flagged by probably just about any linting configuration. The way we would actually write this in code would probably look something like

let noTear = isTypedArray && IsNoTearConfiguration(ty, order);

but the best we can do in spec text is the equivalent of

let noTear = isTypedArray ? IsNoTearConfiguration(ty, order) : false;

which definitely seems better than the first example to me.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Buuuuuut it's not code, it's prose. And as prose, the current text is more readable.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah keep the original, not a fan of this change

1. Append WriteSharedMemory { [[Order]]: _order_, [[NoTear]]: _noTear_, [[Block]]: _block_, [[ByteIndex]]: _byteIndex_, [[ElementSize]]: _elementSize_, [[Payload]]: _rawBytes_ } to _eventsRecord_.[[EventList]].
1. Else,
1. Store the individual bytes of _rawBytes_ into _block_, starting at _block_[_byteIndex_].
Expand Down
Loading