Skip to content

Commit

Permalink
Revert "Revert "Merge pull request #53 from BinaryMuse/mkt/fix-unable…
Browse files Browse the repository at this point in the history
…-to-use-constructor-as-key""

This reverts commit bf91049.
  • Loading branch information
BinaryMuse committed Jan 30, 2019
1 parent 0527511 commit b014023
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ function compile(nodes) {
var assignedPaths = [];
var valueAssignments = [];
var currentPath = "";
var data = {};
var data = Object.create(null);
var context = data;
var arrayMode = false;

Expand Down
10 changes: 10 additions & 0 deletions test/test_toml.js
Original file line number Diff line number Diff line change
Expand Up @@ -584,3 +584,13 @@ exports.testErrorsHaveCorrectLineAndColumn = function(test) {
test.done();
}
};

exports.testUsingConstructorAsKey = function(test) {
test.parsesToml("[empty]\n[emptier]\n[constructor]\n[emptiest]", {
"empty": {},
"emptier": {},
"constructor": {},
"emptiest": {}
});
test.done();
};

0 comments on commit b014023

Please sign in to comment.