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

Unified Diff: src/api.cc

Issue 952893006: Take the ScriptOrigin into account for CompileFunctionInContext (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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 | src/compiler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index fbbb5223f2939d6f37065ebdb832a387b363a348..ab82ea58af98ea1292c1efaf8691b13cdad10cef 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -1705,9 +1705,32 @@ Local<Function> ScriptCompiler::CompileFunctionInContext(
}
EXCEPTION_PREAMBLE(isolate);
+ i::Handle<i::Object> name_obj;
+ int line_offset = 0;
+ int column_offset = 0;
+ bool is_embedder_debug_script = false;
+ bool is_shared_cross_origin = false;
+ if (!source->resource_name.IsEmpty()) {
+ name_obj = Utils::OpenHandle(*(source->resource_name));
+ }
+ if (!source->resource_line_offset.IsEmpty()) {
+ line_offset = static_cast<int>(source->resource_line_offset->Value());
+ }
+ if (!source->resource_column_offset.IsEmpty()) {
+ column_offset = static_cast<int>(source->resource_column_offset->Value());
+ }
+ if (!source->resource_is_shared_cross_origin.IsEmpty()) {
+ is_shared_cross_origin = source->resource_is_shared_cross_origin->IsTrue();
+ }
+ if (!source->resource_is_embedder_debug_script.IsEmpty()) {
+ is_embedder_debug_script =
+ source->resource_is_embedder_debug_script->IsTrue();
+ }
i::MaybeHandle<i::JSFunction> maybe_fun = i::Compiler::GetFunctionFromEval(
source_string, outer_info, context, i::SLOPPY,
- i::ONLY_SINGLE_FUNCTION_LITERAL, scope_position);
+ i::ONLY_SINGLE_FUNCTION_LITERAL, line_offset,
+ column_offset - scope_position, name_obj, is_embedder_debug_script,
+ is_shared_cross_origin);
i::Handle<i::JSFunction> fun;
has_pending_exception = !maybe_fun.ToHandle(&fun);
EXCEPTION_BAILOUT_CHECK(isolate, Local<Function>());
« no previous file with comments | « no previous file | src/compiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698