Last active
August 15, 2016 21:00
-
-
Save mattpodwysocki/7b613ca36ef22d2cc4241b19c5c2ed04 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IAsyncOperation<String^>^ ChakraJavaScriptExecutor::RunScriptFromFile(String^ sourceUri) | |
{ | |
Uri^ fileUri = ref new Uri(sourceUri); | |
return create_async([this, fileUri, sourceUri] | |
{ | |
return create_task(StorageFile::GetFileFromApplicationUriAsync(fileUri)) | |
.then([this, sourceUri](StorageFile^ storageFile) | |
{ | |
return create_task(FileIO::ReadTextAsync(storageFile)); | |
}) | |
.then([this, sourceUri](String^ str) | |
{ | |
return create_async([this, sourceUri, str] { return this->RunScript(str, sourceUri); }); | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment