From add4cde68cd9b5c52db8a312a34591a8bb61d8fa Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Mon, 18 Dec 2017 11:40:06 +0000 Subject: Populate the sourceLocation field properly in standard JSON on errors --- libsolidity/interface/StandardCompiler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libsolidity/interface/StandardCompiler.cpp') diff --git a/libsolidity/interface/StandardCompiler.cpp b/libsolidity/interface/StandardCompiler.cpp index ad01821e..d44254ed 100644 --- a/libsolidity/interface/StandardCompiler.cpp +++ b/libsolidity/interface/StandardCompiler.cpp @@ -81,15 +81,15 @@ Json::Value formatErrorWithException( else message = _message; + Json::Value sourceLocation; if (location && location->sourceName) { - Json::Value sourceLocation = Json::objectValue; sourceLocation["file"] = *location->sourceName; sourceLocation["start"] = location->start; sourceLocation["end"] = location->end; } - return formatError(_warning, _type, _component, message, formattedMessage, location); + return formatError(_warning, _type, _component, message, formattedMessage, sourceLocation); } set requestedContractNames(Json::Value const& _outputSelection) -- cgit v1.2.3