Comparing version 2.0.1 to 2.0.2
@@ -0,1 +1,8 @@ | ||
2.0.2 - Feb 23 2014 | ||
=================== | ||
### Bug Fixes | ||
* Fix absence of errors when table path starts or ends with period | ||
2.0.1 - Feb 23 2014 | ||
@@ -2,0 +9,0 @@ =================== |
@@ -61,2 +61,4 @@ function compile(nodes) { | ||
checkPath(path, line, column); | ||
if (assignedPaths.indexOf(path) > -1) { | ||
@@ -75,2 +77,4 @@ genError("Cannot redefine existing key '" + path + "'.", line, column); | ||
checkPath(path, line, column); | ||
if (assignedPaths.indexOf(path) === -1) assignedPaths.push(path); | ||
@@ -141,2 +145,9 @@ assignedPaths.push(path); | ||
} | ||
function checkPath(path, line, column) { | ||
if (path[0] === '.') | ||
genError("Cannot start a table key with '.'.", line, column) | ||
else if (path[path.length - 1] === '.') | ||
genError("Cannot end a table key with '.'.", line, column) | ||
} | ||
}; | ||
@@ -143,0 +154,0 @@ |
{ | ||
"name": "toml", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "TOML parser for Node.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -160,2 +160,18 @@ var toml = require('../'); | ||
exports.testErrorOnDotAtStartOfKey = function(test) { | ||
test.throws(function() { | ||
var str = "[.a]\nb = 1"; | ||
toml.parse(str); | ||
}); | ||
test.done() | ||
}; | ||
exports.testErrorOnDotAtEndOfKey = function(test) { | ||
test.throws(function() { | ||
var str = "[.a]\nb = 1"; | ||
toml.parse(str); | ||
}); | ||
test.done() | ||
}; | ||
exports.testErrorOnTableOverride = function(test) { | ||
@@ -162,0 +178,0 @@ test.throws(function() { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
85317
2426