Failed to apply patch for src/api.cc:
While running git apply --index -3 -p1;
error: patch failed: src/api.cc:1641
Falling back to three-way merge...
Applied patch to 'src/api.cc' with conflicts.
U src/api.cc
Patch: src/api.cc
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index
ebe73a99e62cc4b7d80bc49bf7fb9512cf49da9d..591c375238659d249a39dbcc1944d024582d884a
100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -202,6 +202,24 @@ class CallDepthScope {
} // namespace
+static ScriptOrigin GetScriptOriginForScript(i::Isolate* isolate,
+ i::Handle<i::Script> script) {
+ i::Handle<i::Object> scriptName(i::Script::GetNameOrSourceURL(script));
+ i::Handle<i::Object> source_map_url(script->source_mapping_url(),
isolate);
+ v8::Isolate* v8_isolate =
+ reinterpret_cast<v8::Isolate*>(script->GetIsolate());
+ v8::ScriptOrigin origin(
+ Utils::ToLocal(scriptName),
+ v8::Integer::New(v8_isolate, script->line_offset()->value()),
+ v8::Integer::New(v8_isolate, script->column_offset()->value()),
+ v8::Boolean::New(v8_isolate, script->is_shared_cross_origin()),
+ v8::Integer::New(v8_isolate, script->id()->value()),
+ v8::Boolean::New(v8_isolate, script->is_embedder_debug_script()),
+ Utils::ToLocal(source_map_url));
+ return origin;
+}
+
+
// --- E x c e p t i o n B e h a v i o r ---
@@ -1619,6 +1637,7 @@ Local<UnboundScript>
ScriptCompiler::CompileUnboundInternal(
{ i::HandleScope scope(isolate);
i::HistogramTimerScope total(isolate->counters()->compile_script(),
true);
i::Handle<i::Object> name_obj;
+ i::Handle<i::Object> source_map_url;
int line_offset = 0;
int column_offset = 0;
bool is_embedder_debug_script = false;
@@ -1641,11 +1660,14 @@ Local<UnboundScript>
ScriptCompiler::CompileUnboundInternal(
is_embedder_debug_script =
source->resource_is_embedder_debug_script->IsTrue();
}
+ if (!source->source_map_url.IsEmpty()) {
+ source_map_url = Utils::OpenHandle(*(source->source_map_url));
+ }
EXCEPTION_PREAMBLE(isolate);
i::Handle<i::SharedFunctionInfo> result = i::Compiler::CompileScript(
str, name_obj, line_offset, column_offset,
is_embedder_debug_script,
- is_shared_cross_origin, isolate->native_context(), NULL,
&script_data,
- options, i::NOT_NATIVES_CODE, is_module);
+ is_shared_cross_origin, source_map_url, isolate->native_context(),
NULL,
+ &script_data, options, i::NOT_NATIVES_CODE, is_module);
has_pending_exception = result.is_null();
if (has_pending_exception && script_data != NULL) {
// This case won't happen during normal operation; we have compiled
@@ -1877,6 +1899,11 @@ Local<Script> ScriptCompiler::Compile(Isolate*
v8_isolate,
script->set_is_embedder_debug_script(
origin.ResourceIsEmbedderDebugScript()->IsTrue());
}
+ if (!origin.SourceMapUrl().IsEmpty()) {
+ script->set_source_mapping_url(
+ *Utils::OpenHandle(*(origin.SourceMapUrl())));
+ }
+
source->info->set_script(script);
source->info->SetContext(isolate->native_context());
@@ -2134,17 +2161,7 @@ ScriptOrigin Message::GetScriptOrigin() const {
i::Handle<i::JSValue> script_value =
i::Handle<i::JSValue>::cast(script_wraper);
i::Handle<i::Script> script(i::Script::cast(script_value->value()));
- i::Handle<i::Object> scriptName(i::Script::GetNameOrSourceURL(script));
- v8::Isolate* v8_isolate =
- reinterpret_cast<v8::Isolate*>(script->GetIsolate());
- v8::ScriptOrigin origin(
- Utils::ToLocal(scriptName),
- v8::Integer::New(v8_isolate, script->line_offset()->value()),
- v8::Integer::New(v8_isolate, script->column_offset()->value()),
- v8::Boolean::New(v8_isolate, script->is_shared_cross_origin()),
- v8::Integer::New(v8_isolate, script->id()->value()),
- v8::Boolean::New(v8_isolate, script->is_embedder_debug_script()));
- return origin;
+ return GetScriptOriginForScript(isolate, script);
}
@@ -4442,16 +4459,7 @@ ScriptOrigin Function::GetScriptOrigin() const {
i::Handle<i::JSFunction> func = Utils::OpenHandle(this);
if (func->shared()->script()->IsScript()) {
i::Handle<i::Script> script(i::Script::cast(func->shared()->script()));
- i::Handle<i::Object> scriptName =
i::Script::GetNameOrSourceURL(script);
- v8::Isolate* isolate =
reinterpret_cast<v8::Isolate*>(func->GetIsolate());
- v8::ScriptOrigin origin(
- Utils::ToLocal(scriptName),
- v8::Integer::New(isolate, script->line_offset()->value()),
- v8::Integer::New(isolate, script->column_offset()->value()),
- v8::Boolean::New(isolate, script->is_shared_cross_origin()),
- v8::Integer::New(isolate, script->id()->value()),
- v8::Boolean::New(isolate, script->is_embedder_debug_script()));
- return origin;
+ return GetScriptOriginForScript(func->GetIsolate(), script);
}
return v8::ScriptOrigin(Handle<Value>());
}
https://codereview.chromium.org/983603003/
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.