BinaryMuse / toml-node

TOML parser for Node.js and the Browser. Parses TOML v0.4.0
http://binarymuse.github.io/toml-node/
MIT License
306 stars 30 forks source link

The word "constructor" cannot be used as a key or table name #52

Closed atdyer closed 5 years ago

atdyer commented 5 years ago

To recreate, open the live demo and replace any key or table name with the word constructor. Even using quotes around the word does not prevent crashing.

Creating an empty table with the name constructor does not cause a crash, but simply omits the empty table altogether:

[empty]
[emptier]
[constructor]
[emptiest]

results in

{
  "empty": {},
  "emptier": {},
  "emptiest": {}
}
BinaryMuse commented 5 years ago

This is fixed in v2.3.4

BinaryMuse commented 5 years ago

I lied! 🙈 This is fully fixed in v2.3.5.

atdyer commented 5 years ago

Excellent! Thanks for such a quick turnaround :+1:

BinaryMuse commented 5 years ago

Due to https://github.com/BinaryMuse/toml-node/issues/55, this has been reverted in v2.3.6 but is present in the newly published v3.0.0. Very sorry for the trouble.