dart-archive / ts2dart

ts2dart TypeScript to Dart transpiler
Apache License 2.0
180 stars 61 forks source link

Support object literal sugaring #297

Open matsko opened 9 years ago

matsko commented 9 years ago

Typescript and ES6 allow for this:

var name = "matias";
var info = {name};
console.log(info); // { name: "matias" }

Is there anyway we can support like this for the dart side of things via ts2dart?

mprobst commented 9 years ago

Yes. You'd need to add some code here to handle the appropriate SyntaxKind, and explicitly emit the properties.

However this code here looks as if we should already support them. What's the error you're getting?