summaryrefslogtreecommitdiff
path: root/deps/v8/test
diff options
context:
space:
mode:
authorGus Caplan <me@gus.host>2019-07-19 09:22:56 -0500
committerGus Caplan <me@gus.host>2019-07-19 16:45:45 -0500
commitb7bcfc9d7e0083a2f8aedd4010853140163eefc5 (patch)
tree8e1c35a3cfe5a4080600e8b3c72dcdccab72e98c /deps/v8/test
parent15d44bf6f0cf0cd390009c7c547a5113c7bcb7d0 (diff)
downloadandroid-node-v8-b7bcfc9d7e0083a2f8aedd4010853140163eefc5.tar.gz
android-node-v8-b7bcfc9d7e0083a2f8aedd4010853140163eefc5.tar.bz2
android-node-v8-b7bcfc9d7e0083a2f8aedd4010853140163eefc5.zip
deps: V8: backport b33af60
Original commit message: [api] Get ScriptOrModule from CompileFunctionInContext Adds a new out param which allows accessing the ScriptOrModule of a function, which allows an embedder such as Node.js to use the function's i::Script lifetime. Refs: https://github.com/nodejs/node-v8/issues/111 Change-Id: I34346d94d76e8f9b8377c97d948673f4b95eb9d5 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1699698 Reviewed-by: Yang Guo <yangguo@chromium.org> Commit-Queue: Yang Guo <yangguo@chromium.org> Cr-Commit-Position: refs/heads/master@{#62830} Refs: https://github.com/v8/v8/commit/b33af60dd9e7e5b2557b9fbf3fdb80209f6db844 PR-URL: https://github.com/nodejs/node/pull/28671 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Guy Bedford <guybedford@gmail.com>
Diffstat (limited to 'deps/v8/test')
-rw-r--r--deps/v8/test/cctest/test-compiler.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/deps/v8/test/cctest/test-compiler.cc b/deps/v8/test/cctest/test-compiler.cc
index 17f7a7d851..cb559d8fe2 100644
--- a/deps/v8/test/cctest/test-compiler.cc
+++ b/deps/v8/test/cctest/test-compiler.cc
@@ -647,11 +647,16 @@ TEST(CompileFunctionInContextScriptOrigin) {
v8::Integer::New(CcTest::isolate(), 22),
v8::Integer::New(CcTest::isolate(), 41));
v8::ScriptCompiler::Source script_source(v8_str("throw new Error()"), origin);
+ Local<ScriptOrModule> script;
v8::Local<v8::Function> fun =
- v8::ScriptCompiler::CompileFunctionInContext(env.local(), &script_source,
- 0, nullptr, 0, nullptr)
+ v8::ScriptCompiler::CompileFunctionInContext(
+ env.local(), &script_source, 0, nullptr, 0, nullptr,
+ v8::ScriptCompiler::CompileOptions::kNoCompileOptions,
+ v8::ScriptCompiler::NoCacheReason::kNoCacheNoReason, &script)
.ToLocalChecked();
CHECK(!fun.IsEmpty());
+ CHECK(!script.IsEmpty());
+ CHECK(script->GetResourceName()->StrictEquals(v8_str("test")));
v8::TryCatch try_catch(CcTest::isolate());
CcTest::isolate()->SetCaptureStackTraceForUncaughtExceptions(true);
CHECK(fun->Call(env.local(), env->Global(), 0, nullptr).IsEmpty());