mirror of
https://github.com/denoland/deno.git
synced 2025-09-27 04:39:10 +00:00
Wrap deno library in a namespace.
This commit is contained in:
parent
9df9cdae07
commit
092ec21381
4 changed files with 14 additions and 6 deletions
|
@ -10,7 +10,7 @@
|
|||
#include "snapshot_deno.cc"
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
v8_init();
|
||||
deno::v8_init();
|
||||
|
||||
auto natives_blob = *StartupBlob_natives();
|
||||
printf("natives_blob %d bytes\n", natives_blob.raw_size);
|
||||
|
@ -21,10 +21,10 @@ int main(int argc, char** argv) {
|
|||
v8::V8::SetNativesDataBlob(&natives_blob);
|
||||
v8::V8::SetSnapshotDataBlob(&snapshot_blob);
|
||||
|
||||
Deno* d = deno_from_snapshot(&snapshot_blob, NULL, NULL);
|
||||
int r = deno_load(d, "main2.js", "foo();");
|
||||
deno::Deno* d = deno::deno_from_snapshot(&snapshot_blob, NULL, NULL);
|
||||
int r = deno::deno_load(d, "main2.js", "foo();");
|
||||
if (r != 0) {
|
||||
printf("Error! %s\n", deno_last_exception(d));
|
||||
printf("Error! %s\n", deno::deno_last_exception(d));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue