diff options
author | Kevin (Kun) "Kassimo" Qian <kevinkassimo@gmail.com> | 2019-01-15 09:19:58 -0800 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-01-15 12:19:58 -0500 |
commit | c870cf40823a4900278f8ddf03489338c169878b (patch) | |
tree | 80c171f7bb36c988f459a4d0ee248a40d3feb34b /libdeno/binding.cc | |
parent | ac6ac5037ff53f4e7b9693aeed24f1e3ef1339ad (diff) |
Add --prefetch flag for deps prefetch without running (#1475)
Diffstat (limited to 'libdeno/binding.cc')
-rw-r--r-- | libdeno/binding.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libdeno/binding.cc b/libdeno/binding.cc index a1b3f20f1..d292f2638 100644 --- a/libdeno/binding.cc +++ b/libdeno/binding.cc @@ -590,7 +590,7 @@ void DenoIsolate::ResolveOk(const char* filename, const char* source) { } bool ExecuteMod(v8::Local<v8::Context> context, const char* js_filename, - const char* js_source) { + const char* js_source, bool resolve_only) { auto* isolate = context->GetIsolate(); v8::Isolate::Scope isolate_scope(isolate); v8::HandleScope handle_scope(isolate); @@ -616,6 +616,11 @@ bool ExecuteMod(v8::Local<v8::Context> context, const char* js_filename, } CHECK_EQ(v8::Module::kInstantiated, module->GetStatus()); + + if (resolve_only) { + return true; + } + auto result = module->Evaluate(context); if (result.IsEmpty()) { |