Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(465)

Unified Diff: samples/hello-world.cc

Issue 1219133004: Remove usage of to-be-deprecated APIs from samples (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | samples/process.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/hello-world.cc
diff --git a/samples/hello-world.cc b/samples/hello-world.cc
index c38c76022cd67ece2c2937bcf938a1a5a3f20441..8be5a31fca4a748eaa7d82010ad79bdf17d8e2a6 100644
--- a/samples/hello-world.cc
+++ b/samples/hello-world.cc
@@ -47,13 +47,15 @@ int main(int argc, char* argv[]) {
Context::Scope context_scope(context);
// Create a string containing the JavaScript source code.
- Local<String> source = String::NewFromUtf8(isolate, "'Hello' + ', World!'");
+ Local<String> source =
+ String::NewFromUtf8(isolate, "'Hello' + ', World!'",
+ NewStringType::kNormal).ToLocalChecked();
// Compile the source code.
- Local<Script> script = Script::Compile(source);
+ Local<Script> script = Script::Compile(context, source).ToLocalChecked();
// Run the script to get the result.
- Local<Value> result = script->Run();
+ Local<Value> result = script->Run(context).ToLocalChecked();
// Convert the result to an UTF8 string and print it.
String::Utf8Value utf8(result);
« no previous file with comments | « no previous file | samples/process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698