question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

This came up while trying to parse automaticRefund.js from the Zoe docs.

The other tweaks seem to be captured in issues already…

  • skip import: #8
  • skip await / async: #32
  • use “” rather than quasi strings (acknowledged TODO in tinyses.js)
  • omit trailing commas (this issue)
  • omit comments (presumably known issue)
const ast3 = jessie`
const makeContract = harden((zoe, terms) => {
  let count = 0;
  const automaticRefund = harden({
    makeOffer: escrowReceipt => {
      const { offerHandle } = zoe.burnEscrowReceipt(escrowReceipt);
      count += 1;
      zoe.complete(harden([offerHandle]));
      return "The offer was accepted";
    },
    getOffersCount: () => count
  });
  return harden({
    instance: automaticRefund,
    assays: terms.assays
  });
});
`;

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
michaelfigcommented, Nov 16, 2019
1reaction
erightscommented, Nov 15, 2019

I’d prefer to hear from somebody like @erights

Because this syntactic pattern should be encouraged, the Jessie grammar should allow trailing commas. I’m glad it does.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Trailing commas - JavaScript - MDN Web Docs
Trailing commas (sometimes called "final commas") can be useful when adding new elements, parameters, or properties to JavaScript code.
Read more >
trailing commas - recology
Let's talk about trailing commas (aka: “final commas”, “dangling commas”). Trailing commas refers to a comma at the end of a series of ......
Read more >
Learn JavaScript ES 2017 — Trailing Commas - codeburst
A trailing comma is simply a comma that comes after the last item in our list. It's not required, but in some instances...
Read more >
Are you using Trailing Commas in your JavaScript?
I have heard this argument many times. If there is a trailing comma, it feels like something is missing or it is wrong....
Read more >
Code Syntax Style: Trailing Commas - ReSharper - JetBrains
Code Syntax Style: Trailing Commas ... When multiple items are separated by the comma (object, array, and collection initializers, as well as enums...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found