Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor refactor in readEmAsmArgs. NFC #20054

Merged
merged 1 commit into from
Aug 18, 2023
Merged

Minor refactor in readEmAsmArgs. NFC #20054

merged 1 commit into from
Aug 18, 2023

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Aug 16, 2023

Split out from #19980

@sbc100 sbc100 requested a review from kripken August 16, 2023 22:47
readEmAsmArgsArray.push(readI53FromI64(buf++ << 2));
} else
// Special case for pointers under wasm64 which we read as int53 Numbers.
ch == {{{ charCode('p') }}} ? {{{ makeGetValue('buf++ << 2', 0, '*') }}} :
Copy link
Member

Choose a reason for hiding this comment

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

This is a ? : nested in another - is there no need for ( ) to avoid ambiguity in parsing..?

Copy link
Collaborator Author

@sbc100 sbc100 Aug 16, 2023

Choose a reason for hiding this comment

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

Seems like the nesting works as we expect it to here.

$ cat test.js 
function f(n) {
  return n == 1 ? 'one' :
         n == 2 ? 'two' :
         n == 3 ? 'three' : NaN;
}

console.log(f(1));
console.log(f(2));
console.log(f(3));
$ node test.js 
one
two
three

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for checking, might just be confusing for me personally then... 😄 but seems fine in compiler output if it's unambiguous.

@sbc100 sbc100 merged commit 78180aa into main Aug 18, 2023
2 of 3 checks passed
@sbc100 sbc100 deleted the em_asm branch August 18, 2023 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants