Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index e2abb98ff92dd948e9288e1ba7a188c837122a8d..2697e098c5bc704a1ce73ee9bcbb2c90a8448c5a 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -1915,11 +1915,27 @@ MaybeLocal<Function> ScriptCompiler::CompileFunctionInContext( |
context = factory->NewWithContext(closure, context, extension); |
} |
+ i::Handle<i::Object> name_obj; |
+ int line_offset = 0; |
+ int column_offset = 0; |
+ 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()); |
+ } |
i::Handle<i::JSFunction> fun; |
- has_pending_exception = |
- !i::Compiler::GetFunctionFromEval( |
- source_string, outer_info, context, i::SLOPPY, |
- i::ONLY_SINGLE_FUNCTION_LITERAL, scope_position).ToHandle(&fun); |
+ has_pending_exception = !i::Compiler::GetFunctionFromEval( |
+ source_string, outer_info, context, i::SLOPPY, |
+ i::ONLY_SINGLE_FUNCTION_LITERAL, line_offset, |
+ column_offset - scope_position, name_obj, |
+ source->resource_options).ToHandle(&fun); |
+ if (has_pending_exception) { |
+ isolate->ReportPendingMessages(); |
+ } |
RETURN_ON_FAILED_EXECUTION(Function); |
i::Handle<i::Object> result; |