Index: src/FileSystemJsObject.cpp |
=================================================================== |
--- a/src/FileSystemJsObject.cpp |
+++ b/src/FileSystemJsObject.cpp |
@@ -94,18 +94,18 @@ |
{ |
} |
void Run() |
{ |
std::string error; |
try |
{ |
- std::shared_ptr<std::iostream> stream(new std::stringstream); |
- *stream << content; |
+ std::stringstream stream; |
+ stream << content; |
fileSystem->Write(path, stream); |
} |
catch (std::exception& e) |
{ |
error = e.what(); |
} |
catch (...) |
{ |
@@ -344,18 +344,18 @@ |
std::string resolved = jsEngine->GetFileSystem()->Resolve(converted[0]->AsString()); |
return Utils::ToV8String(isolate, resolved); |
} |
} |
-JsValuePtr FileSystemJsObject::Setup(JsEnginePtr jsEngine, JsValuePtr obj) |
+JsValuePtr FileSystemJsObject::Setup(JsEngine& jsEngine, const JsValuePtr& obj) |
{ |
- obj->SetProperty("read", jsEngine->NewCallback(::ReadCallback)); |
- obj->SetProperty("write", jsEngine->NewCallback(::WriteCallback)); |
- obj->SetProperty("move", jsEngine->NewCallback(::MoveCallback)); |
- obj->SetProperty("remove", jsEngine->NewCallback(::RemoveCallback)); |
- obj->SetProperty("stat", jsEngine->NewCallback(::StatCallback)); |
- obj->SetProperty("resolve", jsEngine->NewCallback(::ResolveCallback)); |
+ obj->SetProperty("read", jsEngine.NewCallback(::ReadCallback)); |
+ obj->SetProperty("write", jsEngine.NewCallback(::WriteCallback)); |
+ obj->SetProperty("move", jsEngine.NewCallback(::MoveCallback)); |
+ obj->SetProperty("remove", jsEngine.NewCallback(::RemoveCallback)); |
+ obj->SetProperty("stat", jsEngine.NewCallback(::StatCallback)); |
+ obj->SetProperty("resolve", jsEngine.NewCallback(::ResolveCallback)); |
return obj; |
} |