prevwong/reka.js

Bug if default object is instantiated with global value

def-roth opened this issue · 0 comments

Occurs if objects are set as defaults for props after closing and reopening the code editor. Then a comma is inserted wrong.

val isModalOpen:any = false;

// good
component Header(
 default={"open": isModalOpen }
) => (...)
val isModalOpen:any = false;

// bad
component Header(
 default:any={,
 "open": isModalOpen,
 }
) => (...)

If the comma gets removed one gets an unexpected error at the beginning of the document. Which is fixed if both commas are rmoved as in the good example.