Fix double-destruct of string on syntax error
Reviewed By: davidaurelio Differential Revision: D2939260 fb-gh-sync-id: b080b70aae7e33297d549d387e40bde07f4fc765 shipit-source-id: b080b70aae7e33297d549d387e40bde07f4fc765
This commit is contained in:
parent
027f26df57
commit
e1fed608e8
|
@ -55,7 +55,7 @@ JSValueRef evaluateScript(JSContextRef context, JSStringRef script, JSStringRef
|
||||||
auto line = exception.asObject().getProperty("line");
|
auto line = exception.asObject().getProperty("line");
|
||||||
|
|
||||||
std::ostringstream locationInfo;
|
std::ostringstream locationInfo;
|
||||||
std::string file = source != nullptr ? String::adopt(source).str() : "";
|
std::string file = source != nullptr ? String::ref(source).str() : "";
|
||||||
locationInfo << "(" << (file.length() ? file : "<unknown file>");
|
locationInfo << "(" << (file.length() ? file : "<unknown file>");
|
||||||
if (line != nullptr && line.isNumber()) {
|
if (line != nullptr && line.isNumber()) {
|
||||||
locationInfo << ":" << line.asInteger();
|
locationInfo << ":" << line.asInteger();
|
||||||
|
|
Loading…
Reference in New Issue